Use of the UART.
- main.c
#include BOARD_H
#define AHBHZ HW_DEVICE_HSIHZ // AHB frequency
#define APBHZ AHBHZ
#define UART usart2
#define UART_TX (porta,2)
int main ( )
{
hw( power, (UART_TX,port), on );
hw( configure, UART_TX,
function, (UART,tx), mode, digital_output );
mode, uart,
divider, AHBHZ/10000,
databits, 8,
parity, none,
stopbits, 1,
receiver, off,
transmitter, on,
run, yes );
for (;;) {
while (
hw(read,(UART,txe)) != 1 ) {}
hw( write, (UART,dr),
'.' );
}
}