Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
TivaEEPROMEmulation.hxx
Go to the documentation of this file.
1
34#ifndef _FREERTOS_DRIVERS_TI_TIVAEEPROMEMULATION_HXX_
35#define _FREERTOS_DRIVERS_TI_TIVAEEPROMEMULATION_HXX_
36
37#include "EEPROMEmulation.hxx"
38
39#include "driverlib/rom.h"
40#include "driverlib/rom_map.h"
41#include "driverlib/flash.h"
42
43
49{
50public:
54 enum Family
55 {
56 TM4C123 = 1024,
57 TM4C129 = 1024 * 16
58 };
59
64 TivaEEPROMEmulation(const char *name, size_t file_size_bytes);
65
71
72private:
73 static inline const uint32_t* get_block(unsigned sector, unsigned offset);
74
76 static const unsigned FAMILY;
77
81 void flash_erase(unsigned sector) override;
82
90 void flash_program(unsigned sector, unsigned start_block, uint32_t *data,
91 uint32_t byte_count) override;
92
99 const uint32_t* block(unsigned sector, unsigned offset) override;
100
104
106};
107
108#endif /* _FREERTOS_DRIVERS_TI_TIVAEEPROMEMULATION_HXX_ */
Emulates EEPROM in FLASH for the Tiva, LPC17xx and LPC40xx platforms.
const char * name
device name
Definition Devtab.hxx:266
Emulates EEPROM in FLASH for the Tiva platform.
@ TM4C129
Tiva TM4C129 devices, 16K block Size.
@ TM4C123
Tiva TM4C123 devices, 1K block size.
static const unsigned FAMILY
Family that device belongs to
void flash_program(unsigned sector, unsigned start_block, uint32_t *data, uint32_t byte_count) override
Simple hardware abstraction for FLASH program API.
TivaEEPROMEmulation()
Default constructor.
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.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Definition macros.h:171