Nintendo R.O.B. Control Library  v1.1.2
Library to control the Nintendo Robotic Operating Buddy
Public Member Functions | Static Public Attributes | List of all members
nes::rob::HardwareAbstractionLayer Class Referenceabstract

The hardware abstraction layer interface. More...

#include <hardware_abstraction_layer.hpp>

Inheritance diagram for nes::rob::HardwareAbstractionLayer:
Inheritance graph
[legend]

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

Detailed Description

The hardware abstraction layer interface.

The hardware abstraction layer abstracts hardware specific behavior such as GPIO peripherals, clock timing, and other configuration.

Constructor & Destructor Documentation

◆ ~HardwareAbstractionLayer()

virtual nes::rob::HardwareAbstractionLayer::~HardwareAbstractionLayer ( void  )
inlinevirtual

Member Function Documentation

◆ delayMicroseconds()

virtual nes::rob::error_code nes::rob::HardwareAbstractionLayer::delayMicroseconds ( unsigned int  us) const
pure virtual

Delay program execution for the specified number of microseconds.

Parameters
[in]usThe number of microseconds to delay
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::hal_error::successNo errors encountered during processing.
nes::rob::hal_error::sys_clockAn unspecified error occured while interacting with the system clock.

Implemented in nes::rob::HalArduino.

◆ digitalWrite()

virtual nes::rob::error_code nes::rob::HardwareAbstractionLayer::digitalWrite ( unsigned int  pin,
int  state 
) const
pure virtual

Drive the output voltage of a digital GPIO pin.

Parameters
[in]pinThe pin number associated to the target GPIO pin
[in]stateThe desired state of the pin
  • PIN_STATE_HIGH
  • PIN_STATE_LOW
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::hal_error::successNo errors encountered during processing.
nes::rob::hal_error::peripheral_gpioAn unspecified error occured while interacting with the GPIO peripheral.
See also
nes::rob::HardwareAbstractionLayer::PIN_STATE_HIGH
nes::rob::HardwareAbstractionLayer::PIN_STATE_LOW
nes::rob::HardwareAbstractionLayer::pinMode

Implemented in nes::rob::HalArduino.

◆ init()

virtual nes::rob::error_code nes::rob::HardwareAbstractionLayer::init ( void *  reserved = nullptr)
pure virtual

Initialize the HAL.

Performs necessary operations to initialize the hardware abstraction layer implementation.

Parameters
[in,out]reservedSupports hardware specific initialization parameters
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::hal_error::successNo errors encountered during processing.
nes::rob::hal_error::sys_configAn unspecified error occured during system configuration.

Implemented in nes::rob::HalArduino.

◆ pinMode()

virtual nes::rob::error_code nes::rob::HardwareAbstractionLayer::pinMode ( unsigned int  pin,
int  mode 
) const
pure virtual

Drive the output voltage of a digital GPIO pin.

Parameters
[in]pinThe pin number associated to the target GPIO pin
[in]modeThe desired mode of operation for the pin
  • PIN_MODE_INPUT
  • PIN_MODE_INPUT_PULLUP
  • PIN_MODE_OUTPUT
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::hal_error::successNo errors encountered during processing.
nes::rob::hal_error::peripheral_gpioAn unspecified error occured while interacting with the GPIO peripheral.
See also
nes::rob::HardwareAbstractionLayer::PIN_MODE_INPUT
nes::rob::HardwareAbstractionLayer::PIN_MODE_INPUT_PULLUP
nes::rob::HardwareAbstractionLayer::PIN_MODE_OUTPUT
nes::rob::HardwareAbstractionLayer::digitalWrite

Implemented in nes::rob::HalArduino.

Member Data Documentation

◆ PIN_MODE_INPUT

const int HardwareAbstractionLayer::PIN_MODE_INPUT = INPUT
static

The GPIO mode used to sample digital signals.

◆ PIN_MODE_INPUT_PULLUP

const int HardwareAbstractionLayer::PIN_MODE_INPUT_PULLUP = INPUT_PULLUP
static

The GPIO mode used to sample digital signals with internal pullup resistor enabled.

◆ PIN_MODE_OUTPUT

const int HardwareAbstractionLayer::PIN_MODE_OUTPUT = OUTPUT
static

The GPIO mode used to write digital signals.

◆ PIN_STATE_HIGH

const int HardwareAbstractionLayer::PIN_STATE_HIGH = HIGH
static

The digital signal value indicating high voltage (typically Vcc)

◆ PIN_STATE_LOW

const int HardwareAbstractionLayer::PIN_STATE_LOW = LOW
static

The digital signal value indicating low voltage (typically Vdd)


The documentation for this class was generated from the following files: