The definitions for the '2 byte commands' in the SI7021 need to be reversed in "si7021.c", as the "i2cdev.c: i2c_dev_read" method is sending 2 byte command out in the reverse order.
The following change allows the serial number and FW_REV to be read correctly. (
Current si7021.c definitions result in the serial number being returned a '0x00 ... 0x00'.
Could not find function to read the device revision: Suggest that be added, as shown above.
Additional information or context
No response
Confirmation
[X] This report is not a question nor a request for drivers.
The issue
The definitions for the '2 byte commands' in the SI7021 need to be reversed in "si7021.c", as the "i2cdev.c: i2c_dev_read" method is sending 2 byte command out in the reverse order.
The following change allows the serial number and FW_REV to be read correctly. (
Suggested change:
Also added a " si7021_get_device_revision(i2c_dev_t dev, uint8_t rev)" for completeness.
In si7021.h:
/**
ESP_OK
on success / esp_err_t si7021_get_device_revision(i2c_dev_t dev, uint8_t *rev);In si7021.c
esp_err_t si7021_get_device_revision(i2c_dev_t dev, uint8_t rev) { CHECK_ARG( dev || rev); uint16_t cmd = CMD_READ_FW_REV_1;
}
Which SDK are you using?
esp-idf
Which version of SDK are you using?
5.x.x
Which build target have you used?
Component causing the issue
si7021
Anything in the logs that might be useful for us?
Additional information or context
No response
Confirmation