Replies: 5 comments
-
![]() ![]() ![]() |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello, CODE, #define I2C_DEV_NAME "I2C_1" // Replace with your I2C controller's name void main(void) {
} Regards |
Beta Was this translation helpful? Give feedback.
-
@snowuyl, I hope you've managed to solve your issue. For anyone working on projects that require 10-bit addressing in I2C, here's some helpful information. To effectively experiment with I2C drivers, make sure to enable When dealing with 10-bit register addresses, setting
|
Beta Was this translation helpful? Give feedback.
-
@snowuyl Not sure if you're issue is resolved, but looking at that I2C spec for LP5861, it doesn't look like 10-bit addressing. For 10-bit addressing, the first byte MUST contain 0b11110XX (XX represents 2 bits from the slave address). Followed by the remaining 8 bits of the slave address in the second byte. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I try to read/write registers of TI LP5861 through I2C interface. But it failed with error code -5. Does Zephyr project provide sample code to read register with 10-bit register address ?
Expected behavior
Can reading/writing registers of TI LP5861 through I2C successfully.
Logs and console output
00> *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
00> Starting button Test example
00> device_is_ready() ok
00> nrfx_gpiote_input_configure() okay for button
00> val=1
00> button released
00> start a timer
00> now-1-11-30 0:0:0
00> 0
00> ledDriverInit
00> tca6424aReadReg(regAddr=0x0)
00> LP5861_REG_ADDR_HIGH(regAddr)=0x0, LP5861_REG_ADDR_LOW(regAddr)=0x0
00> devAddr=0x81, startAddr=0x0
00> [00:00:00.501,129] i2c_nrfx_twim: Error on I2C line occurred for message 0
00> i2c_burst_read(0x0) failed, ret=-5
00> _buttonTimerHandler: 3000
00> now-1-11-30 0:0:0
00> button released
Environment (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions