VSF Documented
|
#include "./vsf_template_hal_driver.h"
#include "hal/arch/vsf_arch.h"
#include "hal/driver/common/i2c/i2c_request.h"
Go to the source code of this file.
Data Structures | |
struct | vsf_i2c_status_t |
struct | vsf_i2c_capability_t |
struct | vsf_i2c_isr_t |
i2c interrupt configuration More... | |
struct | vsf_i2c_cfg_t |
i2c configuration More... | |
struct | vsf_i2c_op_t |
struct | vsf_i2c_t |
Typedefs | |
typedef enum vsf_i2c_mode_t | vsf_i2c_mode_t |
typedef enum vsf_i2c_cmd_t | vsf_i2c_cmd_t |
typedef enum vsf_i2c_irq_mask_t | vsf_i2c_irq_mask_t |
typedef struct vsf_i2c_status_t | vsf_i2c_status_t |
typedef struct vsf_i2c_capability_t | vsf_i2c_capability_t |
typedef struct vsf_i2c_t | vsf_i2c_t |
typedef void | vsf_i2c_isr_handler_t(void *target_ptr, vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
i2c interrupt callback function prototype. | |
typedef struct vsf_i2c_isr_t | vsf_i2c_isr_t |
i2c interrupt configuration | |
typedef struct vsf_i2c_cfg_t | vsf_i2c_cfg_t |
i2c configuration | |
typedef struct vsf_i2c_op_t | vsf_i2c_op_t |
Functions | |
vsf_err_t | vsf_i2c_init (vsf_i2c_t *i2c_ptr, vsf_i2c_cfg_t *cfg_ptr) |
initialize a i2c instance. | |
void | vsf_i2c_fini (vsf_i2c_t *i2c_ptr) |
termination a i2c instance. | |
fsm_rt_t | vsf_i2c_enable (vsf_i2c_t *i2c_ptr) |
enable i2c instance. | |
fsm_rt_t | vsf_i2c_disable (vsf_i2c_t *i2c_ptr) |
disable i2c instance. | |
void | vsf_i2c_irq_enable (vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
enable interrupt masks of i2c instance. | |
void | vsf_i2c_irq_disable (vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
disable interrupt masks of i2c instance. | |
vsf_i2c_status_t | vsf_i2c_status (vsf_i2c_t *i2c_ptr) |
get the status of i2c instance. | |
vsf_i2c_capability_t | vsf_i2c_capability (vsf_i2c_t *i2c_ptr) |
get the capability of i2c instance. | |
vsf_err_t | vsf_i2c_master_request (vsf_i2c_t *i2c_ptr, uint16_t address, vsf_i2c_cmd_t cmd, uint16_t count, uint8_t *buffer_ptr) |
i2c instance as master mode request a transfer | |
uint_fast32_t | vsf_i2c_get_transferred_count (vsf_i2c_t *i2c_ptr) |
get the counter of transfers for current request by the i2c master | |
#define VSF_I2C_CFG_MULTI_CLASS ENABLED |
#define VSF_I2C_CFG_PREFIX vsf |
#define VSF_I2C_CFG_FUNCTION_RENAME ENABLED |
#define VSF_I2C_CFG_REQUEST_TEMPLATE DISABLED |
#define VSF_I2C_CFG_REIMPLEMENT_TYPE_MODE DISABLED |
#define VSF_I2C_CFG_REIMPLEMENT_TYPE_CMD DISABLED |
#define VSF_I2C_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED |
#define VSF_I2C_CFG_REIMPLEMENT_TYPE_STATUS DISABLED |
#define VSF_I2C_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Redefine struct vsf_i2c_cfg_t. The vsf_i2c_isr_handler_t type also needs to be redefined For compatibility, members should not be deleted when struct vsf_i2c_cfg_t redefining.
#define VSF_I2C_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Redefine struct vsf_i2c_capability_t. For compatibility, members should not be deleted when struct vsf_i2c_capability_t redefining.
#define VSF_I2C_CFG_INHERT_HAL_CAPABILITY ENABLED |
#define VSF_I2C_APIS | ( | __PREFIX_NAME | ) |
#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP |
#define __vsf_i2c_t VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_t) |
#define vsf_i2c_init | ( | __I2C, | |
... | |||
) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_init) ((__vsf_i2c_t *)(__I2C), ##__VA_ARGS__) |
#define vsf_i2c_fini | ( | __I2C | ) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_fini) ((__vsf_i2c_t *)(__I2C)) |
#define vsf_i2c_enable | ( | __I2C | ) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_enable) ((__vsf_i2c_t *)(__I2C)) |
#define vsf_i2c_disable | ( | __I2C | ) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_disable) ((__vsf_i2c_t *)(__I2C)) |
#define vsf_i2c_irq_enable | ( | __I2C, | |
... | |||
) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_irq_enable) ((__vsf_i2c_t *)(__I2C), ##__VA_ARGS__) |
#define vsf_i2c_irq_disable | ( | __I2C, | |
... | |||
) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_irq_disable) ((__vsf_i2c_t *)(__I2C), ##__VA_ARGS__) |
#define vsf_i2c_status | ( | __I2C | ) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_status) ((__vsf_i2c_t *)(__I2C)) |
#define vsf_i2c_capability | ( | __I2C | ) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_capability) ((__vsf_i2c_t *)(__I2C)) |
#define vsf_i2c_master_request | ( | __I2C, | |
... | |||
) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_master_request) ((__vsf_i2c_t *)(__I2C), ##__VA_ARGS__) |
#define vsf_i2c_get_transferred_count | ( | __I2C, | |
... | |||
) | VSF_MCONNECT(VSF_I2C_CFG_PREFIX, _i2c_get_transferred_count) ((__vsf_i2c_t *)(__I2C), ##__VA_ARGS__) |
typedef enum vsf_i2c_mode_t vsf_i2c_mode_t |
typedef enum vsf_i2c_cmd_t vsf_i2c_cmd_t |
typedef enum vsf_i2c_irq_mask_t vsf_i2c_irq_mask_t |
typedef struct vsf_i2c_status_t vsf_i2c_status_t |
typedef struct vsf_i2c_capability_t vsf_i2c_capability_t |
typedef void vsf_i2c_isr_handler_t(void *target_ptr, vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
i2c interrupt callback function prototype.
target_ptr | pointer of user. |
i2c_ptr | pointer of i2c instance. |
irq_mask | one or more value of enum vsf_i2c_irq_mask_t |
typedef struct vsf_i2c_isr_t vsf_i2c_isr_t |
i2c interrupt configuration
typedef struct vsf_i2c_cfg_t vsf_i2c_cfg_t |
i2c configuration
typedef struct vsf_i2c_op_t vsf_i2c_op_t |
enum vsf_i2c_mode_t |
anonymous enum |
enum vsf_i2c_cmd_t |
anonymous enum |
enum vsf_i2c_irq_mask_t |
|
extern |
initialize a i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
[in] | cfg_ptr | a pointer to structure vsf_i2c_cfg_t |
|
extern |
termination a i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
enable i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
disable i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
|
extern |
enable interrupt masks of i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
[in] | irq_mask | one or more value of enum vsf_i2c_irq_mask_t |
|
extern |
disable interrupt masks of i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
[in] | irq_mask | one or more value of enum vsf_i2c_irq_mask_t, vsf_i2c_irq_mask_t |
|
extern |
get the status of i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
|
extern |
get the capability of i2c instance.
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
|
extern |
i2c instance as master mode request a transfer
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |
[in] | address | address of i2c transfer |
[in] | cmd | i2c cmd |
[in] | count | i2c transfer buffer count (in byte) |
[in] | buffer_ptr | i2c transfer buffer |
|
extern |
get the counter of transfers for current request by the i2c master
[in] | i2c_ptr | a pointer to structure vsf_i2c_t |