Changed logic
This commit is contained in:
37
firmware/src/bsp/ain.h
Normal file
37
firmware/src/bsp/ain.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef ANALOG_IN_H_
|
||||
#define ANALOG_IN_H_
|
||||
|
||||
/**** Includes ****/
|
||||
#include <stdint.h>
|
||||
|
||||
namespace bsp {
|
||||
|
||||
/**** Public definitions ****/
|
||||
static const uint8_t DEF_AIN_MUL = 215;
|
||||
static const uint8_t DEF_AIN_DIV = 44;
|
||||
static const int16_t DEF_AIN_OFFSET = 0;
|
||||
|
||||
class AnalogIn
|
||||
{
|
||||
protected:
|
||||
uint8_t adc_ch;
|
||||
|
||||
public:
|
||||
AnalogIn(uint8_t adc_ch);
|
||||
|
||||
uint8_t mul;
|
||||
uint8_t div;
|
||||
int16_t offset;
|
||||
uint16_t last_read;
|
||||
|
||||
uint16_t read(void);
|
||||
};
|
||||
|
||||
/**** Public function declarations ****/
|
||||
|
||||
#ifdef TESTING
|
||||
#endif
|
||||
|
||||
} //namespace
|
||||
|
||||
#endif /* ANALOG_IN_H_ */
|
||||
Reference in New Issue
Block a user