drv_usart.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2013-11-15 bright the first version
  9. */
  10. #ifndef __USART_H__
  11. #define __USART_H__
  12. #include <rthw.h>
  13. #include <rtthread.h>
  14. #include "cmsis.h"
  15. /* USART - Peripheral instance base addresses */
  16. /** Peripheral USART0 base address */
  17. #define USART0_BASE (0x40064000u)
  18. /** Peripheral USART0 base pointer */
  19. #define USART0 ((LPC_USART_T *)USART0_BASE)
  20. /** Peripheral USART1 base address */
  21. #define USART1_BASE (0x40068000u)
  22. /** Peripheral USART1 base pointer */
  23. #define USART1 ((LPC_USART_T *)USART1_BASE)
  24. /** Peripheral USART2 base address */
  25. #define USART2_BASE (0x4006C000u)
  26. /** Peripheral USART2 base pointer */
  27. #define USART2 ((LPC_USART_T *)USART2_BASE)
  28. /** Array initializer of USART peripheral base addresses */
  29. #define USART_BASE_ADDRS { USART0_BASE, USART1_BASE, USART2_BASE }
  30. /** Array initializer of USART peripheral base pointers */
  31. #define USART_BASE_PTRS { USART0, USART1, USART2 }
  32. /** Interrupt vectors for the USART peripheral type */
  33. #define USART_IRQS { USART0_IRQn, USART1_IRQn, USART2_IRQn }
  34. int rt_hw_usart_init(void);
  35. #endif