Question:
What does REG_NULL=0xAA means? Does it mean the parameter regAddr in rui_i2c_rw() will be ignored? I am asking this because my I2C device, during read, does not need the regAddr.
Hi, @bohlimsim
This parameter is not used in RAK5205 module.If Init ,you can config it to 0. devAddr and regAddr must be needed at IIC standard agreement ,but you could set up a custom address.
I could not get I2C-ADC chip ADS1114 to work in RAK5205m using your RUI I2C API (rui_i2c_rw etc).
But I could get ADS1114 to work in ESP32 (using its IDE framework), and also in beaglebone, within a day,
So there is no issue with my I2C concept/usage…
I am trying to read light lux from BH1750 using I2C today without successful. According to sample code in app_5205:
void bsp_i2c_init(void)
I2c_1.PIN_SDA = I2C_SDA;
I2c_1.PIN_SCL = I2C_SCL;
I printed out I2C_SDA = 24 and I2C_SCL=23, which I thought should be pin number 27 and 26 to the RAK811 diagram? (But I still can’t make it to work with this setting).
also my reading code as:
rui_i2c_rw(&I2c_1,RUI_IF_READ, 0x23, 0, data, 3);
power up code as:
rui_i2c_rw(&I2c_1,RUI_IF_WRITE, 0x23, 0, 0x01, 1);
Is this correct format?
Also, could you explain more about command rui_light_set_mode and rui_light_get_strength please? What light sensor do you need for this command?
Hi,@fangfchen
Sorry,this is a negligence. The pin number 18 is I2C_SCL and 19 is I2C_SDA At RAK811 module . I’ll fix it to module pin number.This pin number is fixed for I2C,because RAK811 used hardware i2c,so it can’t remap to other pin.
When I compile and load code into rak811, the module does not work, nothing happens. I use usb-ttl to download the program. I try to use the program with AT command and it works, but rui do not work
int main(void)
{
int i;
static RUI_RETURN_STATUS rui_return_status;
RUI_LORA_STATUS_T app_lora_status; //record status
rui_lora_get_status(false,&app_lora_status);;//The query gets the current device status
static uint8_t sensor_data_cnt=0; //send data counter by LoRa
rui_init();
void rui_uart_recv(RUI_UART1, 2, 1)
while (1) {
rui_lora_get_status(false,&app_lora_status);//The query gets the current status
rui_running();