UDI/Drivers - Adding 16550 UART driver
[tpg/acess2.git] / UDI / drivers / uart_16c550 / uart16c550_pio.h
1 #define PIO_op_RI(op, reg, sz, val)     {UDI_PIO_##op+UDI_PIO_DIRECT+UDI_PIO_##reg, UDI_PIO_##sz##BYTE, val}
2 #define PIO_MOV_RI1(reg, val)   PIO_op_RI(LOAD_IMM, reg, 2, val)
3 #define PIO_OUT_RI1(reg, ofs)   PIO_op_RI(OUT, reg, 1, ofs)
4 #define PIO_IN_RI1(reg, ofs)    PIO_op_RI(IN, reg, 1, ofs)
5
6 //
7 // Reset
8 // 
9 udi_pio_trans_t uart_pio_reset[] = {
10         {UDI_PIO_END, UDI_PIO_2BYTE, 0}
11 };
12 //
13 // Transmit
14 //
15 udi_pio_trans_t uart_pio_tx[] = {
16         {UDI_PIO_END, UDI_PIO_2BYTE, 0}
17 };
18 //
19 // Recieve (interrupt)
20 //
21 udi_pio_trans_t uart_pio_rx[] = {
22         {UDI_PIO_END, UDI_PIO_2BYTE, 0}
23 };
24
25 #define ARRAY_SIZEOF(arr)       (sizeof(arr)/sizeof(arr[0]))
26
27 struct {
28         udi_pio_trans_t *trans_list;
29         udi_ubit16_t    list_length;
30         udi_ubit16_t    pio_attributes;
31 } uart_pio_ops[] = {
32         [PIO_RESET]  = {uart_pio_reset, ARRAY_SIZEOF(uart_pio_reset), 0},
33         [PIO_TX]     = {uart_pio_tx, ARRAY_SIZEOF(uart_pio_tx), 0},
34         [PIO_RX]     = {uart_pio_rx, ARRAY_SIZEOF(uart_pio_rx), 0},
35 };
36 //const int UART_NUM_PIO_OPS = ARRAY_SIZEOF(uart_pio_ops);
37

UCC git Repository :: git.ucc.asn.au