nrfcxx  0.1.0
C++-17 Framework for Nordic nRF5 Devices
Public Member Functions
nrfcxx::led::generic_led< active_low > Class Template Reference

A class used to manage LEDs. More...

#include <nrfcxx/led.hpp>

Inheritance diagram for nrfcxx::led::generic_led< active_low >:
nrfcxx::led::led_type

Public Member Functions

 generic_led (gpio::generic_pin &pin)
 Create an LED instance that is bound to a generic GPIO pin. More...
 
- Public Member Functions inherited from nrfcxx::led::led_type
 led_type (const led_type &)=delete
 
led_typeoperator= (const led_type &)=delete
 
 led_type (const led_type &&)=delete
 
led_typeoperator= (led_type &&)=delete
 
void enable (void)
 Set the GPIO associated with the LED to enable the LED. More...
 
void disable (void)
 Disable the nrf5::GPIO associated with the LED. More...
 
void set (int v)
 Set the LED to a specific state. More...
 
virtual void toggle (void)
 Toggle the LED state. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from nrfcxx::led::led_type
static size_t count (void)
 Get the number of LEDs supported by the target board.
 
static led_typelookup (unsigned int i)
 Return a reference to an LED identified by ordinal position. More...
 
- Static Public Attributes inherited from nrfcxx::led::led_type
static led_type no_led
 

Detailed Description

template<bool active_low = true>
class nrfcxx::led::generic_led< active_low >

A class used to manage LEDs.

This implements the functions of led_type using a gpio::generic_pin.

Template Parameters
active_lowa bool value indicating whether the LED is lit when the signal is low (true) or when the signal is high (false). Most Nordic development boards use active-low LEDs so the default supports them.

Constructor & Destructor Documentation

◆ generic_led()

template<bool active_low = true>
nrfcxx::led::generic_led< active_low >::generic_led ( gpio::generic_pin pin)
inlineexplicit

Create an LED instance that is bound to a generic GPIO pin.

Parameters
pinthe GPIO pin that controls the LED. A reference to this is retained by the generic_led instance.

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