|
VSF Documented
|
#include "hal/driver/driver.h"Macros | |
| #define | VSF_I2C_CFG_FUNCTION_RENAME DISABLED |
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) |
| Finalize a I2C instance. | |
| vsf_err_t | vsf_i2c_get_configuration (vsf_i2c_t *i2c_ptr, vsf_i2c_cfg_t *cfg_ptr) |
| Get current configuration of a I2C instance. | |
| fsm_rt_t | vsf_i2c_enable (vsf_i2c_t *i2c_ptr) |
| Enable a I2C instance. | |
| fsm_rt_t | vsf_i2c_disable (vsf_i2c_t *i2c_ptr) |
| Disable a I2C instance. | |
| void | vsf_i2c_irq_enable (vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
| I2C instance enables interrupts. | |
| void | vsf_i2c_irq_disable (vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
| I2C instance disables interrupts. | |
| vsf_i2c_irq_mask_t | vsf_i2c_irq_clear (vsf_i2c_t *i2c_ptr, vsf_i2c_irq_mask_t irq_mask) |
| Clear interrupt flags of I2C instance and return previous state. | |
| 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 capabilities of I2C instance. | |
| fsm_rt_t | vsf_i2c_master_fifo_transfer (vsf_i2c_t *i2c_ptr, uint16_t address, vsf_i2c_cmd_t cmd, uint_fast16_t count, uint8_t *buffer_ptr, vsf_i2c_cmd_t *cur_cmd_ptr, uint_fast16_t *offset_ptr) |
| I2C instance as master mode performs a FIFO transfer. | |
| uint_fast16_t | vsf_i2c_slave_fifo_transfer (vsf_i2c_t *i2c_ptr, bool transmit_or_receive, uint_fast16_t count, uint8_t *buffer_ptr) |
| I2C instance as slave mode performs a FIFO transfer. | |
| vsf_err_t | vsf_i2c_master_request (vsf_i2c_t *i2c_ptr, uint16_t address, vsf_i2c_cmd_t cmd, uint_fast16_t count, uint8_t *buffer_ptr) |
| I2C instance as master mode requests a transfer. | |
| vsf_err_t | vsf_i2c_slave_request (vsf_i2c_t *i2c_ptr, bool transmit_or_receive, uint_fast16_t count, uint8_t *buffer_ptr) |
| I2C instance as slave mode requests a transfer. | |
| uint_fast32_t | vsf_i2c_master_get_transferred_count (vsf_i2c_t *i2c_ptr) |
| get the counter of transfers for current request by the I2C master | |
| uint_fast32_t | vsf_i2c_slave_get_transferred_count (vsf_i2c_t *i2c_ptr) |
| get the counter of transfers for current request by the I2C slave | |
| vsf_err_t | vsf_i2c_ctrl (vsf_i2c_t *i2c_ptr, vsf_i2c_ctrl_t ctrl, void *param) |
| Calls the specified I2C command. | |
| #define VSF_I2C_CFG_FUNCTION_RENAME DISABLED |
| vsf_err_t vsf_i2c_init | ( | vsf_i2c_t * | i2c_ptr, |
| vsf_i2c_cfg_t * | cfg_ptr | ||
| ) |
Initialize a I2C instance.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | cfg_ptr | a pointer to configuration structure vsf_i2c_cfg_t |
| void vsf_i2c_fini | ( | vsf_i2c_t * | i2c_ptr | ) |
| vsf_err_t vsf_i2c_get_configuration | ( | vsf_i2c_t * | i2c_ptr, |
| vsf_i2c_cfg_t * | cfg_ptr | ||
| ) |
Get current configuration of a I2C instance.
| [in] | i2c_ptr | Pointer to I2C instance |
| [out] | cfg_ptr | Pointer to I2C configuration structure to store current settings |
Enable a I2C instance.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
Disable a I2C instance.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| void vsf_i2c_irq_enable | ( | vsf_i2c_t * | i2c_ptr, |
| vsf_i2c_irq_mask_t | irq_mask | ||
| ) |
I2C instance enables interrupts.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | irq_mask | one or more values of enum vsf_i2c_irq_mask_t |
| void vsf_i2c_irq_disable | ( | vsf_i2c_t * | i2c_ptr, |
| vsf_i2c_irq_mask_t | irq_mask | ||
| ) |
I2C instance disables interrupts.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | irq_mask | one or more values of enum vsf_i2c_irq_mask_t |
| vsf_i2c_irq_mask_t vsf_i2c_irq_clear | ( | vsf_i2c_t * | i2c_ptr, |
| vsf_i2c_irq_mask_t | irq_mask | ||
| ) |
Clear interrupt flags of I2C instance and return previous state.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | irq_mask | one or more values of enum vsf_i2c_irq_mask_t to clear |
| vsf_i2c_status_t vsf_i2c_status | ( | vsf_i2c_t * | i2c_ptr | ) |
Get the status of I2C instance.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| vsf_i2c_capability_t vsf_i2c_capability | ( | vsf_i2c_t * | i2c_ptr | ) |
Get the capabilities of I2C instance.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| fsm_rt_t vsf_i2c_master_fifo_transfer | ( | vsf_i2c_t * | i2c_ptr, |
| uint16_t | address, | ||
| vsf_i2c_cmd_t | cmd, | ||
| uint_fast16_t | count, | ||
| uint8_t * | buffer_ptr, | ||
| vsf_i2c_cmd_t * | cur_cmd_ptr, | ||
| uint_fast16_t * | offset_ptr | ||
| ) |
I2C instance as master mode performs a FIFO transfer.
| [in,out] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | address | address of I2C transfer |
| [in] | cmd | I2C command |
| [in] | count | number of data to transfer |
| [in,out] | buffer_ptr | I2C transfer buffer (must not be NULL when count is non-zero) |
| [in,out] | cur_cmd_ptr | current I2C command pointer (must be cleared before first call) |
| [in,out] | offset_ptr | current offset pointer (must be cleared before first call) |
| uint_fast16_t vsf_i2c_slave_fifo_transfer | ( | vsf_i2c_t * | i2c_ptr, |
| bool | transmit_or_receive, | ||
| uint_fast16_t | count, | ||
| uint8_t * | buffer_ptr | ||
| ) |
I2C instance as slave mode performs a FIFO transfer.
| [in,out] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | transmit_or_receive | true for transmit, false for receive |
| [in] | count | number of data to transfer |
| [in,out] | buffer_ptr | I2C transfer buffer |
| [in,out] | offset_ptr | current offset pointer |
| vsf_err_t vsf_i2c_master_request | ( | vsf_i2c_t * | i2c_ptr, |
| uint16_t | address, | ||
| vsf_i2c_cmd_t | cmd, | ||
| uint_fast16_t | count, | ||
| uint8_t * | buffer_ptr | ||
| ) |
I2C instance as master mode requests a transfer.
| [in,out] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | address | address of I2C transfer |
| [in] | cmd | I2C command |
| [in] | count | number of data to transfer |
| [in,out] | buffer_ptr | I2C transfer buffer |
| vsf_err_t vsf_i2c_slave_request | ( | vsf_i2c_t * | i2c_ptr, |
| bool | transmit_or_receive, | ||
| uint_fast16_t | count, | ||
| uint8_t * | buffer_ptr | ||
| ) |
I2C instance as slave mode requests a transfer.
| [in,out] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | transmit_or_receive | true for transmit, false for receive |
| [in] | count | number of data to transfer |
| [in,out] | buffer_ptr | I2C transfer buffer |
| uint_fast32_t vsf_i2c_master_get_transferred_count | ( | vsf_i2c_t * | i2c_ptr | ) |
get the counter of transfers for current request by the I2C master
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| uint_fast32_t vsf_i2c_slave_get_transferred_count | ( | vsf_i2c_t * | i2c_ptr | ) |
get the counter of transfers for current request by the I2C slave
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| vsf_err_t vsf_i2c_ctrl | ( | vsf_i2c_t * | i2c_ptr, |
| vsf_i2c_ctrl_t | ctrl, | ||
| void * | param | ||
| ) |
Calls the specified I2C command.
| [in] | i2c_ptr | a pointer to structure vsf_i2c_t |
| [in] | ctrl | I2C control command vsf_i2c_ctrl_t |
| [in,out] | param | the parameter of the command, its use is determined by the command |