FSM thermostat
port_led.h
Go to the documentation of this file.
1 
7 #ifndef PORT_LED_H_
8 #define PORT_LED_H_
9 
10 /* Includes ------------------------------------------------------------------*/
11 /* Standard C includes */
12 #include <stdbool.h>
13 
14 /* HW dependent includes */
15 #include "port_system.h"
16 
17 /* Defines and macros --------------------------------------------------------*/
18 // HW Nucleo-STM32F446RE:
19 #define LED_HEAT_GPIO GPIOB
20 #define LED_HEAT_PIN 4
21 #define LED_COMFORT_GPIO GPIOB
22 #define LED_COMFORT_PIN 5
23 #define LED_ON_GPIO GPIOB
24 #define LED_ON_PIN 3
26 /* Typedefs --------------------------------------------------------------------*/
27 
30 typedef struct
31 {
32  GPIO_TypeDef *p_port;
33  uint8_t pin;
35 
36 /* Global variables -----------------------------------------------------------*/
39 extern port_led_hw_t led_on;
41 /* Function prototypes and explanations ---------------------------------------*/
47 void port_led_init(port_led_hw_t *p_led);
48 
56 
61 void port_led_on(port_led_hw_t *p_led);
62 
67 void port_led_off(port_led_hw_t *p_led);
68 
73 void port_led_toggle(port_led_hw_t *p_led);
74 
75 #endif // PORT_LED_H_
led_comfort_temperature
port_led_hw_t led_comfort_temperature
Definition: port_led.c:18
port_led_init
void port_led_init(port_led_hw_t *p_led)
Initializes the LED.
Definition: port_led.c:41
port_led_hw_t
Structure to define the HW dependencies of a LED.
Definition: port_led.h:30
port_led_off
void port_led_off(port_led_hw_t *p_led)
Turn off the LED.
Definition: port_led.c:31
led_on
port_led_hw_t led_on
Definition: port_led.c:19
port_led_hw_t::pin
uint8_t pin
Definition: port_led.h:33
port_led_hw_t::p_port
GPIO_TypeDef * p_port
Definition: port_led.h:32
port_system.h
Header for port_system.c file.
led_heater_active
port_led_hw_t led_heater_active
Definition: port_led.c:17
port_led_toggle
void port_led_toggle(port_led_hw_t *p_led)
Toggles the LED state.
Definition: port_led.c:36
port_led_on
void port_led_on(port_led_hw_t *p_led)
Turn on the LED.
Definition: port_led.c:26
port_led_get_status
bool port_led_get_status(port_led_hw_t *p_led)
Returns the current state of the LED.
Definition: port_led.c:21