Nintendo R.O.B. Control Library  v1.1.2
Library to control the Nintendo Robotic Operating Buddy
hardware_abstraction_layer.hpp
Go to the documentation of this file.
1 #ifndef HARDWARE_ABSTRACTION_LAYER_HPP
2 #define HARDWARE_ABSTRACTION_LAYER_HPP
3 
4 #include "hal_error.hpp"
5 
6 namespace nes { namespace rob {
7 
15  public:
16  // Implementation specific inputs to the interface
17  // Values must be defined in the concrete implementation
18 
22  static const int PIN_MODE_INPUT;
23 
28  static const int PIN_MODE_INPUT_PULLUP;
29 
33  static const int PIN_MODE_OUTPUT;
34 
39  static const int PIN_STATE_HIGH;
40 
45  static const int PIN_STATE_LOW;
46 
47  virtual ~HardwareAbstractionLayer (void) { }
48 
65  virtual nes::rob::error_code init (void * reserved = nullptr) = 0;
66 
79  virtual nes::rob::error_code delayMicroseconds (unsigned int us) const = 0;
80 
101  virtual nes::rob::error_code digitalWrite (unsigned int pin, int state) const = 0;
102 
125  virtual nes::rob::error_code pinMode (unsigned int pin, int mode) const = 0;
126 };
127 
128 }} // namespace nes::rob
129 
130 #endif // HARDWARE_ABSTRACTION_LAYER_HPP
The hardware abstraction layer interface.
Definition: hardware_abstraction_layer.hpp:14
static const int PIN_MODE_INPUT_PULLUP
The GPIO mode used to sample digital signals with internal pullup resistor enabled.
Definition: hardware_abstraction_layer.hpp:28
static const int PIN_MODE_INPUT
The GPIO mode used to sample digital signals.
Definition: hardware_abstraction_layer.hpp:22
static const int PIN_STATE_HIGH
The digital signal value indicating high voltage (typically Vcc)
Definition: hardware_abstraction_layer.hpp:39
virtual nes::rob::error_code init(void *reserved=nullptr)=0
Initialize the HAL.
virtual ~HardwareAbstractionLayer(void)
Definition: hardware_abstraction_layer.hpp:47
static const int PIN_STATE_LOW
The digital signal value indicating low voltage (typically Vdd)
Definition: hardware_abstraction_layer.hpp:45
virtual nes::rob::error_code delayMicroseconds(unsigned int us) const =0
Delay program execution for the specified number of microseconds.
virtual nes::rob::error_code digitalWrite(unsigned int pin, int state) const =0
Drive the output voltage of a digital GPIO pin.
static const int PIN_MODE_OUTPUT
The GPIO mode used to write digital signals.
Definition: hardware_abstraction_layer.hpp:33
virtual nes::rob::error_code pinMode(unsigned int pin, int mode) const =0
Drive the output voltage of a digital GPIO pin.
std::error_code error_code
Definition: hal_error.hpp:24
Definition: arduino_debug_driver.hpp:6