Files
gps/soc/software/hello_uart/main.c
T
2026-07-12 11:01:51 +03:00

27 lines
732 B
C

#include <stdint.h>
#include <stdio.h>
#include "bsp/soc.h"
#include "bsp/uart.h"
int main(void)
{
uintptr_t dtim_base = BSP_DTIM_BASE;
uintptr_t dtim_size = BSP_DTIM_SIZE;
uintptr_t dtim_end = dtim_base + dtim_size - 1;
printf("\nRocket Chip FPGA hello printf\n");
printf("DTIM: 0x%08lx..0x%08lx (%lu bytes)\n",
(unsigned long)dtim_base,
(unsigned long)dtim_end,
(unsigned long)dtim_size);
printf("UART clock Hz: 0x%08lx\n", (unsigned long)bsp_uart_clock_hz());
printf("UART baud: 0x%08lx\n", (unsigned long)bsp_uart_baudrate());
printf("UART divisor: 0x%08lx\n", (unsigned long)bsp_uart_divisor());
printf("dow jones\n");
fflush(stdout);
bsp_uart_wait_tx_idle();
return 0;
}