board abstraction
This commit is contained in:
39
firmware/src/board/dio.h
Normal file
39
firmware/src/board/dio.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef DIGITAL_OUT_H_
|
||||
#define DIGITAL_OUT_H_
|
||||
|
||||
/**** Includes ****/
|
||||
#include <stdint.h>
|
||||
|
||||
namespace board {
|
||||
|
||||
/**** Public definitions ****/
|
||||
const int8_t DIO_LOW = 0;
|
||||
const int8_t DIO_HIGH = 1;
|
||||
const int8_t DIO_HIZ = -1;
|
||||
|
||||
class DigitalIO
|
||||
{
|
||||
protected:
|
||||
uint8_t gpio_ch;
|
||||
int8_t last_set;
|
||||
|
||||
public:
|
||||
DigitalIO(uint8_t gpio_ch, uint8_t init_read);
|
||||
~DigitalIO(void);
|
||||
|
||||
uint8_t last_read;
|
||||
|
||||
uint8_t read(void);
|
||||
void write(int8_t level);
|
||||
uint8_t is_io_match(void);
|
||||
int8_t get_set_level(void);
|
||||
};
|
||||
|
||||
/**** Public function declarations ****/
|
||||
|
||||
#ifdef TESTING
|
||||
#endif
|
||||
|
||||
} //namespace
|
||||
|
||||
#endif /* DIGITAL_OUT_H_ */
|
||||
Reference in New Issue
Block a user