VSF Documented
Data Structures | Macros | Typedefs | Functions
i2c.c File Reference
#include "../driver.h"
#include "hal/vsf_hal.h"
#include "../vendor/plf/aic8800/src/driver/sysctrl/reg_sysctrl.h"
#include "../vendor/plf/aic8800/src/driver/sysctrl/sysctrl_api.h"
#include "../vendor/plf/aic8800/src/driver/i2cm/reg_i2cm.h"
#include "hal/driver/common/i2c/i2c_template.inc"

Data Structures

struct  vsf_hw_i2c_const_t
 
struct  vsf_hw_i2c_t
 

Macros

#define VSF_HW_I2C_CFG_MULTI_CLASS   VSF_I2C_CFG_MULTI_CLASS
 
#define VSF_HW_I2C_REQEUST_BUFFER_SIZE   3
 
#define VSF_I2C_CFG_CAPABILITY_MAX_TRANSFER_SIZE   16
 
#define VSF_I2C_CFG_REIMPLEMENT_API_CAPABILITY   ENABLED
 
#define VSF_I2C_CFG_IMP_PREFIX   vsf_hw
 
#define VSF_I2C_CFG_IMP_UPCASE_PREFIX   VSF_HW
 
#define VSF_I2C_CFG_IMP_LV0(__IDX, __HAL_OP)
 

Typedefs

typedef struct vsf_hw_i2c_const_t vsf_hw_i2c_const_t
 
typedef struct vsf_hw_i2c_t vsf_hw_i2c_t
 

Functions

vsf_err_t vsf_hw_i2c_init (vsf_hw_i2c_t *hw_i2c_ptr, vsf_i2c_cfg_t *cfg_ptr)
 
void vsf_hw_i2c_fini (vsf_hw_i2c_t *hw_i2c_ptr)
 
fsm_rt_t vsf_hw_i2c_enable (vsf_hw_i2c_t *hw_i2c_ptr)
 
fsm_rt_t vsf_hw_i2c_disable (vsf_hw_i2c_t *hw_i2c_ptr)
 
void vsf_hw_i2c_irq_enable (vsf_hw_i2c_t *hw_i2c_ptr, vsf_i2c_irq_mask_t irq_mask)
 
void vsf_hw_i2c_irq_disable (vsf_hw_i2c_t *hw_i2c_ptr, vsf_i2c_irq_mask_t irq_mask)
 
vsf_i2c_status_t vsf_hw_i2c_status (vsf_hw_i2c_t *hw_i2c_ptr)
 
vsf_err_t vsf_hw_i2c_master_request (vsf_hw_i2c_t *hw_i2c_ptr, uint16_t address, vsf_i2c_cmd_t cmd, uint16_t count, uint8_t *buffer)
 
uint_fast32_t vsf_hw_i2c_get_transferred_count (vsf_hw_i2c_t *hw_i2c_ptr)
 
vsf_i2c_capability_t vsf_hw_i2c_capability (vsf_hw_i2c_t *i2c_ptr)
 

Macro Definition Documentation

◆ VSF_HW_I2C_CFG_MULTI_CLASS

#define VSF_HW_I2C_CFG_MULTI_CLASS   VSF_I2C_CFG_MULTI_CLASS

◆ VSF_HW_I2C_REQEUST_BUFFER_SIZE

#define VSF_HW_I2C_REQEUST_BUFFER_SIZE   3

◆ VSF_I2C_CFG_CAPABILITY_MAX_TRANSFER_SIZE

#define VSF_I2C_CFG_CAPABILITY_MAX_TRANSFER_SIZE   16

◆ VSF_I2C_CFG_REIMPLEMENT_API_CAPABILITY

#define VSF_I2C_CFG_REIMPLEMENT_API_CAPABILITY   ENABLED

◆ VSF_I2C_CFG_IMP_PREFIX

#define VSF_I2C_CFG_IMP_PREFIX   vsf_hw

◆ VSF_I2C_CFG_IMP_UPCASE_PREFIX

#define VSF_I2C_CFG_IMP_UPCASE_PREFIX   VSF_HW

◆ VSF_I2C_CFG_IMP_LV0

#define VSF_I2C_CFG_IMP_LV0 (   __IDX,
  __HAL_OP 
)
Value:
static const vsf_hw_i2c_const_t __vsf_hw_i2c ## __IDX ## _const = { \
.reg = VSF_HW_I2C ## __IDX ## _REG, \
.irqn = VSF_HW_I2C ## __IDX ## _IRQ_IDX, \
.pclk = VSF_HW_I2C ## __IDX ## _PCLKME_EN_BIT, \
}; \
vsf_hw_i2c_t vsf_hw_i2c ## __IDX = { \
.i2c_const = &__vsf_hw_i2c ## __IDX ## _const, \
__HAL_OP \
}; \
void VSF_HW_I2C ## __IDX ## _IRQ(void) \
{ \
__vsf_hw_i2c_irq_handler(&vsf_hw_i2c ## __IDX); \
vsf_hal_irq_leave(ctx); \
}
uint32_t uintptr_t
Definition stdint.h:38
Definition i2c.c:46
AIC_I2CM_TypeDef * reg
Definition i2c.c:47
Definition i2c.c:55
const vsf_hw_i2c_const_t * i2c_const
Definition i2c.c:60
uintptr_t vsf_hal_irq_enter(void)
Definition vsf_hal.c:59

Typedef Documentation

◆ vsf_hw_i2c_const_t

◆ vsf_hw_i2c_t

typedef struct vsf_hw_i2c_t vsf_hw_i2c_t

Function Documentation

◆ vsf_hw_i2c_init()

vsf_err_t vsf_hw_i2c_init ( vsf_hw_i2c_t hw_i2c_ptr,
vsf_i2c_cfg_t cfg_ptr 
)

◆ vsf_hw_i2c_fini()

void vsf_hw_i2c_fini ( vsf_hw_i2c_t hw_i2c_ptr)

◆ vsf_hw_i2c_enable()

fsm_rt_t vsf_hw_i2c_enable ( vsf_hw_i2c_t hw_i2c_ptr)

◆ vsf_hw_i2c_disable()

fsm_rt_t vsf_hw_i2c_disable ( vsf_hw_i2c_t hw_i2c_ptr)

◆ vsf_hw_i2c_irq_enable()

void vsf_hw_i2c_irq_enable ( vsf_hw_i2c_t hw_i2c_ptr,
vsf_i2c_irq_mask_t  irq_mask 
)

◆ vsf_hw_i2c_irq_disable()

void vsf_hw_i2c_irq_disable ( vsf_hw_i2c_t hw_i2c_ptr,
vsf_i2c_irq_mask_t  irq_mask 
)

◆ vsf_hw_i2c_status()

vsf_i2c_status_t vsf_hw_i2c_status ( vsf_hw_i2c_t hw_i2c_ptr)

◆ vsf_hw_i2c_master_request()

vsf_err_t vsf_hw_i2c_master_request ( vsf_hw_i2c_t hw_i2c_ptr,
uint16_t  address,
vsf_i2c_cmd_t  cmd,
uint16_t  count,
uint8_t buffer 
)

◆ vsf_hw_i2c_get_transferred_count()

uint_fast32_t vsf_hw_i2c_get_transferred_count ( vsf_hw_i2c_t hw_i2c_ptr)

◆ vsf_hw_i2c_capability()

vsf_i2c_capability_t vsf_hw_i2c_capability ( vsf_hw_i2c_t i2c_ptr)