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

The Arduino implementation of the hardware abstraction layer interface. More...

#include <hal_arduino.hpp>

Inheritance diagram for nes::rob::HalArduino:
Inheritance graph
[legend]
Collaboration diagram for nes::rob::HalArduino:
Collaboration graph
[legend]

Public Member Functions

nes::rob::error_code delayMicroseconds (unsigned int us) const override
 Delay program execution for the specified number of microseconds. More...
 
nes::rob::error_code digitalWrite (unsigned int pin, int state) const override
 Drive the output voltage of a digital GPIO pin. More...
 
nes::rob::error_code init (void *reserved=nullptr) override
 Initialize the HAL. More...
 
nes::rob::error_code pinMode (unsigned int pin, int mode) const override
 Drive the output voltage of a digital GPIO pin. More...
 
- Public Member Functions inherited from nes::rob::HardwareAbstractionLayer
virtual ~HardwareAbstractionLayer (void)
 

Additional Inherited Members

- Static Public Attributes inherited from nes::rob::HardwareAbstractionLayer
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 Arduino implementation of the hardware abstraction layer interface.

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

Member Function Documentation

◆ delayMicroseconds()

nes::rob::error_code HalArduino::delayMicroseconds ( unsigned int  us) const
overridevirtual

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.

Implements nes::rob::HardwareAbstractionLayer.

◆ digitalWrite()

nes::rob::error_code HalArduino::digitalWrite ( unsigned int  pin,
int  state 
) const
overridevirtual

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

Implements nes::rob::HardwareAbstractionLayer.

◆ init()

nes::rob::error_code HalArduino::init ( void *  reserved = nullptr)
overridevirtual

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.

Implements nes::rob::HardwareAbstractionLayer.

◆ pinMode()

nes::rob::error_code HalArduino::pinMode ( unsigned int  pin,
int  mode 
) const
overridevirtual

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

Implements nes::rob::HardwareAbstractionLayer.


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