uart.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * UART Masks
  3. */
  4. #ifndef __BFIN_PERIPHERAL_UART__
  5. #define __BFIN_PERIPHERAL_UART__
  6. /* UARTx_LCR Masks */
  7. #define WLS 0x03 /* Word Length Select */
  8. #define WLS_5 0x00 /* 5 bit word */
  9. #define WLS_6 0x01 /* 6 bit word */
  10. #define WLS_7 0x02 /* 7 bit word */
  11. #define WLS_8 0x03 /* 8 bit word */
  12. #define STB 0x04 /* Stop Bits */
  13. #define PEN 0x08 /* Parity Enable */
  14. #define EPS 0x10 /* Even Parity Select */
  15. #define STP 0x20 /* Stick Parity */
  16. #define SB 0x40 /* Set Break */
  17. #define DLAB 0x80 /* Divisor Latch Access */
  18. #define DLAB_P 0x07
  19. #define SB_P 0x06
  20. #define STP_P 0x05
  21. #define EPS_P 0x04
  22. #define PEN_P 0x03
  23. #define STB_P 0x02
  24. #define WLS_P1 0x01
  25. #define WLS_P0 0x00
  26. /* UARTx_MCR Mask */
  27. #define XOFF 0x01 /* Transmitter off */
  28. #define MRTS 0x02 /* Manual Request to Send */
  29. #define RFIT 0x04 /* Receive FIFO IRQ Threshold */
  30. #define RFRT 0x08 /* Receive FIFO RTS Threshold */
  31. #define LOOP_ENA 0x10 /* Loopback Mode Enable */
  32. #define FCPOL 0x20 /* Flow Control Pin Polarity */
  33. #define ARTS 0x40 /* Auto RTS generation for RX handshake */
  34. #define ACTS 0x80 /* Auto CTS operation for TX handshake */
  35. #define XOFF_P 0
  36. #define MRTS_P 1
  37. #define RFIT_P 2
  38. #define RFRT_P 3
  39. #define LOOP_ENA_P 4
  40. #define FCPOL_P 5
  41. #define ARTS_P 6
  42. #define ACTS_P 7
  43. /* UARTx_LSR Masks */
  44. #define DR 0x01 /* Data Ready */
  45. #define OE 0x02 /* Overrun Error */
  46. #define PE 0x04 /* Parity Error */
  47. #define FE 0x08 /* Framing Error */
  48. #define BI 0x10 /* Break Interrupt */
  49. #define THRE 0x20 /* THR Empty */
  50. #define TEMT 0x40 /* TSR and UART_THR Empty */
  51. #define DR_P 0x00
  52. #define OE_P 0x01
  53. #define PE_P 0x02
  54. #define FE_P 0x03
  55. #define BI_P 0x04
  56. #define THRE_P 0x05
  57. #define TEMT_P 0x06
  58. /* UARTx_IER Masks */
  59. #define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
  60. #define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
  61. #define ELSI 0x04 /* Enable RX Status Interrupt */
  62. #define ERBFI_P 0x00
  63. #define ETBEI_P 0x01
  64. #define ELSI_P 0x02
  65. /* UARTx_IIR Masks */
  66. #define NINT 0x01 /* Pending Interrupt */
  67. #define STATUS 0x06 /* Highest Priority Pending Interrupt */
  68. #define NINT_P 0x00
  69. #define STATUS_P0 0x01
  70. #define STATUS_P1 0x02
  71. /* UARTx_GCTL Masks */
  72. #define UCEN 0x01 /* Enable UARTx Clocks */
  73. #define IREN 0x02 /* Enable IrDA Mode */
  74. #define TPOLC 0x04 /* IrDA TX Polarity Change */
  75. #define RPOLC 0x08 /* IrDA RX Polarity Change */
  76. #define FPE 0x10 /* Force Parity Error On Transmit */
  77. #define FFE 0x20 /* Force Framing Error On Transmit */
  78. #define UCEN_P 0x00
  79. #define IREN_P 0x01
  80. #define TPOLC_P 0x02
  81. #define RPOLC_P 0x03
  82. #define FPE_P 0x04
  83. #define FFE_P 0x05
  84. #endif