RUI and I2C on new compiler

Is it possible to have a rui_i2c command that just does a read, rather than a write then a read.
I am interfacing to a MCP3021 ADC, which doesn’t require a write

The rui command I am using is thus

ret_code = rui_i2c_rw(&I2c_1, RUI_IF_READ, MCP3021_ADDR, 0x00, data, 2);

and it produces this, which is a write of the byte 0x00 before it does a read of the 2 bytes

As opposed to calling the HAL function directly, which does what is required by simply doing the read.
HAL_I2C_Master_Receive(&hi2c1, MCP3021_ADDR_READ, data, 2, 10);

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.