Firmware SDK
twr_eeprom

Driver for internal EEPROM memory. More...

Enumerations

enum  twr_eepromc_event_t {
  TWR_EEPROM_EVENT_ASYNC_WRITE_ERROR = 0 ,
  TWR_EEPROM_EVENT_ASYNC_WRITE_DONE = 1
}
 

Functions

bool twr_eeprom_write (uint32_t address, const void *buffer, size_t length)
 Write buffer to EEPROM area and verify it. More...
 
bool twr_eeprom_async_write (uint32_t address, const void *buffer, size_t length, void(*event_handler)(twr_eepromc_event_t, void *), void *event_param)
 Async write buffer to EEPROM area and verify it. More...
 
void twr_eeprom_async_cancel (void)
 Cancel async write.
 
bool twr_eeprom_read (uint32_t address, void *buffer, size_t length)
 Read buffer from EEPROM area. More...
 
size_t twr_eeprom_get_size (void)
 Return size of EEPROM area. More...
 

Detailed Description

Driver for internal EEPROM memory.

Enumeration Type Documentation

◆ twr_eepromc_event_t

Enumerator
TWR_EEPROM_EVENT_ASYNC_WRITE_ERROR 

EEPROM event sync write error.

TWR_EEPROM_EVENT_ASYNC_WRITE_DONE 

EEPROM event sync write done.

Definition at line 10 of file twr_eeprom.h.

Function Documentation

◆ twr_eeprom_async_write()

bool twr_eeprom_async_write ( uint32_t  address,
const void *  buffer,
size_t  length,
void(*)(twr_eepromc_event_t, void *)  event_handler,
void *  event_param 
)

Async write buffer to EEPROM area and verify it.

Parameters
[in]addressEEPROM start address (starts at 0)
[in]bufferPointer to source buffer
[in]lengthNumber of bytes to be written
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)
Returns
true On success start
false On failure start

Definition at line 70 of file twr_eeprom.c.

Here is the call graph for this function:

◆ twr_eeprom_get_size()

size_t twr_eeprom_get_size ( void  )

Return size of EEPROM area.

Returns
Size of EEPROM area in bytes

Definition at line 132 of file twr_eeprom.c.

◆ twr_eeprom_read()

bool twr_eeprom_read ( uint32_t  address,
void *  buffer,
size_t  length 
)

Read buffer from EEPROM area.

Parameters
[in]addressEEPROM start address (starts at 0)
[out]bufferPointer to destination buffer
[in]lengthNumber of bytes to be read
Returns
true On success
false On failure

Definition at line 113 of file twr_eeprom.c.

◆ twr_eeprom_write()

bool twr_eeprom_write ( uint32_t  address,
const void *  buffer,
size_t  length 
)

Write buffer to EEPROM area and verify it.

Parameters
[in]addressEEPROM start address (starts at 0)
[in]bufferPointer to source buffer
[in]lengthNumber of bytes to be written
Returns
true On success
false On failure

Definition at line 31 of file twr_eeprom.c.