I2C_Drivers (ARM) 1.1
SMFSW collection of HAL I2C Drivers for ARM
Loading...
Searching...
No Matches
I2CMEM.c File Reference

FRAM / EEPROM Driver. More...

#include "I2CMEM.h"
Include dependency graph for I2CMEM.c:

Functions

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.
 

Variables

I2CMEM_t I2CMEM [I2C_I2CMEM_NB] = { 0 }
 I2CMEM User structure.
 

Detailed Description

FRAM / EEPROM Driver.

Author
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

Function Documentation

◆ 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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
Here is the call graph for this function:

◆ 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
Here is the caller graph for this function:

Variable Documentation

◆ I2CMEM

I2CMEM_t I2CMEM[I2C_I2CMEM_NB] = { 0 }

I2CMEM User structure.