Common NVM service example.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
int | main (void) |
NVM Example Main. More... | |
static status_code_t | test_mem (mem_type_t mem, uint32_t test_address) |
Test routine that writes to the non volatile memory, reads back and compares the values. More... | |
int main | ( | void | ) |
NVM Example Main.
The NVM example begins by initializing required board resources. The system clock and basic GPIO pin mapping are established.
A memory location on the Non volatile memory is written with a fixed test pattern which is then read back into a separate buffer. As a basic sanity check, the original write-buffer values are compared with values read to a separate buffer. An LED on the development board is illuminated when there is a match between the written and read data.
References AT45DBX, board_init(), INT_FLASH, ioport_set_pin_level(), NVM_EXAMPLE_LED0, NVM_EXAMPLE_LED1, NVM_EXAMPLE_LED2, STATUS_OK, sysclk_init(), TEST_ADDRESS_EXT, TEST_ADDRESS_INT, and test_mem().
|
static |
Test routine that writes to the non volatile memory, reads back and compares the values.
References ERR_BAD_DATA, ERR_INVALID_ARG, IFLASH_PAGE_SIZE, nvm_init(), nvm_page_erase(), nvm_read(), nvm_write(), and STATUS_OK.
Referenced by main().