Atmel Software Framework

example3_xmega.c File Reference

NVM example for AVR XMEGA.

Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.

#include <board.h>
#include <compiler.h>
#include <gpio.h>
#include <sysclk.h>
#include <nvm.h>
#include <status_codes.h>
#include <conf_example.h>

Macros

#define FLASH_ERASED   0xffff
 

Functions

static void fill_flash_page_buffer (uint16_t *buffer, uint16_t seed)
 Fill page buffer with a sequence of numbers. More...
 
static bool is_flash_page_equal_to_buffer (flash_addr_t page_addr, uint16_t *buffer)
 Check if an flash page is equal to a flash page buffer in SRAM. More...
 
int main (void)
 
static void set_buffer (uint16_t *buffer, uint16_t value)
 Set all values of a flash page buffer in SRAM to a given value. More...
 
static status_code_t test_atomic_write_app_table (void)
 Test nvm_flash_load_word_to_buffer() and nvm_flash_atomic_write_app_page(). More...
 
static status_code_t test_atomic_write_boot (void)
 Test nvm_flash_load_word_to_buffer() and nvm_flash_atomic_write_boot_page(). More...
 
static status_code_t test_split_write_app_table (void)
 Test nvm_flash_load_word_to_buffer(), nvm_flash_erase_app_page() and nvm_flash_split_write_app_page(). More...
 
static status_code_t test_split_write_boot (void)
 Test nvm_flash_load_word_to_buffer(), nvm_flash_erase_boot_page() and nvm_flash_split_write_boot_page(). More...
 

Variables

uint16_t buffer [FLASH_PAGE_SIZE/2]
 Memory buffer to use during testing. More...