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

FRAM / EEPROM Driver extensions. More...

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

Macros

#define I2CMEM_Read_Type(cpnt, name, type, addr)
 Macro to create function to read value(s) from I2CMEM.
 
#define I2CMEM_Write_Type(cpnt, name, type, addr)
 Macro to create function to write value(s) to I2CMEM.
 
#define I2CMEM_1K   0x0080U
 1Kb size
 
#define I2CMEM_2K   0x0100U
 2Kb size
 
#define I2CMEM_4K   0x0200U
 4Kb size
 
#define I2CMEM_8K   0x0400U
 8Kb size
 
#define I2CMEM_16K   0x0800U
 16Kb size
 
#define I2CMEM_32K   0x1000U
 32Kb size
 
#define I2CMEM_64K   0x2000U
 64Kb size
 
#define I2CMEM_128K   0x4000U
 128Kb size
 
#define I2CMEM_256K   0x8000U
 256Kb size
 
#define I2CMEM_WBUF_NONE   0
 No buffer.
 
#define I2CMEM_WBUF_8   8U
 8B buffer
 
#define I2CMEM_WBUF_16   16U
 16B buffer
 
#define I2CMEM_WBUF_32   32U
 32B buffer
 
#define I2CMEM_WBUF_64   64U
 64B buffer
 
#define _24xx32_Init(idx, hi2c, devAddress)
 EEPROM 24xx32 Init alias.
 
#define _24xx32_Init_Single()
 EEPROM 24xx32 Single Init alias.
 
#define _24xx64_Init(idx, hi2c, devAddress)
 EEPROM 24xx64 Init alias.
 
#define _24xx64_Init_Single()
 EEPROM 24xx64 Single Init alias.
 
#define _24xx128_Init(idx, hi2c, devAddress)
 EEPROM 24xx128 Init alias.
 
#define _24xx128_Init_Single()
 EEPROM 24xx128 Single Init alias.
 
#define _FM24C04_Init(idx, hi2c, devAddress)
 FRAM FM24C04 Init alias.
 
#define _FM24C04_Init_Single()
 FRAM FM24C04 Single Init alias.
 
#define _FM24C16_Init(idx, hi2c, devAddress)
 FRAM FM24C16 Init alias.
 
#define _FM24C16_Init_Single()
 FRAM FM24C16 Single Init alias.
 
#define _FM24C64_Init(idx, hi2c, devAddress)
 FRAM FM24C64 Init alias.
 
#define _FM24C64_Init_Single()
 FRAM FM24C64 Single Init alias.
 
#define _M24C16_Init(idx, hi2c, devAddress)
 EEPROM M24C16 Init alias.
 
#define _M24C16_Init_Single()
 EEPROM M24C16 Single Init alias.
 
#define _MB85RC256_Init(idx, hi2c, devAddress)
 FRAM MB85RC256 Init alias.
 
#define _MB85C256_Init_Single()
 FRAM MB85RC256 Single Init alias.
 

Functions

FctERR I2CMEM_Mass_Erase (I2CMEM_t *const pCpnt)
 Mass erase of I2CMEM.
 
void I2CMEM_WP_GPIO_Init (I2CMEM_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Write Protect GPIO pin init for I2CMEM.
 
void I2CMEM_WP_GPIO_Set (I2CMEM_t *const pCpnt, const bool state)
 Write Protect GPIO pin setter for I2CMEM.
 

Detailed Description

FRAM / EEPROM Driver extensions.

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

◆ _24xx128_Init

#define _24xx128_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_128K, I2CMEM_WBUF_64)
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.
Definition I2CMEM.c:26
#define I2CMEM_128K
128Kb size
Definition I2CMEM_ex.h:41
#define I2CMEM_WBUF_64
64B buffer
Definition I2CMEM_ex.h:48

EEPROM 24xx128 Init alias.

◆ _24xx128_Init_Single

#define _24xx128_Init_Single ( )
Value:
FctERR I2CMEM_Init_Single(const size_t size, const size_t buf_size)
Initialization for I2CMEM peripheral.
Definition I2CMEM.c:42

EEPROM 24xx128 Single Init alias.

◆ _24xx32_Init

#define _24xx32_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_32K, I2CMEM_WBUF_32)
#define I2CMEM_32K
32Kb size
Definition I2CMEM_ex.h:39
#define I2CMEM_WBUF_32
32B buffer
Definition I2CMEM_ex.h:47

EEPROM 24xx32 Init alias.

◆ _24xx32_Init_Single

#define _24xx32_Init_Single ( )
Value:

EEPROM 24xx32 Single Init alias.

◆ _24xx64_Init

#define _24xx64_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_64K, I2CMEM_WBUF_32)
#define I2CMEM_64K
64Kb size
Definition I2CMEM_ex.h:40

EEPROM 24xx64 Init alias.

◆ _24xx64_Init_Single

#define _24xx64_Init_Single ( )
Value:

EEPROM 24xx64 Single Init alias.

◆ _FM24C04_Init

#define _FM24C04_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_4K, I2CMEM_WBUF_NONE)
#define I2CMEM_WBUF_NONE
No buffer.
Definition I2CMEM_ex.h:44
#define I2CMEM_4K
4Kb size
Definition I2CMEM_ex.h:36

FRAM FM24C04 Init alias.

◆ _FM24C04_Init_Single

#define _FM24C04_Init_Single ( )
Value:

FRAM FM24C04 Single Init alias.

◆ _FM24C16_Init

#define _FM24C16_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_16K, I2CMEM_WBUF_NONE)
#define I2CMEM_16K
16Kb size
Definition I2CMEM_ex.h:38

FRAM FM24C16 Init alias.

◆ _FM24C16_Init_Single

#define _FM24C16_Init_Single ( )
Value:

FRAM FM24C16 Single Init alias.

◆ _FM24C64_Init

#define _FM24C64_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_64K, I2CMEM_WBUF_NONE)

FRAM FM24C64 Init alias.

◆ _FM24C64_Init_Single

#define _FM24C64_Init_Single ( )
Value:

FRAM FM24C64 Single Init alias.

◆ _M24C16_Init

#define _M24C16_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_16K, I2CMEM_WBUF_16)
#define I2CMEM_WBUF_16
16B buffer
Definition I2CMEM_ex.h:46

EEPROM M24C16 Init alias.

◆ _M24C16_Init_Single

#define _M24C16_Init_Single ( )
Value:

EEPROM M24C16 Single Init alias.

◆ _MB85C256_Init_Single

#define _MB85C256_Init_Single ( )
Value:
#define I2CMEM_256K
256Kb size
Definition I2CMEM_ex.h:42

FRAM MB85RC256 Single Init alias.

◆ _MB85RC256_Init

#define _MB85RC256_Init ( idx,
hi2c,
devAddress )
Value:
I2CMEM_Init(idx, hi2c, devAddress, I2CMEM_256K, I2CMEM_WBUF_NONE)

FRAM MB85RC256 Init alias.

◆ I2CMEM_128K

#define I2CMEM_128K   0x4000U

128Kb size

◆ I2CMEM_16K

#define I2CMEM_16K   0x0800U

16Kb size

◆ I2CMEM_1K

#define I2CMEM_1K   0x0080U

1Kb size

◆ I2CMEM_256K

#define I2CMEM_256K   0x8000U

256Kb size

◆ I2CMEM_2K

#define I2CMEM_2K   0x0100U

2Kb size

◆ I2CMEM_32K

#define I2CMEM_32K   0x1000U

32Kb size

◆ I2CMEM_4K

#define I2CMEM_4K   0x0200U

4Kb size

◆ I2CMEM_64K

#define I2CMEM_64K   0x2000U

64Kb size

◆ I2CMEM_8K

#define I2CMEM_8K   0x0400U

8Kb size

◆ I2CMEM_Read_Type

#define I2CMEM_Read_Type ( cpnt,
name,
type,
addr )
Value:
__INLINE FctERR NONNULL_INLINE__ I2CMEM_Get_##name(type * rd) { \
return I2CMEM_Read(cpnt, &rd, addr, sizeof(type)); }
FctERR I2CMEM_Read(I2CMEM_t *const pCpnt, uint8_t *const data, const uint16_t addr, const uint16_t nb)
I2C Read function for I2CMEM.
Definition I2CMEM.c:195

Macro to create function to read value(s) from I2CMEM.

◆ I2CMEM_WBUF_16

#define I2CMEM_WBUF_16   16U

16B buffer

◆ I2CMEM_WBUF_32

#define I2CMEM_WBUF_32   32U

32B buffer

◆ I2CMEM_WBUF_64

#define I2CMEM_WBUF_64   64U

64B buffer

◆ I2CMEM_WBUF_8

#define I2CMEM_WBUF_8   8U

8B buffer

◆ I2CMEM_WBUF_NONE

#define I2CMEM_WBUF_NONE   0

No buffer.

◆ I2CMEM_Write_Type

#define I2CMEM_Write_Type ( cpnt,
name,
type,
addr )
Value:
__INLINE FctERR INLINE__ I2CMEM_Set_##name(type wr) { \
return I2CMEM_Write(cpnt, &wr, addr, sizeof(type)); }
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.
Definition I2CMEM.c:189

Macro to create function to write value(s) to I2CMEM.

Function Documentation

◆ I2CMEM_Mass_Erase()

FctERR I2CMEM_Mass_Erase ( I2CMEM_t *const pCpnt)

Mass erase of I2CMEM.

Parameters
[in]pCpnt- Pointer to I2CMEM component
Returns
FctERR - error code
Here is the call graph for this function:

◆ I2CMEM_WP_GPIO_Init()

void I2CMEM_WP_GPIO_Init ( I2CMEM_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Write Protect GPIO pin init for I2CMEM.

Weak Functions
I2CMEM Write Protect GPIO pin init may be user implemented if needed
Parameters
[in]pCpnt- Pointer to I2CMEM component
[in]GPIOx- WP port
[in]GPIO_Pin- WP pin
[in]GPIO_ActiveWP pin active state
Here is the call graph for this function:

◆ I2CMEM_WP_GPIO_Set()

void I2CMEM_WP_GPIO_Set ( I2CMEM_t *const pCpnt,
const bool state )

Write Protect GPIO pin setter for I2CMEM.

Weak Functions
I2CMEM Write Protect GPIO pin setter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to I2CMEM component
[in]state- state to write on WP pin (0: inactive, 1: active)
Here is the call graph for this function: