Nintendo R.O.B. Control Library
v1.1.2
Library to control the Nintendo Robotic Operating Buddy
|
The LED NTSC implementation of the pulse driver interface. More...
#include <led_ntsc_driver.hpp>
Public Member Functions | |
LedNtscDriver (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... | |
![]() | |
virtual | ~PulseDriver (void) |
The LED NTSC implementation of the pulse driver interface.
This implementation requires an LED light to be attached to the digital GPIO pin. The pulses emitted adhere to the NTSC protocol, which is required to communicate with R.O.B.
LedNtscDriver::LedNtscDriver | ( | HardwareAbstractionLayer * | hal, |
unsigned int | pin | ||
) |
constructor
[in] | hal | A HardwareAbstractionLayer instance |
[in] | pin | The digital GPIO pin used to generate pulses |
|
overridevirtual |
Initialize the pulse driver.
Performs necessary operations to initialize the pulse driver implementation.
[in,out] | reserved | Supports driver specific initialization parameters |
nes::rob::error_code
describing errors encountered during processing nes::rob::pulse_driver_error::success | No errors encountered during processing. |
nes::rob::pulse_driver_error::hal_init | A HAL error occured during the pulse driver initialization. |
Implements nes::rob::PulseDriver.
|
overridevirtual |
Generate a protocol specific pulse.
Performs necessary GPIO operations to generate a protocol compatible pulse.
[in,out] | reserved | Supports driver specific implementation parameters |
nes::rob::error_code
describing errors encountered during processing nes::rob::pulse_driver_error::success | No errors encountered during processing. |
nes::rob::pulse_driver_error::hal_clock | A clock error occured during pulse generation. |
nes::rob::pulse_driver_error::hal_gpio_config | Unable to configure GPIO peripheral for pulse generation. |
nes::rob::pulse_driver_error::hal_gpio_state | Unable to set GPIO state during pulse generation. |
Implements nes::rob::PulseDriver.
|
overridevirtual |
Generate a protocol specified rest period.
Places GPIO in resting state and awaits a period defined by the protocol.
[in,out] | reserved | Supports driver specific implementation parameters |
nes::rob::error_code
describing errors encountered during processing nes::rob::pulse_driver_error::success | No errors encountered during processing. |
nes::rob::pulse_driver_error::hal_clock | A clock error occured while observing rest period. |
nes::rob::pulse_driver_error::hal_gpio_config | Unable to configure GPIO peripheral for resting state. |
nes::rob::pulse_driver_error::hal_gpio_state | Unable to set GPIO pin in resting state. |
Implements nes::rob::PulseDriver.