diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-08-24 23:42:32 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-08-24 23:42:32 +0200 |
| commit | bc90dfb83866078bce80034d06607b0094aa63e4 (patch) | |
| tree | a66840c28f58720944cc711a82d426c9afe2490b /trafficlight.h | |
| parent | 9bebf5f393bbfd51489b4c4e65a066e47e623f1e (diff) | |
| download | Traffic-light-bc90dfb83866078bce80034d06607b0094aa63e4.tar.xz Traffic-light-bc90dfb83866078bce80034d06607b0094aa63e4.zip | |
Added the functionality of timers And finished the project
Diffstat (limited to 'trafficlight.h')
| -rw-r--r-- | trafficlight.h | 12 |
1 files changed, 12 insertions, 0 deletions
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); |
