| Electronic Components Datasheet Search |
|
AS7263 Datasheet(PDF) 21 Page - OSRAM GmbH |
|
|
|||||||||||||||||||||||||||||
AS7263 Datasheet(HTML) 21 Page - OSRAM GmbH |
|
21 / 46 page ![]() Page 20 Datasheet, Public Document Feedback [v4-00] 2022-Nov-30 AS7263 − Detailed Description I²C Virtual Register Read Access Figure 20 shows the pseudocode necessary to read virtual reg- isters on the AS7263. Note that in this case, reading a virtual register, the register address is not modified. Figure 20: I²C Virtual Register Byte Read Pseudocode Poll I²C slave STATUS register; If TX_VALID bit is 0, the virtual register address for the read may be written; Send a virtual register address; Poll I²C slave STATUS register; If RX_VALID bit is 1, the read data is ready; Read the data. Sample Code: uint8_t i2cm_AS72xx_read(uint8_t virtualReg) { volatile uint8_t status, d ; while (1) { // Read slave I2C status to see if the read buffer is ready. status = i2cm_read(I2C_AS72XX_SLAVE_STATUS_REG) ; if ((status & I2C_AS72XX_SLAVE_TX_VALID) == 0) // No inbound TX pending at slave. Okay to write now. break ; } // Send the virtual register address (setting bit 7 to indicate a pending write). i2cm_write(I2C_AS72XX_SLAVE_WRITE_REG, virtualReg) ; while (1) { // Read the slave I²C status to see if our read data is available. status = i2cm_read(I2C_AS72XX_SLAVE_STATUS_REG) ; if ((status & I2C_AS72XX_SLAVE_RX_VALID) != 0) // Read data is ready. break ; } // Read the data to complete the operation. d = i2cm_read(I2C_AS72XX_SLAVE_READ_REG) ; return d ;s } The details of the i2cm_read() and i2cm_write() functions in previous Figures are dependent upon the nature and imple- mentation of the external I²C master device. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Datasheet Upload | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |