FSM thermostat
port_led.c File Reference

Port layer for a LED. More...

#include <stdio.h>
#include <math.h>
#include "stm32f4xx.h"
#include "port_led.h"
#include "port_system.h"

Go to the source code of this file.

Functions

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...
 
void port_led_init (port_led_hw_t *p_led)
 Initializes the LED. More...
 

Variables

port_led_hw_t led_heater_active = {.p_port = LED_HEAT_GPIO, .pin = LED_HEAT_PIN}
 
port_led_hw_t led_comfort_temperature = {.p_port = LED_COMFORT_GPIO, .pin = LED_COMFORT_PIN}
 
port_led_hw_t led_on = {.p_port = LED_ON_GPIO, .pin = LED_ON_PIN}
 

Detailed Description

Port layer for a LED.

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

Definition in file port_led.c.

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 = {.p_port = LED_COMFORT_GPIO, .pin = LED_COMFORT_PIN}

Cooling LED of the thermostat.

Definition at line 18 of file port_led.c.

◆ led_heater_active

port_led_hw_t led_heater_active = {.p_port = LED_HEAT_GPIO, .pin = LED_HEAT_PIN}

Heating LED of the thermostat.

Definition at line 17 of file port_led.c.

◆ led_on

port_led_hw_t led_on = {.p_port = LED_ON_GPIO, .pin = LED_ON_PIN}

General purpose LED.

Definition at line 19 of file port_led.c.