OpenBIC
OpenSource Bridge-IC
hal_i2c_target.c File Reference
#include <zephyr.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <drivers/i2c.h>
#include "hal_i2c_target.h"
#include "libutil.h"
#include "plat_def.h"
#include <logging/log.h>
Include dependency graph for hal_i2c_target.c:

Macros

#define LOG_LEVEL   CONFIG_I2C_LOG_LEVEL
 

Functions

 LOG_MODULE_REGISTER (hal_i2c_target)
 
uint8_t i2c_target_status_get (uint8_t bus_num)
 
uint8_t i2c_target_cfg_get (uint8_t bus_num, struct _i2c_target_config *cfg)
 
uint8_t i2c_target_status_print (uint8_t bus_num)
 
uint8_t i2c_target_read (uint8_t bus_num, uint8_t *buff, uint16_t buff_len, uint16_t *msg_len)
 
uint8_t i2c_target_write (uint8_t bus_num, uint8_t *buff, uint16_t buff_len)
 
int i2c_target_control (uint8_t bus_num, struct _i2c_target_config *cfg, enum i2c_target_api_control_mode mode)
 

Variables

struct k_mutex i2c_target_mutex [MAX_TARGET_NUM]
 

Macro Definition Documentation

◆ LOG_LEVEL

#define LOG_LEVEL   CONFIG_I2C_LOG_LEVEL

Function Documentation

◆ i2c_target_cfg_get()

uint8_t i2c_target_cfg_get ( uint8_t  bus_num,
struct _i2c_target_config cfg 
)
Here is the call graph for this function:

◆ i2c_target_control()

int i2c_target_control ( uint8_t  bus_num,
struct _i2c_target_config cfg,
enum i2c_target_api_control_mode  mode 
)
Here is the call graph for this function:

◆ i2c_target_read()

uint8_t i2c_target_read ( uint8_t  bus_num,
uint8_t *  buff,
uint16_t  buff_len,
uint16_t *  msg_len 
)
Here is the call graph for this function:

◆ i2c_target_status_get()

uint8_t i2c_target_status_get ( uint8_t  bus_num)

◆ i2c_target_status_print()

uint8_t i2c_target_status_print ( uint8_t  bus_num)
Here is the call graph for this function:

◆ i2c_target_write()

uint8_t i2c_target_write ( uint8_t  bus_num,
uint8_t *  buff,
uint16_t  buff_len 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( hal_i2c_target  )

Variable Documentation

◆ i2c_target_mutex

struct k_mutex i2c_target_mutex[MAX_TARGET_NUM]