FSM thermostat
port_led.h File Reference

Header file for the LED port layer. More...

#include <stdbool.h>
#include "port_system.h"

Go to the source code of this file.

Data Structures

struct  port_led_hw_t
 Structure to define the HW dependencies of a LED. More...
 

Macros

#define LED_HEAT_GPIO   GPIOB
 
#define LED_HEAT_PIN   4
 
#define LED_COMFORT_GPIO   GPIOB
 
#define LED_COMFORT_PIN   5
 
#define LED_ON_GPIO   GPIOB
 
#define LED_ON_PIN   3
 

Functions

void port_led_init (port_led_hw_t *p_led)
 Initializes the LED. More...
 
bool port_led_get_status (port_led_hw_t *p_led)
 Returns the current state of the LED. More...
 
void port_led_on (port_led_hw_t *p_led)
 Turn on the LED. More...
 
void port_led_off (port_led_hw_t *p_led)
 Turn off the LED. More...
 
void port_led_toggle (port_led_hw_t *p_led)
 Toggles the LED state. More...
 

Variables

port_led_hw_t led_heater_active
 
port_led_hw_t led_comfort_temperature
 
port_led_hw_t led_on
 

Detailed Description

Header file for the LED port layer.

Author
Josué Pagán (j.pag.nosp@m.an@u.nosp@m.pm.es)
Date
01-01-2024

Definition in file port_led.h.

Macro Definition Documentation

◆ LED_COMFORT_GPIO

#define LED_COMFORT_GPIO   GPIOB

GPIO port of the deactivation LED

Definition at line 21 of file port_led.h.

◆ LED_COMFORT_PIN

#define LED_COMFORT_PIN   5

GPIO pin of the deactivation LED

Definition at line 22 of file port_led.h.

◆ LED_HEAT_GPIO

#define LED_HEAT_GPIO   GPIOB

GPIO port of the heating LED

Definition at line 19 of file port_led.h.

◆ LED_HEAT_PIN

#define LED_HEAT_PIN   4

GPIO pin of the heating LED

Definition at line 20 of file port_led.h.

◆ LED_ON_GPIO

#define LED_ON_GPIO   GPIOB

GPIO port of the general purpose LED

Definition at line 23 of file port_led.h.

◆ LED_ON_PIN

#define LED_ON_PIN   3

GPIO pin of the general purpose LED

Definition at line 24 of file port_led.h.

Function Documentation

◆ port_led_get_status()

bool port_led_get_status ( port_led_hw_t p_led)

Returns the current state of the LED.

Returns
true if the LED is on
false if the LED is off

Definition at line 21 of file port_led.c.

◆ port_led_init()

void port_led_init ( port_led_hw_t p_led)

Initializes the LED.

Parameters
p_ledPointer to the LED structure.

Definition at line 41 of file port_led.c.

◆ port_led_off()

void port_led_off ( port_led_hw_t p_led)

Turn off the LED.

Definition at line 31 of file port_led.c.

◆ port_led_on()

void port_led_on ( port_led_hw_t p_led)

Turn on the LED.

Definition at line 26 of file port_led.c.

◆ port_led_toggle()

void port_led_toggle ( port_led_hw_t p_led)

Toggles the LED state.

Definition at line 36 of file port_led.c.

Variable Documentation

◆ led_comfort_temperature

port_led_hw_t led_comfort_temperature

Cooling LED of the thermostat.

Definition at line 18 of file port_led.c.

◆ led_heater_active

port_led_hw_t led_heater_active

Heating LED of the thermostat.

Definition at line 17 of file port_led.c.

◆ led_on

port_led_hw_t led_on

General purpose LED.

Definition at line 19 of file port_led.c.