-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperipherals.c
More file actions
42 lines (34 loc) · 784 Bytes
/
peripherals.c
File metadata and controls
42 lines (34 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "gpio.h"
#include "messages.h"
#include "printf.h"
#include "timer.h"
#include "uart.h"
#include "peripherals.h"
// FUNCTION: peripherals_init
// PARAMS: void
// Initializes all of the GPIOs and peripherals
void peripherals_init(void) {
gpio_set_output(ERROR_LED);
gpio_set_output(SUCCESS_LED);
}
// FUNCTION: error_led
// PARAMS: void
// Shines the error LED and will stay in an infinite loop until shut down
void error_led(void) {
gpio_write(ERROR_LED, 1);
draw_error();
while(1) {
}
}
// FUNCTION: success_led_on
// PARAMS: void
// Turns on the success LED
void success_led_on(void) {
gpio_write(SUCCESS_LED, 1);
}
// FUNCTION: success_led_off
// PARAMS: void
// Turns off the success LED
void success_led_off(void) {
gpio_write(SUCCESS_LED, 0);
}