NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
eedata.h File Reference

Go to the source code of this file.

Macros

#define MAX_BYTES_PER_SUBINDEX   32
 
#define MAX_EEPROM_MEMORY   0x1800
 (6KB)
 
#define EEPROM_RECORD_SIZE   32
 
#define EEPROM_ERASE_SIZE   0x60
 must be divisible into 6144 (6KB) by factor of 2, defines size of chunks erased from EEPROM
 
#define EEPROM_PAGE_SIZE   3
 XXX: must match the page size in bootloader config.h.
 
#define EEPROM_START_ADDRESS   ((127 - EEPROM_PAGE_SIZE) * FLASH_PAGE_SIZE)
 Loation of the start of the EEPROM in flash.
 
#define MAX_FLASH_MEMORY   FLASH_SIZE
 (256KB)
 
#define FLASH_RECORD_SIZE   32
 

Functions

UNS8 CheckRestoreFlag (void)
 checks whether or not RestoreValues() should be run.
 
void SaveValues (void)
 Saves the values of custom OD entries (specified in RestoreList OD index 0x2900) to EEPROM from the OD. Companion function to RestoreValues(). Note that if the RestoreList is changed, RestoreValues() will not restore values to the correct subindices in the OD unless the EEPROM data has been updated via SaveValues(). I.e., SaveValues() only stores the data bytes contained within the OD subindices in the order specified by RestoreList; the indices and subindices themselves are not stored in EEPROM.
 
void RestoreValues (void)
 Restores the values of custom OD entries (specified in RestoreList OD index 0x2900) to the OD from EEPROM. Companion function to SaveValues(). Note that if the RestoreList is changed, RestoreValues() will not restore values to the correct subindices in the OD unless the EEPROM data has been updated via SaveValues(). I.e., SaveValues() only stores the data bytes contained within the OD subindices in the order specified by RestoreList; the indices and subindices themselves are not stored in EEPROM.
 
void ResetToODDefault (void)
 invoked by nmt_master – writes 0's to size causing bypass of OD restore, then causes reset
 
void ResetModule (void)
 resets module, called by ResetToODDefault()
 
void EEPROM_erase (UNS8 space)
 writes 0xFF to entire EEPROM (6KB).
 
UNS8 ReadLocalFlashData (UNS32 nvAddress, UNS8 *data, UNS8 numData)
 reads CPU based flash data
 
UNS8 EEPROM_open ()
 Copies the EEPROM into ram for modification by EEPROM_write()
 
UNS8 EEPROM_commit ()
 Commits edits to EEPROM from ram to flash.
 
void EEPROM_read (UNS16 address, UNS8 *data, UNS16 length)
 Reads bytes from a specified location in EEPROM.
 
void EEPROM_write (UNS16 address, UNS8 *data, UNS16 length)
 Writes bytes to a specified location in EEPROM.
 

Detailed Description

Date
Created on: Oct 14, 2024
Author
: jenej

Definition in file eedata.h.

Macro Definition Documentation

◆ EEPROM_ERASE_SIZE

#define EEPROM_ERASE_SIZE   0x60

must be divisible into 6144 (6KB) by factor of 2, defines size of chunks erased from EEPROM

Definition at line 15 of file eedata.h.

Referenced by EEPROM_erase().

◆ EEPROM_PAGE_SIZE

#define EEPROM_PAGE_SIZE   3

XXX: must match the page size in bootloader config.h.

Definition at line 16 of file eedata.h.

Referenced by EEPROM_commit(), and EEPROM_open().

◆ EEPROM_RECORD_SIZE

#define EEPROM_RECORD_SIZE   32

Definition at line 14 of file eedata.h.

◆ EEPROM_START_ADDRESS

#define EEPROM_START_ADDRESS   ((127 - EEPROM_PAGE_SIZE) * FLASH_PAGE_SIZE)

Loation of the start of the EEPROM in flash.

Definition at line 17 of file eedata.h.

Referenced by EEPROM_commit(), EEPROM_open(), and EEPROM_read().

◆ FLASH_RECORD_SIZE

#define FLASH_RECORD_SIZE   32

Definition at line 20 of file eedata.h.

◆ MAX_BYTES_PER_SUBINDEX

#define MAX_BYTES_PER_SUBINDEX   32

Definition at line 12 of file eedata.h.

◆ MAX_EEPROM_MEMORY

#define MAX_EEPROM_MEMORY   0x1800

(6KB)

Definition at line 13 of file eedata.h.

Referenced by EEPROM_erase(), ReadEEProm(), RestoreValues(), SaveValues(), and WriteEEProm().

◆ MAX_FLASH_MEMORY

#define MAX_FLASH_MEMORY   FLASH_SIZE

(256KB)

Definition at line 19 of file eedata.h.