NVM config implementation. More...
#include <stddef.h>
#include "nvm.h"
#include "nvm_config.h"
#include <stdint.h>
#include <stdbool.h>
#include "ecode.h"
Go to the source code of this file.
Enumerations | |
enum | NVM_Object_Ids { COLOR_TABLE_ID, COEFFICIENT_TABLE_ID, PRIME_NUMBER_TABLE_ID, BONUS_TABLE_ID, PRIVATE_KEY_TABLE_ID, TRANSFORM_TABLE_ID, SINGLE_VARIABLE_ID, SAFETY_TABLE_ID, BIG_EMPTY_TABLE_ID } |
enum | NVM_Page_Ids { MY_PAGE_1, MY_PAGE_2, MY_PAGE_3, MY_PAGE_4 } |
Functions | |
NVM_Config_t const * | NVM_ConfigGet (void) |
Return a pointer to the config data. | |
Variables | |
uint32_t | colorTable [] |
uint8_t | coefficientTable [] = { 11, 12, 13, 14, 15 } |
uint8_t | primeNumberTable [] |
uint8_t | bonusTable [] = { 39, 38, 37, 36 } |
uint8_t | privateKeyTable [] = { 49, 48, 47, 46 } |
uint8_t | transformTable [] = { 59, 58, 57, 56 } |
int32_t | safetyTable [] = { -71, 72, -73, 74, -75, -76, -77, -78, 79, -70 } |
uint8_t | bigEmptyTable [450] |
uint32_t | singleVariable = 68 |
NVM_Page_t const | myPage1 |
NVM_Page_t const | myPage2 |
NVM_Page_t const | myPage3 |
NVM_Page_t const | myPage4 |
NVM_Page_Table_t const | nvmPages |
static const uint8_t | nvmData [FLASH_PAGE_SIZE *(1+(sizeof(nvmPages)/sizeof(NVM_Page_Descriptor_t)))] = { 0xFF } |
static NVM_Config_t const | nvmConfig |
NVM config implementation.
(C) Copyright 2014 Silicon Labs, http://www.silabs.com
This file is licensensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.
Definition in file nvm_config.c.
uint32_t colorTable[] |
{ 0x000000, 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0x00ffff, 0xff00ff, 0xc0c0c0, 0xffffff }
Definition at line 25 of file nvm_config.c.
NVM_Page_t const myPage1 |
{ { (uint8_t *) colorTable, sizeof(colorTable), COLOR_TABLE_ID }, { (uint8_t *) bonusTable, sizeof(bonusTable), BONUS_TABLE_ID }, { (uint8_t *) &singleVariable, sizeof(singleVariable), SINGLE_VARIABLE_ID }, { (uint8_t *) bigEmptyTable, sizeof(bigEmptyTable), BIG_EMPTY_TABLE_ID }, { NULL, 0, (NVM_Object_Ids) 0 } }
Definition at line 68 of file nvm_config.c.
NVM_Page_t const myPage2 |
{
{ (uint8_t *) safetyTable, sizeof(safetyTable), SAFETY_TABLE_ID },
{ NULL, 0, (NVM_Object_Ids) 0 }
}
Definition at line 82 of file nvm_config.c.
NVM_Page_t const myPage3 |
{ { (uint8_t *) coefficientTable, sizeof(coefficientTable), COEFFICIENT_TABLE_ID }, { (uint8_t *) privateKeyTable, sizeof(privateKeyTable), PRIVATE_KEY_TABLE_ID }, { (uint8_t *) &singleVariable, sizeof(singleVariable), SINGLE_VARIABLE_ID }, { NULL, 0, (NVM_Object_Ids) 0 } }
Definition at line 91 of file nvm_config.c.
NVM_Page_t const myPage4 |
{ { (uint8_t *) primeNumberTable, sizeof(primeNumberTable), PRIME_NUMBER_TABLE_ID }, { (uint8_t *) transformTable, sizeof(transformTable), TRANSFORM_TABLE_ID }, { (uint8_t *) &singleVariable, sizeof(singleVariable), SINGLE_VARIABLE_ID }, { NULL, 0, (NVM_Object_Ids) 0 } }
Definition at line 102 of file nvm_config.c.
NVM_Config_t const nvmConfig [static] |
{ &nvmPages, ( 1 + (sizeof(nvmPages) / sizeof(NVM_Page_Descriptor_t)) ) , (sizeof(nvmPages) / sizeof(NVM_Page_Descriptor_t)) , nvmData }
Definition at line 160 of file nvm_config.c.
NVM_Page_Table_t const nvmPages |
{ { MY_PAGE_1, &myPage1, nvmPageTypeNormal }, { MY_PAGE_2, &myPage2, nvmPageTypeWear }, { MY_PAGE_3, &myPage3, nvmPageTypeNormal }, { MY_PAGE_4, &myPage4, nvmPageTypeNormal } }
Definition at line 113 of file nvm_config.c.
uint8_t primeNumberTable[] |
{ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251 }
Definition at line 28 of file nvm_config.c.