5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-01-13 11:28:30 -04:00

DataFlash: headers switch to use AP_HAL SPI device driver types

This commit is contained in:
Pat Hickey 2012-12-07 19:23:09 -08:00 committed by Andrew Tridgell
parent cc699a2a4e
commit a81de007d8
2 changed files with 8 additions and 12 deletions

View File

@ -4,7 +4,7 @@
#ifndef __DATAFLASH_APM1_H__
#define __DATAFLASH_APM1_H__
#include <AP_Semaphore.h>
#include <AP_HAL.h>
#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();

View File

@ -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();