1 /*
2  * Copyright ( C) 2015-2020 Alibaba Group Holding Limited
3  */
4 
5 #ifndef _IO_UART_H_
6 #define _IO_UART_H_
7 
8 #define IOC_UART_BASE 'U'
9 #define IOC_UART_SET_CFLAG IOC_UART_BASE + 1
10 #define IOC_UART_GET_CFLAG IOC_UART_BASE + 2
11 #define IOC_UART_DMA_CTL IOC_UART_BASE + 3
12 #define IOC_UART_TRX_CTL IOC_UART_BASE + 4 // disable Tx or Rx
13 #define IOC_UART_POLL_TEST IOC_UART_BASE + 5 // for test purpose
14 
15 /* argument definition */
16 
17 /* C_ Cflag bit meaning */
18 #define CBAUD  0x0010017
19 #define B0    0x0000000       /* ignore */
20 #define B50   0x0000001
21 #define B75   0x0000002
22 #define B110  0x0000003
23 #define B134  0x0000004
24 #define B150  0x0000005
25 #define B200  0x0000006
26 #define B300  0x0000007
27 #define B600  0x0000010
28 #define B1200 0x0000011
29 #define B1800 0x0000012
30 #define B2400 0x0000013
31 #define B4800 0x0000014
32 #define B9600 0x0000015
33 #define B19200    0x0000016
34 #define B38400    0x0000017
35 #define EXTA 0xB19200
36 #define EXTB 0xB38400
37 
38 #define CBAUDEX 0x0010000
39 #define B57600 0x0010001
40 #define B115200 0x0010002
41 #define B230400 0x0010003
42 #define B460800 0x0010004
43 #define B500000 0x0010005
44 #define B576000 0x0010006
45 #define B921600 0x0010007
46 #define B1000000 0x0010010
47 #define B1152000 0x0010011
48 #define B1500000 0x0010012
49 #define B2000000 0x0010013
50 #define B2500000 0x0010014
51 #define B3000000 0x0010015
52 #define B3500000 0x0010016
53 #define B4000000 0x0010017
54 
55 #define CSIZE  0x0000060
56 #define CS5  0x0000000
57 #define CS6  0x0000020
58 #define CS7  0x0000040
59 #define CS8  0x0000060
60 
61 #define CSTOPB 0x0000100
62 #define CREAD  0x0000200
63 #define PARENB 0x0000400
64 #define PARODD 0x0001000
65 
66 #define CRTS_CTS 0x30000000 /* flow Control */
67 #define CRTS 0x10000000 /* flow Control */
68 #define CCTS 0x20000000 /* flow Control */
69 
70 int vfs_uart_drv_init (void);
71 
72 #endif //_IO_UART_H_
73