i2c: handle errors at i2ccmds

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
Timofey Titovets
2024-10-21 14:19:56 +02:00
committed by KevinOConnor
parent 08a85ba869
commit a4aa2a9002
20 changed files with 123 additions and 49 deletions

View File

@@ -4,6 +4,15 @@
#include <inttypes.h>
#include "board/gpio.h" // i2c_config
// I2C ERROR Codes
enum {
I2C_BUS_SUCCESS,
I2C_BUS_NACK,
I2C_BUS_TIMEOUT,
I2C_BUS_START_NACK,
I2C_BUS_START_READ_NACK,
};
struct i2cdev_s {
union {
struct i2c_config i2c_hw;