-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab7wrapper.c
More file actions
26 lines (24 loc) · 817 Bytes
/
Copy pathlab7wrapper.c
File metadata and controls
26 lines (24 loc) · 817 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
extern int lab7(void);
extern int pin_connect_block_setup_for_uart0(void);
extern int uart_init(void);
void serial_init(void)
{
/* 8-bit word length, 1 stop bit, no parity, */
/* Disable break control */
/* Enable divisor latch access */
*(volatile unsigned *)(0xE000C00C) = 131;
/* Set lower divisor latch for 9,600 baud */
*(volatile unsigned *)(0xE000C000) = 120;
/* Set upper divisor latch for 9,600 baud */
*(volatile unsigned *)(0xE000C004) = 0;
/* 8-bit word length, 1 stop bit, no parity, */
/* Disable break control */
/* Disable divisor latch access */
*(volatile unsigned *)(0xE000C00C) = 3;
}
int main()
{
pin_connect_block_setup_for_uart0();
uart_init();
lab7();
}