STM32 Traffic Control
Loading...
Searching...
No Matches
controller.h
Go to the documentation of this file.
1
7
8#ifndef CONTROLLER_H_
9#define CONTROLLER_H_
10
11#include <stdio.h>
12#include <stdint.h>
13#include <stdbool.h>
14#include "stm32f446xx.h"
15
17#define BUTTON1 (1U<<10)
18#define BUTTON2 (1U<<11)
19#define BUTTON3 (1U<<12)
20#define BUTTON4 (1U<<13)
21
23#define BUTTONS 4
24
26#define DEBOUNCE_TIME 100
27
29#define MAX_WAITING_PAIR 2
30
31// Function Prototypes
34void changeLight(uint32_t lightA, uint32_t lightB);
36
37#endif /* CONTROLLER_H_ */
void SysTick_CheckFirstPressTimeout(void)
Check for first button press timeout and process queued requests.
Definition controller.c:210
void SysTick_handleYellowTransitionTimeout(void)
Handle expiration of the YELLOW light phase for a traffic light pair.
Definition controller.c:86
void SysTick_handleGreenPhaseTimeout(void)
Monitor and handle expiration of the active GREEN light phase.
Definition controller.c:52
void changeLight(uint32_t lightA, uint32_t lightB)
Switch the active traffic light pair.
Definition controller.c:157