2013-02-23 03:52:30 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
2012-12-17 15:07:36 -04:00
|
|
|
/* ************************************************************ */
|
|
|
|
/* DataFlash_EMPTY Log library */
|
|
|
|
/* ************************************************************ */
|
|
|
|
#ifndef __DATAFLASH_EMPTY_H__
|
|
|
|
#define __DATAFLASH_EMPTY_H__
|
|
|
|
|
|
|
|
#include <AP_HAL.h>
|
|
|
|
#include "DataFlash.h"
|
|
|
|
|
2013-02-23 03:52:30 -04:00
|
|
|
class DataFlash_Empty : public DataFlash_Block
|
2012-12-17 15:07:36 -04:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
//Methods
|
|
|
|
uint8_t BufferRead (uint8_t BufferNum, uint16_t IntPageAdr);
|
2013-02-23 03:52:30 -04:00
|
|
|
void BufferWrite (uint8_t BufferNum, uint16_t IntPageAdr, uint8_t Data);
|
|
|
|
void BufferToPage (uint8_t BufferNum, uint16_t PageAdr, uint8_t wait);
|
|
|
|
void PageToBuffer(uint8_t BufferNum, uint16_t PageAdr);
|
|
|
|
void WaitReady();
|
2012-12-17 15:07:36 -04:00
|
|
|
uint8_t ReadStatusReg();
|
|
|
|
uint8_t ReadStatus();
|
2013-02-23 03:52:30 -04:00
|
|
|
uint16_t PageSize();
|
|
|
|
void PageErase (uint16_t PageAdr);
|
|
|
|
void BlockErase (uint16_t BlockAdr);
|
|
|
|
void ChipErase();
|
2012-12-17 15:07:36 -04:00
|
|
|
|
2013-01-12 14:44:05 -04:00
|
|
|
void BlockWrite(uint8_t BufferNum, uint16_t IntPageAdr,
|
|
|
|
const void *pHeader, uint8_t hdr_size,
|
|
|
|
const void *pBuffer, uint16_t size);
|
|
|
|
bool BlockRead(uint8_t BufferNum, uint16_t IntPageAdr, void *pBuffer, uint16_t size);
|
2012-12-17 15:07:36 -04:00
|
|
|
|
2013-02-23 03:52:30 -04:00
|
|
|
public:
|
2013-12-16 20:12:42 -04:00
|
|
|
void Init(const struct LogStructure *structure, uint8_t num_types);
|
2012-12-17 15:07:36 -04:00
|
|
|
void ReadManufacturerID();
|
|
|
|
bool CardInserted();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __DATAFLASH_EMPTY_H__
|