From 9cee6cc94139d474e4ab6f8f4df7221054e245e5 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 7 Dec 2012 20:54:05 -0800 Subject: [PATCH] AP_HAL: remove Dataflash driver --- libraries/AP_HAL/AP_HAL.h | 1 - libraries/AP_HAL/AP_HAL_Namespace.h | 1 - libraries/AP_HAL/Dataflash.h | 62 ----------------------------- libraries/AP_HAL/HAL.h | 4 -- 4 files changed, 68 deletions(-) delete mode 100644 libraries/AP_HAL/Dataflash.h diff --git a/libraries/AP_HAL/AP_HAL.h b/libraries/AP_HAL/AP_HAL.h index f1344e3ab7..aed2715e19 100644 --- a/libraries/AP_HAL/AP_HAL.h +++ b/libraries/AP_HAL/AP_HAL.h @@ -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" diff --git a/libraries/AP_HAL/AP_HAL_Namespace.h b/libraries/AP_HAL/AP_HAL_Namespace.h index 1086be7b21..37c142e423 100644 --- a/libraries/AP_HAL/AP_HAL_Namespace.h +++ b/libraries/AP_HAL/AP_HAL_Namespace.h @@ -19,7 +19,6 @@ namespace AP_HAL { class AnalogSource; class AnalogIn; class Storage; - class Dataflash; class ConsoleDriver; class DigitalSource; class GPIO; diff --git a/libraries/AP_HAL/Dataflash.h b/libraries/AP_HAL/Dataflash.h deleted file mode 100644 index 69559d2bf8..0000000000 --- a/libraries/AP_HAL/Dataflash.h +++ /dev/null @@ -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__ - diff --git a/libraries/AP_HAL/HAL.h b/libraries/AP_HAL/HAL.h index 48ace09bda..82a810c6c5 100644 --- a/libraries/AP_HAL/HAL.h +++ b/libraries/AP_HAL/HAL.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;