Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::core::components::display::Led< GpioPinImpl > Class Template Reference

LED control interface. More...

#include <led.hpp>

Collaboration diagram for sbl::core::components::display::Led< GpioPinImpl >:

Public Member Functions

 Led (bool active_high=true)
 Construct LED controller.
 
void on ()
 Turn LED on.
 
void off ()
 Turn LED off.
 
void toggle ()
 Toggle LED state.
 
void set (bool state)
 Set LED state.
 
bool isOn () const
 Get current LED state.
 
bool isOff () const
 Get current LED state.
 

Detailed Description

template<typename GpioPinImpl>
class sbl::core::components::display::Led< GpioPinImpl >

LED control interface.

Wraps GPIO pin operations with LED-specific semantics. Template-based design provides compile-time optimization.

Template Parameters
GpioPinImplGPIO pin implementation type

Definition at line 26 of file led.hpp.

Constructor & Destructor Documentation

◆ Led()

template<typename GpioPinImpl >
sbl::core::components::display::Led< GpioPinImpl >::Led ( bool  active_high = true)
inlineexplicit

Construct LED controller.

Parameters
active_hightrue if LED is on when pin is high

Definition at line 33 of file led.hpp.

References sbl::core::components::display::Led< GpioPinImpl >::off().

Here is the call graph for this function:

Member Function Documentation

◆ isOff()

template<typename GpioPinImpl >
bool sbl::core::components::display::Led< GpioPinImpl >::isOff ( ) const
inline

Get current LED state.

Returns
true if LED is off

Definition at line 90 of file led.hpp.

◆ isOn()

template<typename GpioPinImpl >
bool sbl::core::components::display::Led< GpioPinImpl >::isOn ( ) const
inline

Get current LED state.

Returns
true if LED is on

Definition at line 82 of file led.hpp.

◆ off()

template<typename GpioPinImpl >
void sbl::core::components::display::Led< GpioPinImpl >::off ( )
inline

Turn LED off.

Definition at line 50 of file led.hpp.

Referenced by sbl::core::components::display::Led< GpioPinImpl >::Led(), sbl::core::components::display::Led< GpioPinImpl >::set(), and sbl::core::components::display::Led< GpioPinImpl >::toggle().

Here is the caller graph for this function:

◆ on()

template<typename GpioPinImpl >
void sbl::core::components::display::Led< GpioPinImpl >::on ( )
inline

Turn LED on.

Definition at line 42 of file led.hpp.

Referenced by sbl::core::components::display::Led< GpioPinImpl >::set(), and sbl::core::components::display::Led< GpioPinImpl >::toggle().

Here is the caller graph for this function:

◆ set()

template<typename GpioPinImpl >
void sbl::core::components::display::Led< GpioPinImpl >::set ( bool  state)
inline

Set LED state.

Parameters
statetrue to turn on, false to turn off

Definition at line 70 of file led.hpp.

References sbl::core::components::display::Led< GpioPinImpl >::off(), and sbl::core::components::display::Led< GpioPinImpl >::on().

Here is the call graph for this function:

◆ toggle()

template<typename GpioPinImpl >
void sbl::core::components::display::Led< GpioPinImpl >::toggle ( )
inline

Toggle LED state.

Definition at line 58 of file led.hpp.

References sbl::core::components::display::Led< GpioPinImpl >::off(), and sbl::core::components::display::Led< GpioPinImpl >::on().

Here is the call graph for this function:

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