|
Longan Nano
Longan Nano Demo
|
#include <longan_nano_led.hpp>
Public Types | |
| enum | _Color { BLACK, RED, GREEN, BLUE, WHITE } |
| Color of the LEDs. More... | |
| enum | _Led_gpio { RED_GPIO = GPIOC, GREEN_GPIO = GPIOA, BLUE_GPIO = GPIOA } |
| GPIO used by the LEDs. More... | |
| enum | _Led_pin { RED_PIN = GPIO_PIN_13, GREEN_PIN = GPIO_PIN_1, BLUE_PIN = GPIO_PIN_2 } |
| pins used by the LEDs More... | |
| typedef enum Longan_nano::Leds::_Color | Color |
| Color of the LEDs. More... | |
| typedef enum Longan_nano::Leds::_Led_gpio | Led_gpio |
| GPIO used by the LEDs. More... | |
| typedef enum Longan_nano::Leds::_Led_pin | Led_pin |
| pins used by the LEDs More... | |
Public Member Functions | |
| Leds (void) | |
| Default constructor. More... | |
| ~Leds (void) | |
| Default destructor. More... | |
Static Public Member Functions | |
| static bool | init (void) |
| public static method init | More... | |
| static bool | set_color (Leds::Color color) |
| public static method set_color | Led_color More... | |
| static bool | toggle (Leds::Color color) |
| public static method toggle | More... | |
| static bool | clear (Leds::Color color) |
| public static method clear | More... | |
| static bool | set (Leds::Color color) |
| public static method set | More... | |
Leds.
Class to control the LEDs on the Longan Nano board
Experiment with scoping of enum and typedef
Can do better...
| typedef enum Longan_nano::Leds::_Color Longan_nano::Leds::Color |
Color of the LEDs.
| typedef enum Longan_nano::Leds::_Led_gpio Longan_nano::Leds::Led_gpio |
GPIO used by the LEDs.
| typedef enum Longan_nano::Leds::_Led_pin Longan_nano::Leds::Led_pin |
pins used by the LEDs
| Longan_nano::Leds::Leds | ( | void | ) |
Default constructor.
| Longan_nano::Leds::~Leds | ( | void | ) |
Default destructor.
|
inlinestatic |
public static method clear |
initialize the longan nano GPIO LEDs
|
inlinestatic |
public static method init |
initialize the longan nano GPIO LEDs

|
inlinestatic |
public static method set |
initialize the longan nano GPIO LEDs

|
inlinestatic |
public static method set_color | Led_color
| color | | Color | color of the LED |
initialize the longan nano GPIO LEDs

|
inlinestatic |
public static method toggle |
initialize the longan nano GPIO LEDs
