2011-11-12 23:29:07 -04:00
|
|
|
/* ************************************************************ */
|
2011-11-25 19:11:14 -04:00
|
|
|
/* DataFlash_APM2 Log library */
|
2011-11-12 23:29:07 -04:00
|
|
|
/* ************************************************************ */
|
2011-11-25 19:11:14 -04:00
|
|
|
#ifndef __DATAFLASH_APM2_H__
|
|
|
|
#define __DATAFLASH_APM2_H__
|
2011-11-12 23:29:07 -04:00
|
|
|
|
|
|
|
#include "DataFlash.h"
|
|
|
|
|
2011-11-25 19:11:14 -04:00
|
|
|
class DataFlash_APM2 : public DataFlash_Class
|
2011-11-12 23:29:07 -04:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
//Methods
|
2011-11-13 01:47:28 -04:00
|
|
|
unsigned char BufferRead (unsigned char BufferNum, uint16_t IntPageAdr);
|
|
|
|
void BufferWrite (unsigned char BufferNum, uint16_t IntPageAdr, unsigned char Data);
|
|
|
|
void BufferToPage (unsigned char BufferNum, uint16_t PageAdr, unsigned char wait);
|
|
|
|
void PageToBuffer(unsigned char BufferNum, uint16_t PageAdr);
|
2011-11-12 23:29:07 -04:00
|
|
|
void WaitReady();
|
|
|
|
unsigned char ReadStatusReg();
|
|
|
|
unsigned char ReadStatus();
|
2011-11-13 01:47:28 -04:00
|
|
|
uint16_t PageSize();
|
2011-11-12 23:29:07 -04:00
|
|
|
|
|
|
|
unsigned char SPI_transfer(unsigned char data);
|
|
|
|
void CS_inactive();
|
|
|
|
void CS_active();
|
2011-12-28 00:52:36 -04:00
|
|
|
void PageErase (uint16_t PageAdr);
|
2012-07-03 23:36:42 -03:00
|
|
|
void BlockErase (uint16_t BlockAdr);
|
2012-08-18 08:28:31 -03:00
|
|
|
void ChipErase(void (*delay_cb)(unsigned long));
|
2011-11-12 23:29:07 -04:00
|
|
|
|
|
|
|
public:
|
2011-11-25 19:11:14 -04:00
|
|
|
DataFlash_APM2(); // Constructor
|
2011-11-12 23:29:07 -04:00
|
|
|
void Init();
|
|
|
|
void ReadManufacturerID();
|
2011-11-13 01:47:28 -04:00
|
|
|
bool CardInserted();
|
2011-11-12 23:29:07 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|