SLS AVR Lib 0.1a
 
Loading...
Searching...
No Matches
status_led.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------------+
2// This file is part of SLS AVR Library
3// https://github.com/SimonLitt/sls-avr-lib
4// ---------------------------------------------------------------------------+
5// Copyright (C) 2025 Simon Litt <simon@1itt.net> https://coding.1itt.net,
6// https://github.com/SimonLitt
7//
8// This program is free software: you can redistribute it and/or modify it
9// under the terms of the GNU General Public License as published by the Free
10// Software Foundation, version 3.
11//
12// This program is distributed in the hope that it will be useful, but WITHOUT
13// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15// more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this program. If not, see <https://www.gnu.org/licenses/>.
19// ---------------------------------------------------------------------------+
52#ifndef SLS_AVR_STATUS_LED_H_
53#define SLS_AVR_STATUS_LED_H_
54
55#include <sls-avr/avr.h>
56
57#define LED_ON PIN_ON
58#define LED_OFF PIN_OFF
59#define LED_SWITCH PIN_SWITCH
60
61void init_status_led(void);
62void status_led_ready(void);
63#define status_led_clear status_led_ready
64
65#if (defined LED_STAT_PORT) && (defined LED_STAT_PIN)
66# define led_stat_switch() LED_SWITCH(LED_STAT_PORT, LED_STAT_PIN)
67# define led_stat_on() LED_ON(LED_STAT_PORT, LED_STAT_PIN)
68# define led_stat_off() LED_OFF(LED_STAT_PORT, LED_STAT_PIN)
69#endif
70
71#if (defined LED_INF_PORT) && (defined LED_INF_PIN)
72# define led_inf_switch() LED_SWITCH(LED_INF_PORT, LED_INF_PIN)
73# define led_inf_on() LED_ON(LED_INF_PORT, LED_INF_PIN)
74# define led_inf_off() LED_OFF(LED_INF_PORT, LED_INF_PIN)
75#endif
76
77#if (defined LED_ERR_PORT) && (defined LED_ERR_PIN)
78# define led_err_switch() LED_SWITCH(LED_ERR_PORT, LED_ERR_PIN)
79# define led_err_on() LED_ON(LED_ERR_PORT, LED_ERR_PIN)
80# define led_err_off() LED_OFF(LED_ERR_PORT, LED_ERR_PIN)
81#endif
82
83#endif /* SLS_AVR_STATUS_LED_H_ */
AVR lib.
void init_status_led(void)
Initializing ports for indicator LEDs and turning off all but the error LED one.
void status_led_ready(void)
Switching off additional indicators and turning on the main one.