Home | History | Annotate | Download | only in rohm_rpr0521

Lines Matching refs:xfer

289     struct I2cTransfer *xfer = cookie;
291 xfer->tx = tx;
292 xfer->rx = rx;
293 xfer->err = err;
327 struct I2cTransfer *xfer = allocXfer(state);
330 if (xfer != NULL) {
331 xfer->txrxBuf[0] = reg;
332 xfer->txrxBuf[1] = value;
333 ret = i2cMasterTx(I2C_BUS_ID, I2C_ADDR, xfer->txrxBuf, 2, i2cCallback, xfer);
472 struct I2cTransfer *xfer;
480 xfer = allocXfer(SENSOR_STATE_IDLE);
481 if (xfer != NULL) {
482 xfer->txrxBuf[0] = ROHM_RPR0521_REG_PS_OFFSET_LSB;
483 xfer->txrxBuf[1] = offset & 0xFF;
484 xfer->txrxBuf[2] = (offset >> 8) & 0x3;
485 i2cMasterTx(I2C_BUS_ID, I2C_ADDR, xfer->txrxBuf, 3, i2cCallback, xfer);
560 static void handle_i2c_event(struct I2cTransfer *xfer)
568 switch (xfer->state) {
579 if (xfer->err != 0 || xfer->txrxBuf[0] != ROHM_RPR0521_ID) {
658 als0 = *(uint16_t*)(xfer->txrxBuf);
659 als1 = *(uint16_t*)(xfer->txrxBuf+2);
674 ps = *(uint16_t*)(xfer->txrxBuf);
703 xfer->inUse = false;
748 struct I2cTransfer *xfer;
763 xfer = allocXfer(SENSOR_STATE_ALS_SAMPLING);
764 if (xfer != NULL) {
765 xfer->txrxBuf[0] = ROHM_RPR0521_REG_ALS_DATA0_LSB;
766 i2cMasterTxRx(I2C_BUS_ID, I2C_ADDR, xfer->txrxBuf, 1, xfer->txrxBuf, 4, i2cCallback, xfer);
772 xfer = allocXfer(SENSOR_STATE_PROX_SAMPLING);
773 if (xfer != NULL) {
774 xfer->txrxBuf[0] = ROHM_RPR0521_REG_PS_DATA_LSB;
775 i2cMasterTxRx(I2C_BUS_ID, I2C_ADDR, xfer->txrxBuf, 1, xfer->txrxBuf, 7, i2cCallback, xfer);