Lines Matching refs:mTask
244 static struct SensorData mTask;
272 osEnqueuePrivateEvt(EVT_SENSOR_PROX_INTERRUPT, NULL, NULL, mTask.tid);
307 osEnqueuePrivateEvt(EVT_SENSOR_I2C, cookie, NULL, mTask.tid);
314 osEnqueuePrivateEvt(EVT_SENSOR_ALS_TIMER, cookie, NULL, mTask.tid);
323 for (i = 0; i < ARRAY_SIZE(mTask.transfers); i++) {
324 if (!mTask.transfers[i].inUse) {
325 mTask.transfers[i].inUse = true;
326 mTask.transfers[i].state = state;
327 return &mTask.transfers[i];
398 if (on && !mTask.alsTimerHandle) {
399 mTask.alsTimerHandle = timTimerSet(ROHM_RPR0521_ALS_TIMER_DELAY, 0, 50, alsTimerCallback, NULL, false);
400 } else if (!on && mTask.alsTimerHandle) {
401 timTimerCancel(mTask.alsTimerHandle);
402 mTask.alsTimerHandle = 0;
405 mTask.lastAlsSample.idata = ROHM_RPR0521_ALS_INVALID;
406 mTask.alsOn = on;
408 setMode(on, mTask.proxOn, (on ? SENSOR_STATE_ENABLING_ALS : SENSOR_STATE_DISABLING_ALS));
414 return sensorSignalInternalEvt(mTask.alsHandle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
424 return sensorSignalInternalEvt(mTask.alsHandle, SENSOR_INTERNAL_EVT_RATE_CHG, rate, latency);
437 if (mTask.lastAlsSample.idata != ROHM_RPR0521_ALS_INVALID) {
438 result = osEnqueuePrivateEvt(sensorGetMyEventType(SENS_TYPE_ALS), mTask.lastAlsSample.vptr, NULL, tid);
448 extiClearPendingGpio(mTask.pin);
449 enableInterrupt(mTask.pin, &mTask.isr);
451 disableInterrupt(mTask.pin, &mTask.isr);
452 extiClearPendingGpio(mTask.pin);
455 mTask.proxState = PROX_STATE_INIT;
456 mTask.proxOn = on;
458 setMode(mTask.alsOn, on, (on ? SENSOR_STATE_ENABLING_PROX : SENSOR_STATE_DISABLING_PROX));
464 return sensorSignalInternalEvt(mTask.proxHandle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
474 return sensorSignalInternalEvt(mTask.proxHandle, SENSOR_INTERNAL_EVT_RATE_CHG, rate, latency);
508 if (mTask.proxState != PROX_STATE_INIT) {
509 sample.fdata = (mTask.proxState == PROX_STATE_NEAR) ? ROHM_RPR0521_REPORT_NEAR_VALUE : ROHM_RPR0521_REPORT_FAR_VALUE;
591 sensorUnregister(mTask.alsHandle);
592 sensorUnregister(mTask.proxHandle);
636 sensorRegisterInitComplete(mTask.alsHandle);
637 sensorRegisterInitComplete(mTask.proxHandle);
641 sensorSignalInternalEvt(mTask.alsHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, true, 0);
645 sensorSignalInternalEvt(mTask.proxHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, true, 0);
649 sensorSignalInternalEvt(mTask.alsHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, false, 0);
664 sensorSignalInternalEvt(mTask.proxHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, false, 0);
673 if (mTask.alsOn) {
675 if (mTask.lastAlsSample.idata != sample.idata) {
677 mTask.lastAlsSample.fdata = sample.fdata;
685 lastProxState = mTask.proxState;
689 if (mTask.proxOn) {
692 mTask.proxState = PROX_STATE_NEAR;
695 mTask.proxState = PROX_STATE_FAR;
698 if (mTask.proxState != lastProxState)
723 mTask.tid = myTid;
724 mTask.alsOn = false;
725 mTask.proxOn = false;
726 mTask.lastAlsSample.idata = ROHM_RPR0521_ALS_INVALID;
727 mTask.proxState = PROX_STATE_INIT;
729 mTask.pin = gpioRequest(PROX_INT_PIN);
730 gpioConfigInput(mTask.pin, GPIO_SPEED_LOW, GPIO_PULL_NONE);
731 syscfgSetExtiPort(mTask.pin);
732 mTask.isr.func = proxIsr;
735 mTask.alsHandle = sensorRegister(&sensorInfoAls, &sensorOpsAls, NULL, false);
736 mTask.proxHandle = sensorRegister(&sensorInfoProx, &sensorOpsProx, NULL, false);
745 disableInterrupt(mTask.pin, &mTask.isr);
746 extiUnchainIsr(PROX_IRQ, &mTask.isr);
747 extiClearPendingGpio(mTask.pin);
748 gpioRelease(mTask.pin);
750 sensorUnregister(mTask.alsHandle);
751 sensorUnregister(mTask.proxHandle);