File indexing completed on 2025-05-11 08:23:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef _NS16550_P_H_
0029 #define _NS16550_P_H_
0030
0031 #ifndef ASM
0032 #include <libchip/serial.h>
0033 #endif
0034
0035 #ifdef __cplusplus
0036 extern "C" {
0037 #endif
0038
0039
0040
0041
0042
0043
0044 #define NS16550_STATIC static
0045
0046 #define NS16550_RECEIVE_BUFFER 0
0047 #define NS16550_TRANSMIT_BUFFER 0
0048 #define NS16550_DIVISOR_LATCH_L 0
0049 #define NS16550_INTERRUPT_ENABLE 1
0050 #define NS16550_DIVISOR_LATCH_M 1
0051 #define NS16550_INTERRUPT_ID 2
0052 #define NS16550_FIFO_CONTROL 2
0053 #define NS16550_LINE_CONTROL 3
0054 #define NS16550_MODEM_CONTROL 4
0055 #define NS16550_LINE_STATUS 5
0056 #define NS16550_MODEM_STATUS 6
0057 #define NS16550_SCRATCH_PAD 7
0058 #define NS16550_FRACTIONAL_DIVIDER 10
0059
0060
0061
0062
0063
0064 #define SP_INT_RX_ENABLE 0x01
0065 #define SP_INT_TX_ENABLE 0x02
0066 #define SP_INT_LS_ENABLE 0x04
0067 #define SP_INT_MS_ENABLE 0x08
0068
0069 #define NS16550_ENABLE_ALL_INTR (SP_INT_RX_ENABLE | SP_INT_TX_ENABLE)
0070 #define NS16550_DISABLE_ALL_INTR 0x00
0071 #define NS16550_ENABLE_ALL_INTR_EXCEPT_TX (SP_INT_RX_ENABLE)
0072
0073
0074
0075
0076
0077 #define SP_IID_0 0x01
0078 #define SP_IID_1 0x02
0079 #define SP_IID_2 0x04
0080 #define SP_IID_3 0x08
0081
0082
0083
0084
0085
0086 #define SP_FIFO_ENABLE 0x01
0087 #define SP_FIFO_RXRST 0x02
0088 #define SP_FIFO_TXRST 0x04
0089 #define SP_FIFO_DMA 0x08
0090 #define SP_FIFO_RXLEVEL 0xc0
0091
0092 #define SP_FIFO_SIZE 16
0093
0094
0095
0096
0097
0098 #define SP_LINE_SIZE 0x03
0099 #define SP_LINE_STOP 0x04
0100 #define SP_LINE_PAR 0x08
0101 #define SP_LINE_ODD 0x10
0102 #define SP_LINE_STICK 0x20
0103 #define SP_LINE_BREAK 0x40
0104 #define SP_LINE_DLAB 0x80
0105
0106
0107
0108
0109
0110 #define FIVE_BITS 0x0
0111 #define SIX_BITS 0x1
0112 #define SEVEN_BITS 0x2
0113 #define EIGHT_BITS 0x3
0114
0115
0116
0117
0118
0119 #define SP_MODEM_DTR 0x01
0120 #define SP_MODEM_RTS 0x02
0121 #define SP_MODEM_IRQ 0x08
0122 #define SP_MODEM_LOOP 0x10
0123 #define SP_MODEM_DIV4 0x80
0124
0125
0126
0127
0128
0129 #define SP_LSR_RDY 0x01
0130 #define SP_LSR_EOVRUN 0x02
0131 #define SP_LSR_EPAR 0x04
0132 #define SP_LSR_EFRAME 0x08
0133 #define SP_LSR_BREAK 0x10
0134 #define SP_LSR_THOLD 0x20
0135 #define SP_LSR_TX 0x40
0136 #define SP_LSR_EFIFO 0x80
0137
0138 #ifdef __cplusplus
0139 }
0140 #endif
0141
0142 #endif