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

FRAM / EEPROM Driver. More...

#include "sarmfsw.h"
#include "I2C_component.h"
#include "I2C_peripheral.h"
#include "I2CMEM_ex.h"
Include dependency graph for I2CMEM.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  I2CMEM_t
 I2CMEM user interface struct. More...
 

Macros

#define I2C_I2CMEM_NB   1U
 Number of I2CMEM peripherals.
 
#define I2CMEM_BASE_ADDR   0x50U
 I2CMEM Base address.
 
#define I2CMEM_BANK_SIZE   0x100U
 I2CMEM bank size (in bytes) for <=16Kb devices.
 

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]
 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

Macro Definition Documentation

◆ I2C_I2CMEM_NB

#define I2C_I2CMEM_NB   1U

Number of I2CMEM peripherals.

Note
Define I2C_I2CMEM_NB to enable multiple peripherals of this type

◆ I2CMEM_BANK_SIZE

#define I2CMEM_BANK_SIZE   0x100U

I2CMEM bank size (in bytes) for <=16Kb devices.

◆ I2CMEM_BASE_ADDR

#define I2CMEM_BASE_ADDR   0x50U

I2CMEM Base address.

Note
Define I2CMEM_BASE_ADDR to change default device base address

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]
extern

I2CMEM User structure.