| Electronic Components Datasheet Search |
|
AS7263 Datasheet(PDF) 20 Page - ams-OSRAM AG |
|
|
|||||||||||||||||||||||||||||
AS7263 Datasheet(HTML) 20 Page - ams-OSRAM AG |
|
20 / 46 page ![]() Datasheet, Public Page 19 [v4-00] 2022-Nov-30 Document Feedback AS7263 − Detailed Description Figure 19: I²C Virtual Register Byte Write Pseudocode Poll I²C slave STATUS register; If TX_VALID bit is 0, a write can be performed on the interface; Send a virtual register address and set the MSB of the register address to 1 to indicate the pending write; Poll I²C slave STATUS register; If TX_VALID bit is 0, the virtual register address for the write has been received and the data may now be written; Write the data. Sample Code: #define I2C_AS72XX_SLAVE_STATUS_REG0x00 #define I2C_AS72XX_SLAVE_WRITE_REG0x01 #define I2C_AS72XX_SLAVE_READ_REG0x02 #define I2C_AS72XX_SLAVE_TX_VALID0x02 #define I2C_AS72XX_SLAVE_RX_VALID0x01 void i2cm_AS72xx_write(uint8_t virtualReg, uint8_t d) { volatile uint8_tstatus; while (1) { // Read slave I²C status to see if the write 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 | 0x80)) ; while (1) { // Read the slave I2C status to see if the write 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 data now. break; } // Send the data to complete the operation. i2cm_write(I2C_AS72XX_SLAVE_WRITE_REG, d); } |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | 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 |