uart.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**********************************************************************
  2. ***********************************************************************
  3. * Software that is described herein is for illustrative purposes only
  4. * which provides customers with programming information regarding the
  5. * products. This software is supplied "AS IS" without any warranties.
  6. * NXP Semiconductors assumes no responsibility or liability for the
  7. * use of the software, conveys no license or title under any patent,
  8. * copyright, or mask work right to the product. NXP Semiconductors
  9. * reserves the right to make changes in the software without
  10. * notification. NXP Semiconductors also make no representation or
  11. * warranty that such application will be suitable for the specified
  12. * use without further testing or modification.
  13. * Permission to use, copy, modify, and distribute this software and its
  14. * documentation is hereby granted, under NXP Semiconductors�
  15. * relevant copyright in the software, without fee, provided that it
  16. * is used in conjunction with NXP Semiconductors microcontrollers. This
  17. * copyright, permission, and disclaimer notice must appear in all copies of
  18. * this code.
  19. **********************************************************************/
  20. #ifndef __lpc8xx_UART_H
  21. #define __lpc8xx_UART_H
  22. #define UART_EN (0x01<<0)
  23. #define DATA_LENG_7 (0x00<<2)
  24. #define DATA_LENG_8 (0x01<<2)
  25. #define DATA_LENG_9 (0x02<<2)
  26. #define PARITY_NONE (0x00<<4)
  27. #define PARITY_NC (0x01<<4)
  28. #define PARITY_EVEN (0x02<<4)
  29. #define PARITY_ODD (0x03<<4)
  30. #define STOP_BIT_1 (0x00<<6)
  31. #define STOP_BIT_2 (0x01<<6)
  32. #define MODE_32K (0x01<<7)
  33. #define EXT_CTS_EN (0x01<<9)
  34. #define INT_CTS_EN (0x01<<10)
  35. #define SYNC_EN (0x01<<11)
  36. #define CLK_POL (0x01<<12)
  37. #define SYNC_MS (0x01<<14)
  38. #define LOOPBACK (0x01<<15)
  39. // UART Control register
  40. #define TXBRK_EN (0x01<<1)
  41. #define ADDR_DET (0x01<<2)
  42. #define TXDIS (0x01<<6)
  43. #define CC (0x01<<8)
  44. #define CCCLR (0x01<<9)
  45. // UART status register
  46. #define RXRDY (0x01<<0)
  47. #define RXIDLE (0x01<<1)
  48. #define TXRDY (0x01<<2)
  49. #define TXIDLE (0x01<<3)
  50. #define CTS (0x01<<4)
  51. #define CTS_DELTA (0x01<<5)
  52. #define TXINT_DIS (0x01<<6)
  53. #define OVRN_ERR (0x01<<8)
  54. #define RXBRK (0x01<<10)
  55. #define DELTA_RXBRK (0x01<<11)
  56. #define START_DETECT (0x01<<12)
  57. #define FRM_ERR (0x01<<13)
  58. #define PAR_ERR (0x01<<14)
  59. #define RXNOISE (0x01<<15)
  60. #endif /* __lpc8xx_UART_H */