Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Lpc17xx40xxEEPROMEmulation.hxx
Go to the documentation of this file.
1
34#ifndef _FREERTOS_DRIVERS_NXP_LPC17xx40xxEEPROMEMULATION_HXX_
35#define _FREERTOS_DRIVERS_NXP_LPC17xx40xxEEPROMEMULATION_HXX_
36
37#include "EEPROMEmulation.hxx"
38
43{
44public:
49 LpcEEPROMEmulation(const char *name, size_t file_size);
50
56
57private:
59 static constexpr unsigned WRITE_SIZE = 256;
60
61 static inline const uint32_t* get_block(unsigned sector, unsigned offset);
62
69 const uint32_t* block(unsigned sector, unsigned offset) override;
70
74 void flash_erase(unsigned sector) override;
75
83 void flash_program(unsigned sector, unsigned start_block, uint32_t *data, uint32_t byte_count) override;
84
87 const uint8_t firstSector_;
88
91
95
97};
98
99#endif /* _FREERTOS_DRIVERS_NXP_LPC17xx40xxEEPROMEMULATION_HXX_ */
Emulates EEPROM in FLASH for the Tiva, LPC17xx and LPC40xx platforms.
size_t file_size()
Get the maximum file size of the EEPROM file.
Definition EEPROM.hxx:81
const char * name
device name
Definition Devtab.hxx:266
Emulates EEPROM in FLASH for the LPC17xx and LPC40xx platforms.
LpcEEPROMEmulation()
Default constructor.
static constexpr unsigned WRITE_SIZE
write size in bytes, must be used as an array size
void flash_erase(unsigned sector) override
Simple hardware abstraction for FLASH erase API.
const uint32_t * block(unsigned sector, unsigned offset) override
Computes the pointer to load the data stored in a specific block from.
const uint8_t firstSector_
Stores the IAP sector code for the first sector starting at __eeprom_start.
uint8_t scratch[WRITE_SIZE]
scratchpad for performing write operations
void flash_program(unsigned sector, unsigned start_block, uint32_t *data, uint32_t byte_count) override
Simple hardware abstraction for FLASH program API.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Definition macros.h:171