20#include <drivers/i2c.h>
21#include <drivers/i2c/slave/ipmb.h>
23#if defined(CONFIG_I2C_ASPEED)
24#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c0), okay)
28#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay)
32#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay)
36#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay)
40#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c4), okay)
44#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c5), okay)
48#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c6), okay)
52#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c7), okay)
56#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c8), okay)
60#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c9), okay)
64#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c10), okay)
68#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c11), okay)
72#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c12), okay)
76#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c13), okay)
80#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c14), okay)
84#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c15), okay)
88#elif (CONFIG_I2C_NPCM4XX)
89#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1a), okay)
93#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1b), okay)
97#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2a), okay)
101#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3a), okay)
105#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c4a), okay)
109#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c4b), okay)
113#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c5a), okay)
117#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c6a), okay)
121#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c6b), okay)
125#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c7a), okay)
129#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c8a), okay)
133#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c9a), okay)
137#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c10a), okay)
141#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c11a), okay)
145#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c12a), okay)
152#define DEV_I2C(n) DEV_I2C_##n
154#define I2C_BUFF_SIZE 256
155#define MUTEX_LOCK_ENABLE true
156#define MUTEX_LOCK_DISENABLE false
172int i2c_freq_set(uint8_t i2c_bus, uint8_t i2c_speed_mode, uint8_t en_slave);
178void i2c_scan(uint8_t bus, uint8_t *target_addr, uint8_t *target_addr_len);
int i2c_master_write(I2C_MSG *msg, uint8_t retry)
Definition: hal_i2c.c:187
int i2c_master_read(I2C_MSG *msg, uint8_t retry)
Definition: hal_i2c.c:114
int i2c_freq_set(uint8_t i2c_bus, uint8_t i2c_speed_mode, uint8_t en_slave)
Definition: hal_i2c.c:54
I2C_TRANSFER_TYPE
Definition: hal_i2c.h:158
@ I2C_READ
Definition: hal_i2c.h:159
@ I2C_WRITE
Definition: hal_i2c.h:160
void i2c_scan(uint8_t bus, uint8_t *target_addr, uint8_t *target_addr_len)
Definition: hal_i2c.c:344
int i2c_master_read_without_mutex(I2C_MSG *msg, uint8_t retry)
Definition: hal_i2c.c:240
void util_init_I2C(void)
Definition: hal_i2c.c:378
int check_i2c_bus_valid(uint8_t bus)
Definition: hal_i2c.c:482
int i2c_addr_set(uint8_t i2c_bus, uint8_t i2c_addr)
Definition: hal_i2c.c:84
int i2c_master_write_without_mutex(I2C_MSG *msg, uint8_t retry)
Definition: hal_i2c.c:302
#define I2C_BUFF_SIZE
Definition: hal_i2c.h:154
Definition: hal_i2c.h:163
struct k_mutex lock
Definition: hal_i2c.h:169
uint8_t tx_len
Definition: hal_i2c.h:167
uint8_t data[I2C_BUFF_SIZE]
Definition: hal_i2c.h:168
uint8_t rx_len
Definition: hal_i2c.h:166
uint8_t target_addr
Definition: hal_i2c.h:165
uint8_t bus
Definition: hal_i2c.h:164