drv_uart.h 936 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023/06/25 flyingcys first version
  9. */
  10. #ifndef __DRV_USART_H__
  11. #define __DRV_USART_H__
  12. #include <rtthread.h>
  13. #include "rtdevice.h"
  14. #include <rthw.h>
  15. #define UART_REG_SHIFT 0x2 /* Register Shift*/
  16. #define UART_INPUT_CLK 25000000
  17. #define UART0_BASE 0x04140000
  18. #define UART1_BASE 0x04150000
  19. #define UART2_BASE 0x04160000
  20. #define UART3_BASE 0x04170000
  21. #define UART4_BASE 0x041C0000
  22. #define UART_IRQ_BASE (44)
  23. #define UART0_IRQ (UART_IRQ_BASE + 0)
  24. #define UART1_IRQ (UART_IRQ_BASE + 1)
  25. #define UART2_IRQ (UART_IRQ_BASE + 2)
  26. #define UART3_IRQ (UART_IRQ_BASE + 3)
  27. #define UART4_IRQ (UART_IRQ_BASE + 4)
  28. int rt_hw_uart_init(void);
  29. #endif /* __DRV_USART_H__ */