SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::leds Class Reference

LED control library for the SatNOGS-COMMS board. More...

#include <leds.hpp>

Public Types

enum class  led : uint8_t { led0 , led1 }
 Enumerates the available LEDs on the SatNOGS-COMMS board. More...

Public Member Functions

 leds (bsp::gpio &led0, bsp::gpio &led1)
 Constructs an instance of the leds class.
void toggle (led x)
 Toggles the state of the specified LED.
void enable (led x, bool en=true)
 Enables or disables the specified led.
void disable (led x)
 Disables the specified led.
bool enabled (led x) const
 Checks if the specified led is currently enabled.

Detailed Description

LED control library for the SatNOGS-COMMS board.

This class allows controlling the LEDs on the SatNOGS-COMMS board using basic operations such as toggling, enabling, disabling, and checking their state.

Definition at line 38 of file leds.hpp.

Member Enumeration Documentation

◆ led

enum class satnogs::comms::lib::leds::led : uint8_t
strong

Enumerates the available LEDs on the SatNOGS-COMMS board.

Enumerator
led0 

Represents LED_0

led1 

Represents LED_1

Definition at line 44 of file leds.hpp.

Constructor & Destructor Documentation

◆ leds()

satnogs::comms::lib::leds::leds ( bsp::gpio & led0,
bsp::gpio & led1 )

Constructs an instance of the leds class.

Parameters
led0Reference to the bsp::gpio object controlling the LED_0 of the the SatNOGS-COMMS board
led1Reference to the bsp::gpio object controlling LED_1 of the the SatNOGS-COMMS board

Definition at line 34 of file leds.cpp.

Member Function Documentation

◆ disable()

void satnogs::comms::lib::leds::disable ( led x)

Disables the specified led.

This is a shorthand for calling enable(x, false) to explicitly disable a led

Parameters
xThe led to disable.

Definition at line 76 of file leds.cpp.

◆ enable()

void satnogs::comms::lib::leds::enable ( led x,
bool en = true )

Enables or disables the specified led.

Parameters
xThe led to modify.
enPassing true will set the led will set it to its active state, which can be high or low, based on the bsp::gpio object. Passing false will cause the opposite effect configuration. Default parameter is true.

Definition at line 62 of file leds.cpp.

◆ enabled()

bool satnogs::comms::lib::leds::enabled ( led x) const

Checks if the specified led is currently enabled.

Parameters
xThe led to check.
Returns
true if the led is set to its active state, false otherwise.

Definition at line 88 of file leds.cpp.

◆ toggle()

void satnogs::comms::lib::leds::toggle ( led x)

Toggles the state of the specified LED.

Change the state of a specific led to the opposite of its current state

Parameters
xThe LED to toggle.

Definition at line 47 of file leds.cpp.


The documentation for this class was generated from the following files:
  • libsatnogs-comms/include/satnogs-comms-lib/leds.hpp
  • libsatnogs-comms/src/leds.cpp