usart.h 828 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * File : usart.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-05-15 lgnq modified according bernard's implementaion.
  13. */
  14. #ifndef __USART_H__
  15. #define __USART_H__
  16. #include <rtthread.h>
  17. #include "chip_lpc43xx.h"
  18. #include "cmsis.h"
  19. /**
  20. * Enable/DISABLE Interrupt Controller
  21. */
  22. #define UART_ENABLE_IRQ(n) NVIC_EnableIRQ((n))
  23. #define UART_DISABLE_IRQ(n) NVIC_DisableIRQ((n))
  24. struct uart_device
  25. {
  26. LPC_USART_Type *uart_regs;
  27. /* irq number */
  28. IRQn_Type irq_num;
  29. };
  30. void rt_hw_serial_init(void);
  31. #endif