UoS³ Flight Computer Firmware
 All Data Structures Files Functions Groups Pages
demo_uart.c
1 /* firmware.h contains all relevant headers */
2 #include "../firmware.h"
3 
4 int main(void)
5 {
6  Board_init();
7  WDT_kick();
8 
9  LED_on(LED_B);
10 
11  UART_init(UART_CAMERA, 9600);
12  UART_init(UART_GNSS, 9600);
13  UART_init(UART_EPS, 9600);
14 
15  while(1)
16  {
17  LED_off(LED_B);
18 
19  UART_putc(UART_CAMERA, 'U');
20  UART_putc(UART_GNSS, 'U');
21  UART_putc(UART_EPS, 'U');
22 
23  /* Off period */
24  Delay_ms(750);
25  WDT_kick();
26 
27  LED_on(LED_B);
28 
29  UART_puts(UART_CAMERA, "\r\nCamera\r\n");
30  UART_puts(UART_GNSS, "\r\nGNSS\r\n");
31  UART_puts(UART_EPS, "\r\nEPS\r\n");
32 
33  /* On period */
34  Delay_ms(250);
35  WDT_kick();
36  }
37 }
void Delay_ms(uint32_t milliseconds)
Definition: delay.c:19
void UART_init(uint8_t uart_num, uint32_t baudrate)
Definition: uart.c:78
void LED_off(uint8_t led_num)
Definition: led.c:20
int main(void)
Runs all module tests.
Definition: test.c:19
void UART_puts(uint8_t uart_num, char *str)
Definition: uart.c:129
void Board_init(void)
Definition: board.c:13
void WDT_kick(void)
Definition: wdt.c:19
void LED_on(uint8_t led_num)
Definition: led.c:15
void UART_putc(uint8_t uart_num, char c)
Definition: uart.c:121