Infineon Logo AIROC BTSDK v4.1 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
I2C EEPROM Interface

Defines a driver for the I2C EEPROM interface. More...

Functions

void wiced_hal_ieeprom_init (void)
 Status for EEPROM operations. More...
 
void wiced_hal_ieeprom_set_size (uint32_t size)
 Sets the size of the EEPROM module in bytes, used for bounds checking. More...
 
uint8_t wiced_hal_ieeprom_read (uint16_t eepromAddress, uint16_t readCount, uint8_t *buffer, uint8_t deviceAddress)
 Load data from a certain location on the EEPROM module into memory. More...
 
uint8_t wiced_hal_ieeprom_write (uint16_t eepromAddress, uint16_t writeCount, uint8_t *buffer, uint8_t deviceAddress)
 Write data from memory to a certain location on the EEPROM module. More...
 

Detailed Description

Defines a driver for the I2C EEPROM interface.

The driver is responsible for interfacing with an EEPROM module via the I2C bus, with its main purpose being data handling operations. For instance, any unused space (from the system partition) can be used for any purpose to store and access data. It is a handy way for an app to save information to non-volatile storage.

Similar to the Serial Flash Interface Driver, this driver includes checks to ensure safe data handling operation–it will not allow any write operations to take place within active sections (i.e., sections that the system currently uses for boot, etc). Note that read operations are unrestricted. Please reference the Kit Guide or HW User Manual for your device for more information regarding these active sections, their importance, and what roles they play in the system.

Function Documentation

void wiced_hal_ieeprom_init ( void  )

Status for EEPROM operations.

#define DRV_STATUS_SUCCESS 0x00 #define DRV_STATUS_NO_ACK 0x01 #define DRV_STATUS_INVALID_ADDR 0xFF Initialize the I2C lines and low-level EEPROM Driver. Call this before performing any operations.

Parameters
none
Returns
none
uint8_t wiced_hal_ieeprom_read ( uint16_t  eepromAddress,
uint16_t  readCount,
uint8_t *  buffer,
uint8_t  deviceAddress 
)

Load data from a certain location on the EEPROM module into memory.

Parameters
eepromAddress- The starting source address on the EEPROM.
readCount- The number of bytes to read.
buffer- Pointer to destination data buffer.
deviceAddress- The source slave address.
Returns
Success[0] or no ack[1].
void wiced_hal_ieeprom_set_size ( uint32_t  size)

Sets the size of the EEPROM module in bytes, used for bounds checking.

The default is 32768 bytes (256 kBit)

Parameters
size- Size of the installed module in bytes.
Returns
none
uint8_t wiced_hal_ieeprom_write ( uint16_t  eepromAddress,
uint16_t  writeCount,
uint8_t *  buffer,
uint8_t  deviceAddress 
)

Write data from memory to a certain location on the EEPROM module.

(!) Please ensure that the address and (address + length) of data to be written does not go beyond the size of the memory module.

(!) Note that this function will not allow corruption of certain memory locations, such as currently active sections (boot sectors) and sections required for the proper function of the Bluetooth subsystem.

Parameters
eepromAddress- The starting destination address on the EEPROM.
writeCount- The number of bytes to write.
buffer- Pointer to destination data buffer.
deviceAddress- The destination slave address.
Returns
Success[0x00] or no ack[0x01] or invalid eepromAddress/invalid length[0xFF].