From a81de007d8fc7dde4bb9b4f5eab089c4946c3369 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 7 Dec 2012 19:23:09 -0800 Subject: [PATCH] DataFlash: headers switch to use AP_HAL SPI device driver types --- libraries/DataFlash/DataFlash_APM1.h | 12 +++++------- libraries/DataFlash/DataFlash_APM2.h | 8 +++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/libraries/DataFlash/DataFlash_APM1.h b/libraries/DataFlash/DataFlash_APM1.h index 65b7b2f440..6d51e42055 100644 --- a/libraries/DataFlash/DataFlash_APM1.h +++ b/libraries/DataFlash/DataFlash_APM1.h @@ -4,7 +4,7 @@ #ifndef __DATAFLASH_APM1_H__ #define __DATAFLASH_APM1_H__ -#include +#include #include "DataFlash.h" class DataFlash_APM1 : public DataFlash_Class @@ -19,17 +19,15 @@ private: uint8_t ReadStatusReg(); uint8_t ReadStatus(); uint16_t PageSize(); - void CS_inactive(); - void CS_active(); void PageErase (uint16_t PageAdr); void BlockErase (uint16_t BlockAdr); void ChipErase(void (*delay_cb)(unsigned long)); - - uint8_t SPI_transfer(uint8_t data); - AP_Semaphore* _spi_semaphore; + + AP_HAL::SPIDeviceDriver *_spi; + AP_HAL::Semaphore *_spi_sem; public: - DataFlash_APM1(AP_Semaphore* spi_semaphore = NULL) : _spi_semaphore(spi_semaphore) {} + DataFlash_APM1() {} void Init(); void ReadManufacturerID(); bool CardInserted(); diff --git a/libraries/DataFlash/DataFlash_APM2.h b/libraries/DataFlash/DataFlash_APM2.h index ce07a9787a..caaec5f9e0 100644 --- a/libraries/DataFlash/DataFlash_APM2.h +++ b/libraries/DataFlash/DataFlash_APM2.h @@ -20,16 +20,14 @@ private: uint8_t ReadStatus(); uint16_t PageSize(); - uint8_t SPI_transfer(uint8_t data); - void CS_inactive(); - void CS_active(); void PageErase (uint16_t PageAdr); void BlockErase (uint16_t BlockAdr); void ChipErase(void (*delay_cb)(unsigned long)); - AP_Semaphore* _spi3_semaphore; + AP_HAL::SPIDeviceDriver* _spi; + AP_HAL::Semaphore* _spi_sem; public: - DataFlash_APM2(AP_Semaphore* spi3_semaphore = NULL) : _spi3_semaphore(spi3_semaphore) {} + DataFlash_APM2() {} void Init(); void ReadManufacturerID();