Nintendo R.O.B. Control Library
v1.1.2
Library to control the Nintendo Robotic Operating Buddy
|
The hardware abstraction layer interface. More...
#include <hardware_abstraction_layer.hpp>
Public Member Functions | |
virtual | ~HardwareAbstractionLayer (void) |
virtual nes::rob::error_code | init (void *reserved=nullptr)=0 |
Initialize the HAL. More... | |
virtual nes::rob::error_code | delayMicroseconds (unsigned int us) const =0 |
Delay program execution for the specified number of microseconds. More... | |
virtual nes::rob::error_code | digitalWrite (unsigned int pin, int state) const =0 |
Drive the output voltage of a digital GPIO pin. More... | |
virtual nes::rob::error_code | pinMode (unsigned int pin, int mode) const =0 |
Drive the output voltage of a digital GPIO pin. More... | |
Static Public Attributes | |
static const int | PIN_MODE_INPUT = INPUT |
The GPIO mode used to sample digital signals. More... | |
static const int | PIN_MODE_INPUT_PULLUP = INPUT_PULLUP |
The GPIO mode used to sample digital signals with internal pullup resistor enabled. More... | |
static const int | PIN_MODE_OUTPUT = OUTPUT |
The GPIO mode used to write digital signals. More... | |
static const int | PIN_STATE_HIGH = HIGH |
The digital signal value indicating high voltage (typically Vcc) More... | |
static const int | PIN_STATE_LOW = LOW |
The digital signal value indicating low voltage (typically Vdd) More... | |
The hardware abstraction layer interface.
The hardware abstraction layer abstracts hardware specific behavior such as GPIO peripherals, clock timing, and other configuration.
|
inlinevirtual |
|
pure virtual |
Delay program execution for the specified number of microseconds.
[in] | us | The number of microseconds to delay |
nes::rob::error_code
describing errors encountered during processing nes::rob::hal_error::success | No errors encountered during processing. |
nes::rob::hal_error::sys_clock | An unspecified error occured while interacting with the system clock. |
Implemented in nes::rob::HalArduino.
|
pure virtual |
Drive the output voltage of a digital GPIO pin.
[in] | pin | The pin number associated to the target GPIO pin |
[in] | state | The desired state of the pin |
PIN_STATE_HIGH
PIN_STATE_LOW
nes::rob::error_code
describing errors encountered during processing nes::rob::hal_error::success | No errors encountered during processing. |
nes::rob::hal_error::peripheral_gpio | An unspecified error occured while interacting with the GPIO peripheral. |
Implemented in nes::rob::HalArduino.
|
pure virtual |
Initialize the HAL.
Performs necessary operations to initialize the hardware abstraction layer implementation.
[in,out] | reserved | Supports hardware specific initialization parameters |
nes::rob::error_code
describing errors encountered during processing nes::rob::hal_error::success | No errors encountered during processing. |
nes::rob::hal_error::sys_config | An unspecified error occured during system configuration. |
Implemented in nes::rob::HalArduino.
|
pure virtual |
Drive the output voltage of a digital GPIO pin.
[in] | pin | The pin number associated to the target GPIO pin |
[in] | mode | The desired mode of operation for the pin |
PIN_MODE_INPUT
PIN_MODE_INPUT_PULLUP
PIN_MODE_OUTPUT
nes::rob::error_code
describing errors encountered during processing nes::rob::hal_error::success | No errors encountered during processing. |
nes::rob::hal_error::peripheral_gpio | An unspecified error occured while interacting with the GPIO peripheral. |
Implemented in nes::rob::HalArduino.
|
static |
The GPIO mode used to sample digital signals.
|
static |
The GPIO mode used to sample digital signals with internal pullup resistor enabled.
|
static |
The GPIO mode used to write digital signals.
|
static |
The digital signal value indicating high voltage (typically Vcc)
|
static |
The digital signal value indicating low voltage (typically Vdd)