| 1 |
/* |
| 2 |
* Copyright (C) 2023 Espressif Systems (Shanghai) CO LTD |
| 3 |
* SPDX-License-Identifier: BSD-2-Clause |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef SOC_UART_H |
| 7 |
#define SOC_UART_H |
| 8 |
|
| 9 |
#include <soc/cpu.h> |
| 10 |
#include <register_access.h> |
| 11 |
|
| 12 |
#define UART0_BAUDRATE 115200 |
| 13 |
|
| 14 |
#define UART0_TX_ADDR 0x60000000 |
| 15 |
#define UART0_BASE 0x60000000 |
| 16 |
#define UART0_CLKDIV_REG (UART0_BASE + 0x14) |
| 17 |
#define UART0_STATUS (UART0_BASE + 0x1c) |
| 18 |
#define UART0_CLKDIV_VAL (CPU_FREQUENCY_HZ / UART0_BAUDRATE ) |
| 19 |
#define UART0_TXFIFO_CNT (((READ_REGISTER(UART0_STATUS)) >> 16) & 0x3ff) |
| 20 |
|
| 21 |
|
| 22 |
void board_uart_write_char(char c); |
| 23 |
|
| 24 |
#endif // SOC_UART_H |