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::WWaveDriver Class Referencefinal

The W square wave implementation of the pulse driver interface. More...

#include <w_wave_driver.hpp>

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

Public Member Functions

 WWaveDriver (HardwareAbstractionLayer *hal, unsigned int pin)
  constructor More...
 
nes::rob::error_code init (void *reserved=nullptr) override
 Initialize the pulse driver. More...
 
nes::rob::error_code pulse (void *reserved=nullptr) const override
 Generate a protocol specific pulse. More...
 
nes::rob::error_code rest (void *reserved=nullptr) const override
 Generate a protocol specified rest period. More...
 
- Public Member Functions inherited from nes::rob::PulseDriver
virtual ~PulseDriver (void)
 

Detailed Description

The W square wave implementation of the pulse driver interface.

This implementation typically requires some form of hardware modification, which provides access to the ribbon cable running between the IC in R.O.B.s head and the motherboard in the base. The pulses emitted are modeled after the W square wave generated by the IC in R.O.B.'s head.

Constructor & Destructor Documentation

◆ WWaveDriver()

WWaveDriver::WWaveDriver ( HardwareAbstractionLayer hal,
unsigned int  pin 
)

constructor

Parameters
[in]halA HardwareAbstractionLayer instance
[in]pinThe digital GPIO pin used to generate pulses

Member Function Documentation

◆ init()

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

Initialize the pulse driver.

Performs necessary operations to initialize the pulse driver implementation.

Parameters
[in,out]reservedSupports driver specific initialization parameters
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::pulse_driver_error::successNo errors encountered during processing.
nes::rob::pulse_driver_error::hal_initA HAL error occured during the pulse driver initialization.

Implements nes::rob::PulseDriver.

◆ pulse()

nes::rob::error_code WWaveDriver::pulse ( void *  reserved = nullptr) const
overridevirtual

Generate a protocol specific pulse.

Performs necessary GPIO operations to generate a protocol compatible pulse.

Parameters
[in,out]reservedSupports driver specific implementation parameters
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::pulse_driver_error::successNo errors encountered during processing.
nes::rob::pulse_driver_error::hal_clockA clock error occured during pulse generation.
nes::rob::pulse_driver_error::hal_gpio_configUnable to configure GPIO peripheral for pulse generation.
nes::rob::pulse_driver_error::hal_gpio_stateUnable to set GPIO state during pulse generation.

Implements nes::rob::PulseDriver.

◆ rest()

nes::rob::error_code WWaveDriver::rest ( void *  reserved = nullptr) const
overridevirtual

Generate a protocol specified rest period.

Places GPIO in resting state and awaits a period defined by the protocol.

Parameters
[in,out]reservedSupports driver specific implementation parameters
Returns
an nes::rob::error_code describing errors encountered during processing
Return values
nes::rob::pulse_driver_error::successNo errors encountered during processing.
nes::rob::pulse_driver_error::hal_clockA clock error occured while observing rest period.
nes::rob::pulse_driver_error::hal_gpio_configUnable to configure GPIO peripheral for resting state.
nes::rob::pulse_driver_error::hal_gpio_stateUnable to set GPIO pin in resting state.

Implements nes::rob::PulseDriver.


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