mirror of https://github.com/ArduPilot/ardupilot
parent
2fbe6edf47
commit
608fd54f62
|
@ -18,6 +18,7 @@
|
||||||
#include "Semaphores.h"
|
#include "Semaphores.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "OpticalFlow.h"
|
#include "OpticalFlow.h"
|
||||||
|
#include "Flash.h"
|
||||||
|
|
||||||
#if HAL_WITH_UAVCAN
|
#if HAL_WITH_UAVCAN
|
||||||
#include "CAN.h"
|
#include "CAN.h"
|
||||||
|
|
|
@ -33,6 +33,7 @@ namespace AP_HAL {
|
||||||
class CAN;
|
class CAN;
|
||||||
|
|
||||||
class Util;
|
class Util;
|
||||||
|
class Flash;
|
||||||
|
|
||||||
/* Utility Classes */
|
/* Utility Classes */
|
||||||
class Print;
|
class Print;
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
interface to flash read/write
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "AP_HAL_Namespace.h"
|
||||||
|
|
||||||
|
class AP_HAL::Flash {
|
||||||
|
public:
|
||||||
|
virtual uint32_t getpageaddr(uint32_t page) = 0;
|
||||||
|
virtual uint32_t getpagesize(uint32_t page) = 0;
|
||||||
|
virtual uint32_t getnumpages(void) = 0;
|
||||||
|
virtual bool erasepage(uint32_t page) = 0;
|
||||||
|
virtual bool write(uint32_t addr, const void *buf, uint32_t count) = 0;
|
||||||
|
virtual void keep_unlocked(bool set) = 0;
|
||||||
|
virtual bool ispageerased(uint32_t page) = 0;
|
||||||
|
};
|
|
@ -43,6 +43,7 @@ public:
|
||||||
AP_HAL::Scheduler* _scheduler,
|
AP_HAL::Scheduler* _scheduler,
|
||||||
AP_HAL::Util* _util,
|
AP_HAL::Util* _util,
|
||||||
AP_HAL::OpticalFlow *_opticalflow,
|
AP_HAL::OpticalFlow *_opticalflow,
|
||||||
|
AP_HAL::Flash *_flash,
|
||||||
#if HAL_WITH_UAVCAN
|
#if HAL_WITH_UAVCAN
|
||||||
AP_HAL::CANManager* _can_mgr[MAX_NUMBER_OF_CAN_DRIVERS])
|
AP_HAL::CANManager* _can_mgr[MAX_NUMBER_OF_CAN_DRIVERS])
|
||||||
#else
|
#else
|
||||||
|
@ -66,7 +67,8 @@ public:
|
||||||
rcout(_rcout),
|
rcout(_rcout),
|
||||||
scheduler(_scheduler),
|
scheduler(_scheduler),
|
||||||
util(_util),
|
util(_util),
|
||||||
opticalflow(_opticalflow)
|
opticalflow(_opticalflow),
|
||||||
|
flash(_flash)
|
||||||
{
|
{
|
||||||
#if HAL_WITH_UAVCAN
|
#if HAL_WITH_UAVCAN
|
||||||
if (_can_mgr == nullptr) {
|
if (_can_mgr == nullptr) {
|
||||||
|
@ -117,6 +119,7 @@ public:
|
||||||
AP_HAL::Scheduler* scheduler;
|
AP_HAL::Scheduler* scheduler;
|
||||||
AP_HAL::Util *util;
|
AP_HAL::Util *util;
|
||||||
AP_HAL::OpticalFlow *opticalflow;
|
AP_HAL::OpticalFlow *opticalflow;
|
||||||
|
AP_HAL::Flash *flash;
|
||||||
#if HAL_WITH_UAVCAN
|
#if HAL_WITH_UAVCAN
|
||||||
AP_HAL::CANManager* can_mgr[MAX_NUMBER_OF_CAN_DRIVERS];
|
AP_HAL::CANManager* can_mgr[MAX_NUMBER_OF_CAN_DRIVERS];
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue