MySensors Library & Examples  2.3.2
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SPIFlash Class Reference

Detailed Description

SPIFlash class

Definition at line 161 of file SPIFlash.h.

#include <SPIFlash.h>

+ Collaboration diagram for SPIFlash:

Public Member Functions

 SPIFlash (uint8_t slaveSelectPin, uint16_t jedecID=0)
 Constructor.
 
bool initialize ()
 setup SPI, read device ID etc...
 
void command (uint8_t cmd, bool isWrite=false)
 Send a command to the flash chip, pass TRUE for isWrite when its a write command.
 
uint8_t readStatus ()
 return the STATUS register
 
uint8_t readByte (uint32_t addr)
 read 1 byte from flash memory
 
void readBytes (uint32_t addr, void *buf, uint16_t len)
 read unlimited # of bytes
 
void writeByte (uint32_t addr, uint8_t byt)
 Write 1 byte to flash memory.
 
void writeBytes (uint32_t addr, const void *buf, uint16_t len)
 write multiple bytes to flash memory (up to 64K), if define SPIFLASH_SST25TYPE is set AAI Word Programming will be used
 
bool busy ()
 check if the chip is busy erasing/writing
 
void chipErase ()
 erase entire flash memory array
 
void blockErase4K (uint32_t address)
 erase a 4Kbyte block
 
void blockErase32K (uint32_t address)
 erase a 32Kbyte block
 
void blockErase64K (uint32_t addr)
 erase a 64Kbyte block
 
uint16_t readDeviceId ()
 Get the manufacturer and device ID bytes (as a short word)
 
uint8_t * readUniqueId ()
 Get the 64 bit unique identifier, stores it in UNIQUEID[8].
 
void sleep ()
 Put device to sleep.
 
void wakeup ()
 Wake device.
 
void end ()
 end
 

Static Public Attributes

static uint8_t UNIQUEID [8]
 Storage for unique identifier.
 

Protected Member Functions

void select ()
 select
 
void unselect ()
 unselect
 

Protected Attributes

uint8_t _slaveSelectPin
 Slave select pin.
 
uint16_t _jedecID
 JEDEC ID.
 
uint8_t _SPCR
 SPCR.
 
uint8_t _SPSR
 SPSR.
 

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