Longan Nano
Longan Nano Demo
Longan_nano::Leds Class Reference

Leds. More...

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

Detailed Description

Leds.

Author
Orso Eric
Version
2020-07-15


Class to control the LEDs on the Longan Nano board
Experiment with scoping of enum and typedef
Can do better...

Member Typedef Documentation

◆ Color

Color of the LEDs.

◆ Led_gpio

GPIO used by the LEDs.

◆ Led_pin

pins used by the LEDs

Member Enumeration Documentation

◆ _Color

Color of the LEDs.

Enumerator
BLACK 
RED 
GREEN 
BLUE 
WHITE 

◆ _Led_gpio

GPIO used by the LEDs.

Enumerator
RED_GPIO 
GREEN_GPIO 
BLUE_GPIO 

◆ _Led_pin

pins used by the LEDs

Enumerator
RED_PIN 
GREEN_PIN 
BLUE_PIN 

Constructor & Destructor Documentation

◆ Leds()

Longan_nano::Leds::Leds ( void  )

Default constructor.

◆ ~Leds()

Longan_nano::Leds::~Leds ( void  )

Default destructor.

Member Function Documentation

◆ clear()

static bool Longan_nano::Leds::clear ( Leds::Color  color)
inlinestatic

public static method clear |

Returns
bool | false = OK | true = ERR

initialize the longan nano GPIO LEDs

◆ init()

static bool Longan_nano::Leds::init ( void  )
inlinestatic

public static method init |

Returns
bool | false = OK | true = ERR

initialize the longan nano GPIO LEDs

Here is the caller graph for this function:

◆ set()

static bool Longan_nano::Leds::set ( Leds::Color  color)
inlinestatic

public static method set |

Returns
bool | false = OK | true = ERR

initialize the longan nano GPIO LEDs

Here is the caller graph for this function:

◆ set_color()

static bool Longan_nano::Leds::set_color ( Leds::Color  color)
inlinestatic

public static method set_color | Led_color

Parameters
color| Color | color of the LED
Returns
bool | false = OK | true = ERR

initialize the longan nano GPIO LEDs

Here is the caller graph for this function:

◆ toggle()

static bool Longan_nano::Leds::toggle ( Leds::Color  color)
inlinestatic

public static method toggle |

Returns
bool | false = OK | true = ERR

initialize the longan nano GPIO LEDs

Here is the caller graph for this function:

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