cc26xx_cc13xx_uart.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Leon George
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
18 #ifndef CC26XX_CC13XX_UART_H
19 #define CC26XX_CC13XX_UART_H
20 
21 #include "cc26xx_cc13xx.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 typedef struct {
31  reg32_t DR;
32  union {
33  reg32_t RSR;
34  reg32_t ECR;
35  };
36  reg32_t __reserved1[4];
37  reg32_t FR;
38  reg32_t __reserved2[2];
39  reg32_t IBRD;
40  reg32_t FBRD;
41  reg32_t LCRH;
42  reg32_t CTL;
43  reg32_t IFLS;
44  reg32_t IMSC;
45  reg32_t RIS;
46  reg32_t MIS;
47  reg32_t ICR;
48  reg32_t DMACTL;
49 } uart_regs_t;
50 
55 #define UART_DR_DATA_mask 0xFF
56 #define UART_DR_FE 0x100
57 #define UART_DR_PE 0x200
58 #define UART_DR_BE 0x400
59 #define UART_DR_OE 0x800
60 
61 #define UART_ECR_FE 0x1
62 #define UART_ECR_PE 0x2
63 #define UART_ECR_BE 0x4
64 #define UART_ECR_OE 0x8
65 
66 #define UART_FR_CTS 0x1
67 #define UART_FR_BUSY 0x4
68 #define UART_FR_RXFE 0x10
69 #define UART_FR_TXFF 0x20
70 #define UART_FR_RXFF 0x40
71 #define UART_FR_TXFE 0x80
72 
73 #define UART_LCRH_PEN 0x2
74 #define UART_LCRH_EPS 0x4
75 #define UART_LCRH_STP2 0x8
76 #define UART_LCRH_FEN 0x10
77 #define UART_LCRH_WLEN_mask 0x60
78 #define UART_LCRH_WLEN_5 0x0
79 #define UART_LCRH_WLEN_6 0x20
80 #define UART_LCRH_WLEN_7 0x40
81 #define UART_LCRH_WLEN_8 0x60
82 #define UART_LCRH_SPS 0x80
83 
84 #define UART_CTL_UARTEN 0x1
85 #define UART_CTL_LBE 0x80
86 #define UART_CTL_TXE 0x100
87 #define UART_CTL_RXE 0x200
88 #define UART_CTL_RTS 0x800
89 #define UART_CTL_RTSEN 0x4000
90 #define UART_CTL_CTSEN 0x8000
91 
92 #define UART_MIS_CTSMMIS 0x1
93 #define UART_MIS_RXMIS 0x10
94 #define UART_MIS_TXMIS 0x20
95 #define UART_MIS_RTMIS 0x40
96 #define UART_MIS_FEMIS 0x80
97 #define UART_MIS_PEMIS 0x100
98 #define UART_MIS_BEMIS 0x200
99 #define UART_MIS_OEMIS 0x400
100 
101 #define UART_IMSC_CTSMIM 0x2
102 #define UART_IMSC_RXIM 0x10
103 #define UART_IMSC_TXIM 0x20
104 #define UART_IMSC_RTIM 0x40
105 #define UART_IMSC_FEIM 0x80
106 #define UART_IMSC_PEIM 0x100
107 #define UART_IMSC_BEIM 0x200
108 #define UART_IMSC_OEIM 0x400
109 
110 #define UART_IFLS_TXSEL_1_8 0x0
111 #define UART_IFLS_TXSEL_2_8 0x1
112 #define UART_IFLS_TXSEL_4_8 0x2
113 #define UART_IFLS_TXSEL_6_8 0x3
114 #define UART_IFLS_TXSEL_7_8 0x4
115 
116 #define UART_IFLS_RXSEL_1_8 0x0
117 #define UART_IFLS_RXSEL_2_8 0x8
118 #define UART_IFLS_RXSEL_4_8 0x10
119 #define UART_IFLS_RXSEL_6_8 0x18
120 #define UART_IFLS_RXSEL_7_8 0x20
121 
127 #define UART0_BASE (PERIPH_BASE + 0x1000)
128 #define UART1_BASE (PERIPH_BASE + 0xB000)
134 #define UART0 ((uart_regs_t *) (UART0_BASE))
135 
138 #define UART1 ((uart_regs_t *) (UART1_BASE))
139 
140 #ifdef __cplusplus
141 } /* end extern "C" */
142 #endif
143 
144 #endif /* CC26XX_CC13XX_UART_H */
145 
uart_regs_t::MIS
reg32_t MIS
Masked interrupt status.
Definition: cc26xx_cc13xx_uart.h:46
uart_regs_t
UART component registers.
Definition: cc26xx_cc13xx_uart.h:30
uart_regs_t::ICR
reg32_t ICR
Interrupt clear.
Definition: cc26xx_cc13xx_uart.h:47
uart_regs_t::FR
reg32_t FR
flag
Definition: cc26xx_cc13xx_uart.h:37
uart_regs_t::DMACTL
reg32_t DMACTL
MMA control.
Definition: cc26xx_cc13xx_uart.h:48
uart_regs_t::DR
reg32_t DR
Data.
Definition: cc26xx_cc13xx_uart.h:31
uart_regs_t::IFLS
reg32_t IFLS
Interrupt fifo level select.
Definition: cc26xx_cc13xx_uart.h:43
uart_regs_t::RSR
reg32_t RSR
Status.
Definition: cc26xx_cc13xx_uart.h:33
uart_regs_t::FBRD
reg32_t FBRD
Fractional baud-rate divisor.
Definition: cc26xx_cc13xx_uart.h:40
uart_regs_t::RIS
reg32_t RIS
Raw interrupt status.
Definition: cc26xx_cc13xx_uart.h:45
cc26xx_cc13xx.h
CC26xx, CC13xx definitions.
uart_regs_t::IBRD
reg32_t IBRD
Integer baud-rate divisor.
Definition: cc26xx_cc13xx_uart.h:39
uart_regs_t::ECR
reg32_t ECR
Error clear.
Definition: cc26xx_cc13xx_uart.h:34
uart_regs_t::IMSC
reg32_t IMSC
Interrupt mask set/clear.
Definition: cc26xx_cc13xx_uart.h:44
uart_regs_t::LCRH
reg32_t LCRH
Line control.
Definition: cc26xx_cc13xx_uart.h:41
uart_regs_t::CTL
reg32_t CTL
Control.
Definition: cc26xx_cc13xx_uart.h:42