eeprom8 2.0.0.0
|
EEPROM8 Click example. More...
Macros | |
#define | TEST_NBYTES ( 150 ) |
#define | TEST_MEM_LOCATION ( EEPROM8_BLOCK_ADDR_START + 1024ul ) |
Functions | |
err_t | run_first_pass (eeprom8_t *ctx, uint8_t *write_buf, uint8_t *read_buf) |
First pass function. | |
err_t | run_second_pass (eeprom8_t *ctx, uint8_t *write_buf, uint8_t *read_buf) |
Second pass function. | |
void | application_init (void) |
void | application_task (void) |
int | main (void) |
EEPROM8 Click example.
This example demonstrates the use of EEPROM 8 click board by writing specified data to the memory and reading it back.
The demo application is composed of two sections :
Initializes the driver and USB UART logging.
Task writes a desired number of data bytes to the EEPROM 8 memory and verifies that it is written correctly by reading from the same memory location and in case of successful read, displays the memory content on the USB UART. This is done in two passes.
#define TEST_MEM_LOCATION ( EEPROM8_BLOCK_ADDR_START + 1024ul ) |
#define TEST_NBYTES ( 150 ) |
void application_init | ( | void | ) |
< Click config object.
< Logger config object.
Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG
void application_task | ( | void | ) |
int main | ( | void | ) |
err_t run_first_pass | ( | eeprom8_t * | ctx, |
uint8_t * | write_buf, | ||
uint8_t * | read_buf ) |
First pass function.
This function writes and reads defined number of bytes with zero values
[in] | ctx | Click object. |
[in] | write_buf | Data to be written. |
[out] | read_buf | Data to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t run_second_pass | ( | eeprom8_t * | ctx, |
uint8_t * | write_buf, | ||
uint8_t * | read_buf ) |
Second pass function.
This function writes and reads defined number of bytes with the values following arithmetical progression
[in] | ctx | Click object. |
[in] | write_buf | Data to be written. |
[out] | read_buf | Data to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.