Ares LoRa Firmware
Loading...
Searching...
No Matches
led.h File Reference

LED API. More...

#include <stdint.h>
Include dependency graph for led.h:

Go to the source code of this file.

Enumerations

enum  led_state {
  LED_STATE_OFF , LED_STATE_ON , LED_STATE_BLINK , LED_STATE_FADE ,
  LED_STATE_INVALID
}
enum  led { LED_0 , LED_1 , LED_INVALID }

Functions

int update_led_state (enum led led, uint8_t new_state)

Detailed Description

LED API.

Date
4/6/26
Author
Tom Schmitz <tschm.nosp@m.itz@.nosp@m.andre.nosp@m.w.cm.nosp@m.u.edu>

Enumeration Type Documentation

◆ led

enum led

LEDs that can be controlled.

Enumerator
LED_0 

LED 0.

LED_1 

LED 1.

LED_INVALID 

Last LED enumerator.

◆ led_state

enum led_state

Different states the LED can be in.

Enumerator
LED_STATE_OFF 

LED off.

LED_STATE_ON 

LED on.

LED_STATE_BLINK 

LED blinking.

LED_STATE_FADE 

LED Fading on and off.

LED_STATE_INVALID 

Invalid/end of enumeration.

Function Documentation

◆ update_led_state()

int update_led_state ( enum led led,
uint8_t new_state )

Update or retrieve the LED state.

Parameters
[in]ledThe LED to update the state for.
[in]new_stateThe new state of the LED. If invalid, retrieves the current state.
Returns
The current state of the LED if new_state is invalid.
0 if new state was set successfully.
-EAGAIN if state is unchanged from previous setting.
negative error code otherwise.