|
I2C_Drivers (ARM) 1.1
SMFSW collection of HAL I2C Drivers for ARM
|
Base I2C component. More...
#include <string.h>#include "sarmfsw.h"#include "globals.h"
Data Structures | |
| struct | I2C_slave_t |
| i2c slave config and control parameters More... | |
Macros | |
| #define | I2C_ADDR_General_Call 0 |
| I2C general call address. | |
| #define | I2C_slave_timeout 50U |
| Default timeout for transaction on I2C. | |
| #define | I2C_eep_slave_timeout 500U |
| Default timeout for eeprom type components transaction on I2C. | |
| #define | I2C_ADDR(a) |
| Macro to shift a 1 bit left to define 7b I2C address. | |
| #define | IS_I2C_7B_ADDR(ADDR) |
| Macro for use with assert_param to check I2C ADDR for slave. | |
Enumerations | |
| enum | I2C_speed { I2C_STD = 100U , I2C_FM = 400U , I2C_FMP = 1000U , I2C_HS = 3400U } |
| I2C bus speed. More... | |
| enum | I2C_reg_size { I2C_NO_REG = 0U , I2C_8B_REG = I2C_MEMADD_SIZE_8BIT , I2C_16B_REG = I2C_MEMADD_SIZE_16BIT } |
| I2C slave internal address registers size. More... | |
Functions | |
| void | I2C_slave_init (I2C_slave_t *const slave, I2C_HandleTypeDef *const hi2c, const uint16_t devAddress, const uint32_t timeout) |
| I2C Slave device initialization. | |
| void | I2C_set_slave_instance (I2C_slave_t *const slave, I2C_HandleTypeDef *const hi2c) |
| I2C Slave device HAL instance change. | |
| void | I2C_set_slave_address (I2C_slave_t *const slave, const uint16_t devAddress) |
| I2C Slave device address change. | |
| void | I2C_set_slave_timeout (I2C_slave_t *const slave, const uint32_t timeout) |
| I2C Slave device transaction timeout change. | |
| void | I2C_set_current_mem_address (I2C_slave_t *const slave, const uint16_t addr) |
| Set I2C Slave device current internal memory address. | |
| void | I2C_set_enable (I2C_slave_t *const slave, const bool en) |
| Set I2C Slave device disabled/enabled state. | |
| void | I2C_set_busy (I2C_slave_t *const slave, const bool busy) |
| Set I2C Slave bus/device business. | |
| uint32_t | I2C_get_current_mem_address (const I2C_slave_t *const slave) |
| Get I2C Slave device current internal memory address. | |
| bool | I2C_is_enabled (const I2C_slave_t *const slave) |
| Get I2C Slave device enabled state. | |
| bool | I2C_is_busy (const I2C_slave_t *const slave) |
| Get I2C Slave device busy state. | |
| I2C_HandleTypeDef * | I2C_get_slave_instance (const I2C_slave_t *const slave) |
| Get I2C Slave device HAL I2C instance. | |
| uint16_t | I2C_get_slave_address (const I2C_slave_t *const slave) |
| Get I2C Slave device address. | |
| uint32_t | I2C_get_slave_timeout (const I2C_slave_t *const slave) |
| Get I2C Slave device transaction timeout. | |
| uint16_t | I2C_get_slave_mem_size (const I2C_slave_t *const slave) |
| Get I2C Slave device internal memory size. | |
| uint16_t | I2C_get_slave_max_speed (const I2C_slave_t *const slave) |
| Get I2C Slave device max speed. | |
| void | I2C_Watchdog_Refresh (void) |
| I2C Watchdog refresh callback. | |
Base I2C component.
| #define I2C_ADDR | ( | a | ) |
Macro to shift a 1 bit left to define 7b I2C address.
| #define I2C_ADDR_General_Call 0 |
I2C general call address.
| #define I2C_eep_slave_timeout 500U |
Default timeout for eeprom type components transaction on I2C.
| #define I2C_slave_timeout 50U |
Default timeout for transaction on I2C.
| #define IS_I2C_7B_ADDR | ( | ADDR | ) |
Macro for use with assert_param to check I2C ADDR for slave.
| enum I2C_reg_size |
| enum I2C_speed |
|
inline |
Get I2C Slave device current internal memory address.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device address.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device HAL I2C instance.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device max speed.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device internal memory size.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device transaction timeout.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device busy state.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Get I2C Slave device enabled state.
| [in,out] | slave | - pointer to I2C slave instance |
|
inline |
Set I2C Slave bus/device business.
| [in,out] | slave | - pointer to I2C slave instance |
| [in] | busy | - I2C bus/device state |
|
inline |
Set I2C Slave device current internal memory address.
| [in,out] | slave | - pointer to I2C slave instance |
| [in] | addr | - address to store in slave instance |
|
inline |
Set I2C Slave device disabled/enabled state.
| [in,out] | slave | - pointer to I2C slave instance |
| [in] | en | - I2C device state (disabled/enabled) |
| void I2C_set_slave_address | ( | I2C_slave_t *const | slave, |
| const uint16_t | devAddress ) |
I2C Slave device address change.
| [in,out] | slave | - pointer to I2C slave instance |
| [in] | devAddress | - Device Address |
| void I2C_set_slave_instance | ( | I2C_slave_t *const | slave, |
| I2C_HandleTypeDef *const | hi2c ) |
I2C Slave device HAL instance change.
| [in,out] | slave | - pointer to I2C slave instance |
| [in] | hi2c | - pointer to HAL I2C instance |
|
inline |
I2C Slave device transaction timeout change.
| [in,out] | slave | - pointer to I2C slave instance |
| [in] | timeout | - Transaction timeout |
| void I2C_slave_init | ( | I2C_slave_t *const | slave, |
| I2C_HandleTypeDef *const | hi2c, | ||
| const uint16_t | devAddress, | ||
| const uint32_t | timeout ) |
I2C Slave device initialization.
| [in,out] | slave | - pointer to I2C slave instance to initialize |
| [in] | hi2c | - pointer to HAL I2C instance |
| [in] | devAddress | - Device Address |
| [in] | timeout | - Transaction timeout |
| void I2C_Watchdog_Refresh | ( | void | ) |
I2C Watchdog refresh callback.
