#include <EEPROM.h>
|
typedef void(* | func_t) (uint8_t page) |
|
|
| EEPROMClass (void) |
|
uint16_t | init (uint32_t, uint32_t, uint32_t) |
|
uint16_t | format (void) |
| Erases PAGE0 and PAGE1 and writes EEPROM_VALID_PAGE / 0 header to PAGE0. More...
|
|
uint16_t | erases (uint16_t *) |
| Returns the erase counter for current page. More...
|
|
uint16_t | read (uint16_t address, uint16_t *data) |
| Returns the last stored variable data, if found, which correspond to the passed virtual address. More...
|
|
uint16_t | read (uint16_t address) |
| Returns the last stored variable data, if found, which correspond to the passed virtual address. More...
|
|
uint16_t | write (uint16_t address, uint16_t data) |
| Writes/upadtes variable data in EEPROM. More...
|
|
uint16_t | count (uint16_t *data) |
| Return number of variable. More...
|
|
uint16_t | maxcount (void) |
|
uint16_t | _CheckErasePage (uint32_t, uint16_t) |
| Check page for blank and erase it. More...
|
|
Definition at line 29 of file EEPROM.h.
◆ func_t
typedef void(* EEPROMClass::func_t) (uint8_t page) |
◆ EEPROMClass()
EEPROMClass::EEPROMClass |
( |
void |
| ) |
|
◆ _CheckErasePage()
uint16_t EEPROMClass::_CheckErasePage |
( |
uint32_t |
pageBase, |
|
|
uint16_t |
req |
|
) |
| |
Check page for blank and erase it.
- Parameters
-
- Return values
-
Success | or error
- Flash error code: on write Flash error
- EEPROM_BAD_FLASH: page not empty after erase
- EEPROM_OK: page blank
|
Definition at line 193 of file EEPROM.cpp.
Referenced by _format(), _init(), _PageTransfer(), and read_32().
◆ _CheckPage()
uint16_t EEPROMClass::_CheckPage |
( |
uint32_t |
pageBase, |
|
|
uint16_t |
status |
|
) |
| |
|
private |
Check page for blank.
- Parameters
-
- Return values
-
Success | or error EEPROM_BAD_FLASH: page not empty after erase EEPROM_OK: page blank |
Definition at line 110 of file EEPROM.cpp.
Referenced by _CheckErasePage().
◆ _ErasePage()
FLASH_Status EEPROMClass::_ErasePage |
( |
uint32_t |
pageBase | ) |
|
|
private |
Erase page with increment erase counter (page + 2)
- Parameters
-
- Return values
-
Success | or error FLASH_COMPLETE: success erase
- Flash error code: on write Flash error
|
Definition at line 163 of file EEPROM.cpp.
Referenced by _CheckErasePage().
◆ _ErasePageByAddress()
FLASH_Status EEPROMClass::_ErasePageByAddress |
( |
uint32_t |
Page_Address | ) |
|
|
static |
Erases a specified FLASH page by address.
- Parameters
-
Page_Address | The page address to be erased. |
- Return values
-
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 130 of file EEPROM.cpp.
Referenced by _ErasePage(), OSD_EEPROM::erasePageByAddress(), and read_32().
◆ _FindValidPage()
uint32_t EEPROMClass::_FindValidPage |
( |
void |
| ) |
|
|
private |
◆ _format()
uint16_t EEPROMClass::_format |
( |
void |
| ) |
|
|
private |
Erases PAGE0 and PAGE1 and writes EEPROM_VALID_PAGE / 0 header to PAGE0.
- Parameters
-
PAGE0 | and PAGE1 base addresses |
- Return values
-
_status | of the last operation (Flash write or erase) done during EEPROM formating |
Definition at line 574 of file EEPROM.cpp.
Referenced by _init(), and format().
◆ _Format()
uint16_t EEPROMClass::_Format |
( |
void |
| ) |
|
|
private |
◆ _GetVariablesCount()
uint16_t EEPROMClass::_GetVariablesCount |
( |
uint32_t |
pageBase, |
|
|
uint16_t |
skipAddress |
|
) |
| |
|
private |
Calculate unique variables in EEPROM.
- Parameters
-
start | address of first slot to check (page + 4) |
end | page end address |
address | 16 bit virtual address of the variable to excluse (or 0XFFFF) |
- Return values
-
Definition at line 239 of file EEPROM.cpp.
Referenced by _init(), _VerifyPageFullWriteVariable(), and count().
◆ _init()
uint16_t EEPROMClass::_init |
( |
void |
| ) |
|
|
private |
◆ _PageTransfer()
uint16_t EEPROMClass::_PageTransfer |
( |
uint32_t |
newPage, |
|
|
uint32_t |
oldPage, |
|
|
uint16_t |
SkipAddress |
|
) |
| |
|
private |
Transfers last updated variables data from the full Page to an empty one.
- Parameters
-
newPage | new page base address |
oldPage | old page base address |
SkipAddress | 16 bit virtual address of the variable (or 0xFFFF) |
- Return values
-
Success | or error status:
- FLASH_COMPLETE: on success
- EEPROM_OUT_SIZE: if valid new page is full
- Flash error code: on write Flash error
|
Definition at line 274 of file EEPROM.cpp.
Referenced by _init(), and _VerifyPageFullWriteVariable().
◆ _VerifyPageFullWriteVariable()
uint16_t EEPROMClass::_VerifyPageFullWriteVariable |
( |
uint16_t |
Address, |
|
|
uint16_t |
Data |
|
) |
| |
|
private |
Verify if active page is full and Writes variable in EEPROM.
- Parameters
-
Address | 16 bit virtual address of the variable |
Data | 16 bit data to be written as variable value |
- Return values
-
Success | or error status:
- FLASH_COMPLETE: on success
- EEPROM_PAGE_FULL: if valid page is full (need page transfer)
- EEPROM_NO_VALID_PAGE: if no valid page was found
- EEPROM_OUT_SIZE: if EEPROM size exceeded
- Flash error code: on write Flash error
|
Definition at line 351 of file EEPROM.cpp.
Referenced by write().
◆ count()
uint16_t EEPROMClass::count |
( |
uint16_t * |
cnt | ) |
|
Return number of variable.
- Return values
-
Definition at line 705 of file EEPROM.cpp.
Referenced by read().
◆ erases()
uint16_t EEPROMClass::erases |
( |
uint16_t * |
Erases | ) |
|
Returns the erase counter for current page.
- Parameters
-
Data | Global variable contains the read variable value |
- Return values
-
Success | or error status:
- EEPROM_OK: if erases counter return.
- EEPROM_NO_VALID_PAGE: if no valid page was found.
|
Definition at line 618 of file EEPROM.cpp.
◆ FLASH_Lock_check()
void EEPROMClass::FLASH_Lock_check |
( |
| ) |
|
|
static |
◆ FLASH_OB_WRPConfig()
void EEPROMClass::FLASH_OB_WRPConfig |
( |
uint32_t |
OB_WRP, |
|
|
FunctionalState |
NewState |
|
) |
| |
|
static |
◆ FLASH_Unlock_dis()
void EEPROMClass::FLASH_Unlock_dis |
( |
| ) |
|
|
static |
◆ format()
uint16_t EEPROMClass::format |
( |
void |
| ) |
|
Erases PAGE0 and PAGE1 and writes EEPROM_VALID_PAGE / 0 header to PAGE0.
- Parameters
-
PAGE0 | and PAGE1 base addresses |
- Return values
-
_status | of the last operation (Flash write or erase) done during EEPROM formating |
Definition at line 602 of file EEPROM.cpp.
◆ init()
uint16_t EEPROMClass::init |
( |
uint32_t |
pageBase0, |
|
|
uint32_t |
pageBase1, |
|
|
uint32_t |
pageSize |
|
) |
| |
◆ maxcount()
uint16_t EEPROMClass::maxcount |
( |
void |
| ) |
|
|
inline |
◆ read() [1/2]
uint16_t EEPROMClass::read |
( |
uint16_t |
Address, |
|
|
uint16_t * |
Data |
|
) |
| |
Returns the last stored variable data, if found, which correspond to the passed virtual address.
- Parameters
-
Address | Variable virtual address |
Data | Pointer to data variable |
- Return values
-
Success | or error status:
- EEPROM_OK: if variable was found
- EEPROM_BAD_ADDRESS: if the variable was not found
- EEPROM_NO_VALID_PAGE: if no valid page was found.
|
Definition at line 642 of file EEPROM.cpp.
Referenced by read().
◆ read() [2/2]
uint16_t EEPROMClass::read |
( |
uint16_t |
address | ) |
|
|
inline |
Returns the last stored variable data, if found, which correspond to the passed virtual address.
- Parameters
-
Address | Variable virtual address |
- Return values
-
Data | for variable or EEPROM_DEFAULT_DATA, if any errors |
Definition at line 70 of file EEPROM.h.
◆ read_16()
static uint32_t EEPROMClass::read_16 |
( |
uint32_t |
addr | ) |
|
|
inlinestatic |
◆ read_32()
static uint32_t EEPROMClass::read_32 |
( |
uint32_t |
addr | ) |
|
|
inlinestatic |
◆ write()
uint16_t EEPROMClass::write |
( |
uint16_t |
Address, |
|
|
uint16_t |
Data |
|
) |
| |
Writes/upadtes variable data in EEPROM.
- Parameters
-
VirtAddress | Variable virtual address |
Data | 16 bit data to be written |
- Return values
-
Success | or error status:
- FLASH_COMPLETE: on success
- EEPROM_BAD_ADDRESS: if address = 0xFFFF
- EEPROM_PAGE_FULL: if valid page is full
- EEPROM_NO_VALID_PAGE: if no valid page was found
- EEPROM_OUT_SIZE: if no empty EEPROM variables
- Flash error code: on write Flash error
|
Definition at line 682 of file EEPROM.cpp.
Referenced by read().
◆ write_16()
FLASH_Status EEPROMClass::write_16 |
( |
uint32_t |
addr, |
|
|
uint16_t |
data |
|
) |
| |
|
static |
◆ write_8()
FLASH_Status EEPROMClass::write_8 |
( |
uint32_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
|
static |
◆ _status
uint16_t EEPROMClass::_status |
|
private |
◆ PageBase0
uint32_t EEPROMClass::PageBase0 |
|
private |
◆ PageBase1
uint32_t EEPROMClass::PageBase1 |
|
private |
◆ PageSize
uint32_t EEPROMClass::PageSize |
|
private |
The documentation for this class was generated from the following files: