FRAM / EEPROM Driver.
More...
|
| FctERR | I2CMEM_Init (const uint8_t idx, I2C_HandleTypeDef *const hi2c, const uint16_t devAddress, const size_t size, const size_t buf_size) |
| | Initialization for I2CMEM peripheral.
|
| |
| FctERR | I2CMEM_Init_Single (const size_t size, const size_t buf_size) |
| | Initialization for I2CMEM peripheral.
|
| |
| FctERR | I2CMEM_Write (I2CMEM_t *const pCpnt, const uint8_t *const data, const uint16_t addr, const uint16_t nb) |
| | I2C Write function for I2CMEM.
|
| |
| FctERR | I2CMEM_Read (I2CMEM_t *const pCpnt, uint8_t *const data, const uint16_t addr, const uint16_t nb) |
| | I2C Read function for I2CMEM.
|
| |
FRAM / EEPROM Driver.
- Author
- SMFSW
- Copyright
- MIT (c) 2017-2026, SMFSW
- Note
- Fully compatible between EEPROM / FRAM type components
-
When EEPROM compatibility is not needed, buf_size at init can be set to I2CMEM_WBUF_NONE for more efficiency
◆ I2CMEM_Init()
| FctERR I2CMEM_Init |
( |
const uint8_t | idx, |
|
|
I2C_HandleTypeDef *const | hi2c, |
|
|
const uint16_t | devAddress, |
|
|
const size_t | size, |
|
|
const size_t | buf_size ) |
Initialization for I2CMEM peripheral.
- Parameters
-
| [in] | idx | - I2CMEM index |
| [in] | hi2c | - pointer to I2CMEM I2C instance |
| [in] | devAddress | - I2CMEM device address |
| [in] | size | - I2CMEM device size |
| [in] | buf_size | - I2CMEM device write buffer size (typically I2CMEM_WBUF_NONE for FRAM component) |
- Returns
- FctERR - error code
◆ I2CMEM_Init_Single()
| FctERR I2CMEM_Init_Single |
( |
const size_t | size, |
|
|
const size_t | buf_size ) |
Initialization for I2CMEM peripheral.
- Warning
- In case multiple devices (defined by I2C_I2CMEM_NB > 1), you shall use I2CMEM_Init instead
- Parameters
-
| [in] | size | - I2CMEM device size |
| [in] | buf_size | - I2CMEM device write buffer size (typically I2CMEM_WBUF_NONE for FRAM component) |
- Returns
- FctERR - error code
◆ I2CMEM_Read()
| FctERR I2CMEM_Read |
( |
I2CMEM_t *const | pCpnt, |
|
|
uint8_t *const | data, |
|
|
const uint16_t | addr, |
|
|
const uint16_t | nb ) |
I2C Read function for I2CMEM.
- Parameters
-
| [in] | pCpnt | - Pointer to I2CMEM component |
| [in,out] | data | - pointer to read/write to/from |
| [in] | addr | - Address to read from |
| [in] | nb | - Number of bytes to read |
- Returns
- FctERR - error code
◆ I2CMEM_Write()
| FctERR I2CMEM_Write |
( |
I2CMEM_t *const | pCpnt, |
|
|
const uint8_t *const | data, |
|
|
const uint16_t | addr, |
|
|
const uint16_t | nb ) |
I2C Write function for I2CMEM.
- Parameters
-
| [in] | pCpnt | - Pointer to I2CMEM component |
| [in,out] | data | - pointer to read/write to/from |
| [in] | addr | - Address to read from |
| [in] | nb | - Number of bytes to read |
- Returns
- FctERR - error code
◆ I2CMEM