mirror of https://github.com/ArduPilot/ardupilot
AP_HAL: remove Dataflash driver
This commit is contained in:
parent
c441f02426
commit
9cee6cc941
|
@ -10,7 +10,6 @@
|
|||
#include "SPIDriver.h"
|
||||
#include "AnalogIn.h"
|
||||
#include "Storage.h"
|
||||
#include "Dataflash.h"
|
||||
#include "Console.h"
|
||||
#include "GPIO.h"
|
||||
#include "RCInput.h"
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace AP_HAL {
|
|||
class AnalogSource;
|
||||
class AnalogIn;
|
||||
class Storage;
|
||||
class Dataflash;
|
||||
class ConsoleDriver;
|
||||
class DigitalSource;
|
||||
class GPIO;
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
|
||||
#ifndef __AP_HAL_DATAFLASH_H__
|
||||
#define __AP_HAL_DATAFLASH_H__
|
||||
|
||||
#include "AP_HAL_Namespace.h"
|
||||
|
||||
// the last page holds the log format in first 4 bytes. Please change
|
||||
// this if (and only if!) the low level format changes
|
||||
#define DF_LOGGING_FORMAT 0x28122011
|
||||
|
||||
// we use an invalid logging format to test the chip erase
|
||||
#define DF_LOGGING_FORMAT_INVALID 0x28122012
|
||||
|
||||
/* Dataflash abstract class:
|
||||
* This isn't the abstraction ArduPilot needs, but it is the abstraction
|
||||
* ArduPilot deserves.
|
||||
*
|
||||
* I'll build a proper logging driver later which hides the details of using
|
||||
* a dataflash / page based system under the hood. For now the Dataflash layer
|
||||
* will be a port of the existing DataFlash APM1/APM2 driver.
|
||||
* - pch, 31aug12
|
||||
* */
|
||||
class AP_HAL::Dataflash {
|
||||
public:
|
||||
virtual void init(void* implspecific) = 0;
|
||||
virtual void read_mfg_id() = 0;
|
||||
virtual bool media_present() = 0;
|
||||
virtual uint16_t num_pages() = 0;
|
||||
virtual uint8_t mfg_id() = 0;
|
||||
virtual uint16_t device_id() = 0;
|
||||
|
||||
virtual uint16_t get_page() = 0;
|
||||
virtual uint16_t get_write_page() = 0;
|
||||
|
||||
virtual void erase_all() = 0;
|
||||
virtual bool need_erase() = 0;
|
||||
|
||||
virtual void start_write(int16_t page) = 0;
|
||||
virtual void finish_write() = 0;
|
||||
virtual void write_byte(uint8_t data) = 0;
|
||||
virtual void write_word(uint16_t data) = 0;
|
||||
virtual void write_dword(uint32_t data) = 0;
|
||||
|
||||
virtual void start_read(int16_t page) = 0;
|
||||
virtual uint8_t read_byte() = 0;
|
||||
virtual uint16_t read_word() = 0;
|
||||
virtual uint32_t read_dword() = 0;
|
||||
|
||||
virtual void set_file(uint16_t filenum) = 0;
|
||||
virtual uint16_t get_file() = 0;
|
||||
virtual uint16_t get_file_page() = 0;
|
||||
|
||||
virtual int16_t find_last_log() = 0;
|
||||
virtual void get_log_boundaries(uint8_t log,
|
||||
int16_t &startpage, int16_t &endpage) = 0;
|
||||
virtual uint8_t get_num_logs() = 0;
|
||||
virtual void start_new_log() = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // __AP_HAL_DATAFLASH_H__
|
||||
|
|
@ -8,7 +8,6 @@
|
|||
#include "../AP_HAL/SPIDriver.h"
|
||||
#include "../AP_HAL/AnalogIn.h"
|
||||
#include "../AP_HAL/Storage.h"
|
||||
#include "../AP_HAL/Dataflash.h"
|
||||
#include "../AP_HAL/Console.h"
|
||||
#include "../AP_HAL/GPIO.h"
|
||||
#include "../AP_HAL/RCInput.h"
|
||||
|
@ -23,7 +22,6 @@ public:
|
|||
AP_HAL::SPIDeviceManager* _spi,
|
||||
AP_HAL::AnalogIn* _analogin,
|
||||
AP_HAL::Storage* _storage,
|
||||
AP_HAL::Dataflash* _dataflash,
|
||||
AP_HAL::ConsoleDriver* _console,
|
||||
AP_HAL::GPIO* _gpio,
|
||||
AP_HAL::RCInput* _rcin,
|
||||
|
@ -37,7 +35,6 @@ public:
|
|||
spi(_spi),
|
||||
analogin(_analogin),
|
||||
storage(_storage),
|
||||
dataflash(_dataflash),
|
||||
console(_console),
|
||||
gpio(_gpio),
|
||||
rcin(_rcin),
|
||||
|
@ -54,7 +51,6 @@ public:
|
|||
AP_HAL::SPIDeviceManager* spi;
|
||||
AP_HAL::AnalogIn* analogin;
|
||||
AP_HAL::Storage* storage;
|
||||
AP_HAL::Dataflash* dataflash;
|
||||
AP_HAL::ConsoleDriver* console;
|
||||
AP_HAL::GPIO* gpio;
|
||||
AP_HAL::RCInput* rcin;
|
||||
|
|
Loading…
Reference in New Issue