Phoenard
Public Member Functions | List of all members
PHN_SRAM Class Reference

Simplistic library for accessing the 32 Kilobyte 23K256 SRAM chip. More...

#include <PHNSRAM.h>

Public Member Functions

uint8_t begin ()
 Initializes SPI and sets the chip up for first use.
 
void readBlock (uint16_t address, char *data, uint16_t length)
 Reads a block of data.
 
void readSegment (uint16_t index, void *ptr, uint16_t segmentSize)
 Reads a segment block of data; useful for reading structures.
 
void writeBlock (uint16_t address, const char *data, uint16_t length)
 Writes a block of data.
 
void writeSegment (uint16_t index, const void *ptr, uint16_t segmentSize)
 Writes a segment block of data; useful for storing structures.
 
char read (uint16_t address)
 Reads the byte of data stored at an address specified.
 
void write (uint16_t address, char dataByte)
 Writes a byte of data at an address specified.
 
uint8_t writeBlockVerify (uint16_t address, const char *data, uint16_t length)
 Writes a block of data and then verifies the contents by reading.
 
uint8_t verifyBlock (uint16_t address, const char *data, uint16_t length)
 Reads in a block of data and verifies the contents.
 

Detailed Description

Simplistic library for accessing the 32 Kilobyte 23K256 SRAM chip.

Make use of the global sram variable to make use of this class. Before using, call begin() to set up the SPI and initialize the chip. After that, the read/write functions can be called freely to access the data. Access to address 32768 and beyond wrap around back to 0.


The documentation for this class was generated from the following files: