AP_HAL: AnalogIn interface fleshed out

This commit is contained in:
Pat Hickey 2012-09-10 19:05:02 -07:00 committed by Andrew Tridgell
parent 01e34825f3
commit 279a755ab3
3 changed files with 11 additions and 5 deletions

View File

@ -13,6 +13,7 @@ namespace AP_HAL {
class UARTDriver;
class I2CDriver;
class SPIDriver;
class AnalogSource;
class AnalogIn;
class Storage;
class Dataflash;

View File

@ -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__

View File

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