Vikas Manocha | 5dba05e | 2016-02-11 15:47:19 -0800 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2016 |
| 3 | * Vikas Manocha, <vikas.manocha@st.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef _SERIAL_STM32_X7_ |
| 9 | #define _SERIAL_STM32_X7_ |
| 10 | |
| 11 | struct stm32_usart { |
| 12 | u32 cr1; |
| 13 | u32 cr2; |
| 14 | u32 cr3; |
| 15 | u32 brr; |
| 16 | u32 gtpr; |
| 17 | u32 rtor; |
| 18 | u32 rqr; |
| 19 | u32 sr; |
| 20 | u32 icr; |
| 21 | u32 rd_dr; |
| 22 | u32 tx_dr; |
| 23 | }; |
| 24 | |
| 25 | |
Patrice Chotard | 3149632 | 2017-06-08 09:26:55 +0200 | [diff] [blame] | 26 | #define USART_CR1_OVER8 (1 << 15) |
Vikas Manocha | 5dba05e | 2016-02-11 15:47:19 -0800 | [diff] [blame] | 27 | #define USART_CR1_TE (1 << 3) |
Patrice Chotard | 3149632 | 2017-06-08 09:26:55 +0200 | [diff] [blame] | 28 | #define USART_CR1_RE (1 << 2) |
Vikas Manocha | 5dba05e | 2016-02-11 15:47:19 -0800 | [diff] [blame] | 29 | #define USART_CR1_UE (1 << 0) |
| 30 | |
Vikas Manocha | 59535d5 | 2017-05-28 12:55:12 -0700 | [diff] [blame] | 31 | #define USART_CR3_OVRDIS (1 << 12) |
| 32 | |
Vikas Manocha | 5dba05e | 2016-02-11 15:47:19 -0800 | [diff] [blame] | 33 | #define USART_SR_FLAG_RXNE (1 << 5) |
| 34 | #define USART_SR_FLAG_TXE (1 << 7) |
| 35 | |
| 36 | #define USART_BRR_F_MASK 0xFF |
| 37 | #define USART_BRR_M_SHIFT 4 |
| 38 | #define USART_BRR_M_MASK 0xFFF0 |
| 39 | |
| 40 | #endif |