From bc90dfb83866078bce80034d06607b0094aa63e4 Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Wed, 24 Aug 2022 23:42:32 +0200 Subject: Added the functionality of timers And finished the project --- trafficlight.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'trafficlight.h') diff --git a/trafficlight.h b/trafficlight.h index efc2306..f1f94a9 100644 --- a/trafficlight.h +++ b/trafficlight.h @@ -20,9 +20,20 @@ typedef struct Traffic{ uint8_t green; } Traffic; +typedef struct Bcd{ + uint32_t port; + uint8_t A; + uint8_t B; + uint8_t C; + uint8_t D; +} Bcd; + extern Traffic tf1; extern Traffic tf2; extern Traffic tf_ped; +extern Bcd bcd1; +extern Bcd bcd2; +extern Bcd bcd_ped; extern bool switch_pressed; extern uint32_t period_1; extern uint32_t period_2; @@ -33,4 +44,5 @@ void Traffic_Handler(Traffic *tf, uint32_t timer); void set_tf_color(Traffic tf, uint8_t color); void PortInit(uint32_t port, uint32_t clk, uint32_t input, uint32_t output); void TimerInit(uint32_t timer, void(*timer_handler)(), uint32_t clk, uint32_t delay); +void BcdWrite(Bcd bcd, uint32_t timer, bool ped); -- cgit v1.2.3