Access the Microchip SRAM with automated memory size detection.
More...
|
| MicrochipSRAM (const uint8_t SSPin) |
|
| ~MicrochipSRAM () |
|
void | clearMemory (const uint8_t clearValue=0) const |
|
template<typename T > |
uint32_t & | get (const uint32_t addr, T &value) const |
|
template<typename T > |
uint32_t & | put (const uint32_t addr, const T &value) const |
|
template<typename T > |
uint32_t & | fillMemory (uint32_t addr, T &value) const |
|
|
uint32_t | SRAMBytes = 0 |
| Number of bytes available on chip//.
|
|
Access the Microchip SRAM with automated memory size detection.
◆ MicrochipSRAM()
MicrochipSRAM::MicrochipSRAM |
( |
const uint8_t |
SSPin | ) |
|
Class constructor
Define the SS Pin and the determine the attached SRAM memory. The algorithm to detect which memory is attached makes use of the fact that a write beyond the end of memory will wrap around to the beginning of memory.
- Parameters
-
[in] | SSPin | SPI Slave-Select pin number |
◆ ~MicrochipSRAM()
MicrochipSRAM::~MicrochipSRAM |
( |
| ) |
|
Class destructor
Currently empty and unused
◆ clearMemory()
void MicrochipSRAM::clearMemory |
( |
const uint8_t |
clearValue = 0 | ) |
const |
Set all memory values to a single byte value
- Parameters
-
[in] | clearValue | Single byte to set all memory to |
◆ fillMemory()
template<typename T >
uint32_t& MicrochipSRAM::fillMemory |
( |
uint32_t |
addr, |
|
|
T & |
value |
|
) |
| const |
|
inline |
Template for filling SRAM memory with a specified value
Will fill as many copies of the given value as will fit in memory
- Parameters
-
[in] | addr | Memory address to start filling at |
[in] | value | Data Type "T" to read |
◆ get()
template<typename T >
uint32_t& MicrochipSRAM::get |
( |
const uint32_t |
addr, |
|
|
T & |
value |
|
) |
| const |
|
inline |
Template for reading from the SRAM memory
As a template it can support compile-time data type definitions
- Parameters
-
[in] | addr | Memory address |
[out] | value | Data Type "T" containing data read from memory |
- Returns
- New current address in SRAM
◆ put()
template<typename T >
uint32_t& MicrochipSRAM::put |
( |
const uint32_t |
addr, |
|
|
const T & |
value |
|
) |
| const |
|
inline |
Template for writing to the SRAM memory
As a template it can support compile-time data type definitions
- Parameters
-
[in] | addr | Memory address |
[in] | value | Data Type "T" to write |
- Returns
- New current address in SRAM
The documentation for this class was generated from the following files: