OpenBIC
OpenSource Bridge-IC
hal_i2c.c File Reference
#include <zephyr.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "cmsis_os2.h"
#include "hal_i2c.h"
#include "timer.h"
#include "plat_i2c.h"
#include "libutil.h"
#include <logging/log.h>
Include dependency graph for hal_i2c.c:

Functions

 LOG_MODULE_REGISTER (hal_i2c)
 
int i2c_freq_set (uint8_t i2c_bus, uint8_t i2c_speed_mode, uint8_t en_slave)
 
int i2c_addr_set (uint8_t i2c_bus, uint8_t i2c_addr)
 
int i2c_master_read (I2C_MSG *msg, uint8_t retry)
 
int i2c_master_write (I2C_MSG *msg, uint8_t retry)
 
int i2c_master_read_without_mutex (I2C_MSG *msg, uint8_t retry)
 
int i2c_master_write_without_mutex (I2C_MSG *msg, uint8_t retry)
 
void i2c_scan (uint8_t bus, uint8_t *target_addr, uint8_t *target_addr_len)
 
void util_init_I2C (void)
 
int check_i2c_bus_valid (uint8_t bus)
 

Variables

struct k_mutex i2c_mutex [I2C_BUS_MAX_NUM]
 

Function Documentation

◆ check_i2c_bus_valid()

int check_i2c_bus_valid ( uint8_t  bus)

◆ i2c_addr_set()

int i2c_addr_set ( uint8_t  i2c_bus,
uint8_t  i2c_addr 
)
Here is the call graph for this function:

◆ i2c_freq_set()

int i2c_freq_set ( uint8_t  i2c_bus,
uint8_t  i2c_speed_mode,
uint8_t  en_slave 
)
Here is the call graph for this function:

◆ i2c_master_read()

int i2c_master_read ( I2C_MSG msg,
uint8_t  retry 
)
Here is the call graph for this function:

◆ i2c_master_read_without_mutex()

int i2c_master_read_without_mutex ( I2C_MSG msg,
uint8_t  retry 
)
Here is the call graph for this function:

◆ i2c_master_write()

int i2c_master_write ( I2C_MSG msg,
uint8_t  retry 
)
Here is the call graph for this function:

◆ i2c_master_write_without_mutex()

int i2c_master_write_without_mutex ( I2C_MSG msg,
uint8_t  retry 
)
Here is the call graph for this function:

◆ i2c_scan()

void i2c_scan ( uint8_t  bus,
uint8_t *  target_addr,
uint8_t *  target_addr_len 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( hal_i2c  )

◆ util_init_I2C()

void util_init_I2C ( void  )

Variable Documentation

◆ i2c_mutex

struct k_mutex i2c_mutex[I2C_BUS_MAX_NUM]