FINDA interface module
parent
3ef113cf6c
commit
939b47d260
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include "finda.h"
|
||||||
|
#include "../hal/adc.h"
|
||||||
|
|
||||||
|
namespace modules {
|
||||||
|
namespace finda {
|
||||||
|
|
||||||
|
FINDA finda;
|
||||||
|
|
||||||
|
uint8_t FINDA::Status() const {
|
||||||
|
// we can read ADC directly
|
||||||
|
return hal::adc::ReadADC(1) > 512;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FINDA::Step() {
|
||||||
|
// in this implementation FINDA doesn't need any stepping
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace finda
|
||||||
|
} // namespace modules
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
#pragma once
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
namespace modules {
|
||||||
|
namespace finda {
|
||||||
|
|
||||||
|
enum { On,
|
||||||
|
Off };
|
||||||
|
|
||||||
|
class FINDA {
|
||||||
|
public:
|
||||||
|
inline FINDA() = default;
|
||||||
|
uint8_t Status() const;
|
||||||
|
void Step();
|
||||||
|
};
|
||||||
|
|
||||||
|
extern FINDA finda;
|
||||||
|
|
||||||
|
} // namespace finda
|
||||||
|
} // namespace modules
|
||||||
Loading…
Reference in New Issue