mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_HAL: AnalogIn interface fleshed out
This commit is contained in:
parent
01e34825f3
commit
279a755ab3
@ -13,6 +13,7 @@ namespace AP_HAL {
|
||||
class UARTDriver;
|
||||
class I2CDriver;
|
||||
class SPIDriver;
|
||||
class AnalogSource;
|
||||
class AnalogIn;
|
||||
class Storage;
|
||||
class Dataflash;
|
||||
|
@ -4,10 +4,15 @@
|
||||
|
||||
#include "AP_HAL_Namespace.h"
|
||||
|
||||
class AP_HAL::AnalogSource {
|
||||
public:
|
||||
virtual float read() = 0;
|
||||
};
|
||||
|
||||
class AP_HAL::AnalogIn {
|
||||
public:
|
||||
AnalogIn() {}
|
||||
virtual void init(int machtnicht) = 0;
|
||||
virtual void init(void* implspecific) = 0;
|
||||
virtual AP_HAL::AnalogSource* channel(int n) = 0;
|
||||
};
|
||||
|
||||
#endif // __AP_HAL_ANALOG_IN_H__
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
AP_HAL::UARTDriver* _uart3,
|
||||
AP_HAL::I2CDriver* _i2c,
|
||||
AP_HAL::SPIDriver* _spi,
|
||||
AP_HAL::AnalogIn* _analogIn,
|
||||
AP_HAL::AnalogIn* _analogin,
|
||||
AP_HAL::Storage* _storage,
|
||||
AP_HAL::Dataflash* _dataflash,
|
||||
AP_HAL::BetterStream* _console,
|
||||
@ -36,7 +36,7 @@ public:
|
||||
uart3(_uart3),
|
||||
i2c(_i2c),
|
||||
spi(_spi),
|
||||
analogIn(_analogIn),
|
||||
analogin(_analogin),
|
||||
storage(_storage),
|
||||
dataflash(_dataflash),
|
||||
console(_console),
|
||||
@ -54,7 +54,7 @@ public:
|
||||
AP_HAL::UARTDriver* uart3;
|
||||
AP_HAL::I2CDriver* i2c;
|
||||
AP_HAL::SPIDriver* spi;
|
||||
AP_HAL::AnalogIn* analogIn;
|
||||
AP_HAL::AnalogIn* analogin;
|
||||
AP_HAL::Storage* storage;
|
||||
AP_HAL::Dataflash* dataflash;
|
||||
AP_HAL::BetterStream* console;
|
||||
|
Loading…
Reference in New Issue
Block a user