Debian Codegraph @

libgloss/xtensa/boards/esp32s3/board.c

raw
1 /*
2 * Copyright (C) 2023 Espressif Systems (Shanghai) CO LTD
3 * SPDX-License-Identifier: BSD-2-Clause
4 */
5
6 #include <stdint.h>
7 #include <soc/uart.h>
8
9 void board_init(void)
10 {
11 WRITE_REGISTER(UART0_CLKDIV_REG, UART0_CLKDIV_VAL);
12 }
13
14 void board_uart_write_char(char c)
15 {
16 /* wait until txfifo_cnt == 0 */
17 while (UART0_TXFIFO_CNT) {
18 ;
19 }
20 if (c == '\n') {
21 WRITE_REGISTER(UART0_TX_ADDR, '\r');
22 }
23 WRITE_REGISTER(UART0_TX_ADDR, c);
24 }