Interfaces with the AT25M02 EEPROM chip.
More...
#include <AT25M02.hpp>
|
| AT25M02 () |
|
void | init () |
| Initialize the AT25M02 EEPROM device. Define spi settings, chip select pin, and set initial variables to zero.
|
|
bool | writeData (byte *bytes, uint32_t length) |
| Write from the given array to the memory. This data is appended to the end of the queue. Returns true if it successfully wrote all bytes. Returns false if it could not write every byte without overwriting existing data.
|
|
int | readData (byte *dest, uint32_t length) |
| Write the given number of bytes from the ram into the destination array. These bytes are taken from the start of the queue. Returns how many bytes were read and written to the array.
|
|
uint32_t | freeBytes () |
| Returns how many bytes are free and available to be written to.
|
|
uint32_t | usedBytes () |
| Returns the number of bytes currently being used.
|
|
bool | isReady () |
| Checks if the RAM is ready for a new command.
|
|
Interfaces with the AT25M02 EEPROM chip.
Definition at line 32 of file AT25M02.hpp.
◆ AT25M02()
◆ csh()
◆ csl()
◆ freeBufferBytes()
uint32_t AT25M02::freeBufferBytes |
( |
| ) |
|
|
private |
◆ freeBytes()
uint32_t AT25M02::freeBytes |
( |
| ) |
|
Returns how many bytes are free and available to be written to.
Definition at line 55 of file AT25M02.cpp.
◆ freeMemoryBytes()
uint32_t AT25M02::freeMemoryBytes |
( |
| ) |
|
|
private |
◆ init()
Initialize the AT25M02 EEPROM device. Define spi settings, chip select pin, and set initial variables to zero.
Definition at line 39 of file AT25M02.cpp.
◆ isReady()
bool AT25M02::isReady |
( |
| ) |
|
Checks if the RAM is ready for a new command.
Definition at line 187 of file AT25M02.cpp.
◆ readData()
int AT25M02::readData |
( |
byte * |
dest, |
|
|
uint32_t |
length |
|
) |
| |
Write the given number of bytes from the ram into the destination array. These bytes are taken from the start of the queue. Returns how many bytes were read and written to the array.
Definition at line 172 of file AT25M02.cpp.
◆ readMemory()
uint32_t AT25M02::readMemory |
( |
byte * |
dest, |
|
|
uint32_t |
length |
|
) |
| |
|
private |
◆ readStatusReg()
byte AT25M02::readStatusReg |
( |
| ) |
|
|
private |
◆ readWriteBuffer()
uint32_t AT25M02::readWriteBuffer |
( |
byte * |
dest, |
|
|
uint32_t |
length |
|
) |
| |
|
private |
◆ sendCommand()
void AT25M02::sendCommand |
( |
Command |
cmd | ) |
|
|
private |
◆ setWRSR()
void AT25M02::setWRSR |
( |
byte |
val | ) |
|
|
private |
Sets the WRSR (Write status reg)
Definition at line 272 of file AT25M02.cpp.
◆ usedBufferBytes()
uint32_t AT25M02::usedBufferBytes |
( |
| ) |
|
|
private |
◆ usedBytes()
uint32_t AT25M02::usedBytes |
( |
| ) |
|
Returns the number of bytes currently being used.
Definition at line 63 of file AT25M02.cpp.
◆ usedMemoryBytes()
uint32_t AT25M02::usedMemoryBytes |
( |
| ) |
|
|
private |
◆ waitUntilReady()
void AT25M02::waitUntilReady |
( |
| ) |
|
|
private |
Waits until the RAM is ready to write.
Definition at line 289 of file AT25M02.cpp.
◆ writeData()
bool AT25M02::writeData |
( |
byte * |
bytes, |
|
|
uint32_t |
length |
|
) |
| |
Write from the given array to the memory. This data is appended to the end of the queue. Returns true if it successfully wrote all bytes. Returns false if it could not write every byte without overwriting existing data.
Definition at line 98 of file AT25M02.cpp.
◆ writePage()
void AT25M02::writePage |
( |
uint32_t |
addr, |
|
|
byte * |
bytes, |
|
|
uint32_t |
length |
|
) |
| |
|
private |
Write the given data to the RAM in a page write. Increments mem_end when done.
Definition at line 206 of file AT25M02.cpp.
◆ chip_select_pin
int AT25M02::chip_select_pin |
|
private |
◆ mem_end
uint32_t AT25M02::mem_end |
|
private |
◆ mem_start
uint32_t AT25M02::mem_start |
|
private |
◆ ram_full
◆ spi_settings
SPISettings AT25M02::spi_settings |
|
private |
◆ wb_end
◆ write_buffer
uint8_t AT25M02::write_buffer[256] |
|
private |
The documentation for this class was generated from the following files: