mirror of
https://github.com/TomNisbet/TommyPROM.git
synced 2024-06-02 05:41:31 +00:00
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
|
#ifndef INCLUDE_PROM_DEVICE_SST39SF_H
|
||
|
#define INCLUDE_PROM_DEVICE_SST39SF_H
|
||
|
|
||
|
#include "Arduino.h"
|
||
|
#include "PromDevice.h"
|
||
|
|
||
|
/*****************************************************************************/
|
||
|
/*****************************************************************************/
|
||
|
/**
|
||
|
* PromDeviceSST39SF class
|
||
|
*
|
||
|
* Provides the device-specific interface to read and write data from an
|
||
|
* SST39SF series parallel NOR Flash using the Arduino.
|
||
|
*
|
||
|
* Block writes are supported on compatible devices by specifying a blockSize
|
||
|
* in the constructor. Use zero for byte writes.
|
||
|
*/
|
||
|
class PromDeviceSST39SF : public PromDevice
|
||
|
{
|
||
|
public:
|
||
|
PromDeviceSST39SF(uint32_t size, word unsigned maxWriteTime, bool polling);
|
||
|
void begin();
|
||
|
const char * getName() { return "SST39SF series NOR Flash"; }
|
||
|
bool erase(uint32_t start, uint32_t end);
|
||
|
|
||
|
|
||
|
protected:
|
||
|
void setAddress(uint32_t address);
|
||
|
byte readByte(uint32_t address);
|
||
|
bool burnByte(byte value, uint32_t address);
|
||
|
bool waitForWriteCycleEnd(byte lastValue);
|
||
|
void setByte(byte value, uint32_t address);
|
||
|
void eraseSector(uint32_t addr);
|
||
|
|
||
|
uint32_t currentSector;
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // #define INCLUDE_PROM_DEVICE_SST39SF_H
|