VSF Documented
Data Structures | Macros | Typedefs | Functions
i2c.c File Reference
#include "../driver.h"
#include "hal/vsf_hal.h"
#include "RP2040.h"
#include "hal/driver/common/i2c/i2c_template.inc"

Data Structures

struct  vsf_hw_i2c_t
 

Macros

#define VSF_HW_I2C_CFG_MULTI_CLASS   VSF_I2C_CFG_MULTI_CLASS
 
#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_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 *hw_i2c_ptr)
 

Macro Definition Documentation

◆ VSF_HW_I2C_CFG_MULTI_CLASS

#define VSF_HW_I2C_CFG_MULTI_CLASS   VSF_I2C_CFG_MULTI_CLASS

◆ 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:
vsf_hw_i2c_t vsf_hw_i2c ## __IDX = { \
.reg = (vsf_dw_apb_i2c_reg_t *)VSF_HW_I2C ## __IDX ## _REG, \
.irqn = VSF_HW_I2C ## __IDX ## _IRQN, \
__HAL_OP \
}; \
void VSF_HW_I2C ## __IDX ## _IRQHandler(void) \
{ \
vsf_dw_apb_i2c_irqhandler(&vsf_hw_i2c ## __IDX .use_as__vsf_dw_apb_i2c_t);\
vsf_hal_irq_leave(ctx); \
}
uint32_t uintptr_t
Definition stdint.h:38
Definition vsf_dw_apb_i2c_reg.h:62
Definition i2c.c:55
uintptr_t vsf_hal_irq_enter(void)
Definition vsf_hal.c:59

Typedef Documentation

◆ 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 hw_i2c_ptr)