blob: 4c2a09d9f1aae9dda3445a824290bb6064eb3f41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#pragma once
#include <mmio/mmio.h>
struct STM32_UART_reg_v1_t {
volatile uint32_t SR;
volatile uint32_t DR;
volatile uint32_t BRR;
volatile uint32_t CR1;
volatile uint32_t CR2;
volatile uint32_t CR3;
volatile uint32_t GTPR;
};
struct STM32_UART_reg_v2_t {
volatile uint32_t CR1;
volatile uint32_t CR2;
volatile uint32_t CR3;
volatile uint32_t BRR;
volatile uint32_t GTPR;
volatile uint32_t RTOR;
volatile uint32_t RQR;
volatile uint32_t ISR;
volatile uint32_t ICR;
volatile uint32_t RDR;
volatile uint32_t TDR;
volatile uint32_t PRESC; // Gx, L4+, Wx etc
};
template <typename T>
class STM32_UART_t : public mmio_ptr<T> {
public:
using mmio_ptr<T>::ptr;
};
|