FINDA interface module

pull/20/head
D.R.racer 2021-05-31 12:33:19 +02:00 committed by DRracer
parent 3ef113cf6c
commit 939b47d260
2 changed files with 39 additions and 0 deletions

19
src/modules/finda.cpp Normal file
View File

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

20
src/modules/finda.h Normal file
View File

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