NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
Emulated EEPROM

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()
 
UNS8 ReadLocalFlashData (UNS32 nvAddress, UNS8 *data, UNS8 numData)
 reads CPU based flash data
 
void EEPROM_erase (UNS8 space)
 writes 0xFF to entire EEPROM (6KB).
 
UNS8 EEPROM_open ()
 Copies the EEPROM into ram for modification by EEPROM_write()
 
UNS8 EEPROM_commit ()
 Commits edits to EEPROM from ram to flash.
 
UNS8 EEPROM_discard ()
 Discards current edits to EEPROM without committing to flash.
 
void EEPROM_write (UNS16 address, UNS8 *data, UNS16 length)
 Writes bytes to a specified location in EEPROM.
 
void EEPROM_read (UNS16 address, UNS8 *data, UNS16 length)
 Reads bytes from a specified location in EEPROM.
 

Detailed Description

Function Documentation

◆ CheckRestoreFlag()

UNS8 CheckRestoreFlag ( void )

checks whether or not RestoreValues() should be run.

Returns
1=RestoreValues() should be run, 0=ResetToODDefault() was run, so don't restore from EEPROM

Definition at line 27 of file eedata.c.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EEPROM_commit()

UNS8 EEPROM_commit ( )

Commits edits to EEPROM from ram to flash.

Definition at line 266 of file eedata.c.

Referenced by EEPROM_erase(), ResetToODDefault(), SaveValues(), and WriteEEProm().

Here is the caller graph for this function:

◆ EEPROM_discard()

UNS8 EEPROM_discard ( )

Discards current edits to EEPROM without committing to flash.

Definition at line 309 of file eedata.c.

◆ EEPROM_erase()

void EEPROM_erase ( UNS8 space)

writes 0xFF to entire EEPROM (6KB).

Parameters
spacecan be used to specify region of EEPROM (as long as aligned with EEPROM_ERASE_SIZE)

Definition at line 228 of file eedata.c.

Referenced by processNMTstateChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EEPROM_open()

UNS8 EEPROM_open ( )

Copies the EEPROM into ram for modification by EEPROM_write()

Definition at line 252 of file eedata.c.

Referenced by EEPROM_erase(), ResetToODDefault(), SaveValues(), and WriteEEProm().

Here is the caller graph for this function:

◆ EEPROM_read()

void EEPROM_read ( UNS16 address,
UNS8 * data,
UNS16 length )

Reads bytes from a specified location in EEPROM.

Parameters
addressThe address, relative to the start of the EEPROM where the data will be written.
*datapointer to the data (or array) to read to
lengthlength of data to be read

Definition at line 343 of file eedata.c.

Referenced by CheckRestoreFlag(), ReadEEProm(), and RestoreValues().

Here is the caller graph for this function:

◆ EEPROM_write()

void EEPROM_write ( UNS16 address,
UNS8 * data,
UNS16 length )

Writes bytes to a specified location in EEPROM.

EEPROM_open() must be called before this to copy EEPROM into ram, which this function edits

EEPROM_commit() is called afterwards to commit EEPROM edits to flash

Parameters
addressThe address, relative to the start of the EEPROM where the data will be written.
*datapointer to the data (or array) to be written
lengthlength of data to be written

Definition at line 327 of file eedata.c.

Referenced by EEPROM_erase(), ResetToODDefault(), SaveValues(), and WriteEEProm().

Here is the caller graph for this function:

◆ ReadLocalFlashData()

UNS8 ReadLocalFlashData ( UNS32 nvAddress,
UNS8 * data,
UNS8 numData )

reads CPU based flash data

Parameters
nvAddress
pointerto data
sizeof data requested

Definition at line 205 of file eedata.c.

Referenced by ReadLocalFlashMemory().

Here is the caller graph for this function:

◆ ResetModule()

void ResetModule ( void )

resets module, called by ResetToODDefault()

Definition at line 191 of file eedata.c.

Referenced by processNMTstateChange(), and ResetToODDefault().

Here is the caller graph for this function:

◆ ResetToODDefault()

void ResetToODDefault ( void )

invoked by nmt_master – writes 0's to size causing bypass of OD restore, then causes reset

Definition at line 173 of file eedata.c.

Referenced by processNMTstateChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RestoreValues()

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.

Called from NMT_Do_Restore_Cmd (only when in the Waiting Mode) and from the startup sequence. All OD indices used by the RestoreList MUST have more than one subindex, where the first subindex specifies the number of subindices.

Definition at line 117 of file eedata.c.

Referenced by main(), and processNMTstateChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveValues()

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.

Called from NMT_Do_Restore_Cmd (only when in the Waiting Mode) and from the startup sequence. The first two bytes in EEPROM specify the amount EEPROM used by this function. All OD indices used by the RestoreList MUST have more than one subindex, where the first subindex specifies the number of subindices. Takes ~9ms per byte that needs to be saved.

Definition at line 51 of file eedata.c.

Referenced by main(), and processNMTstateChange().

Here is the call graph for this function:
Here is the caller graph for this function: