Lazuli
usart.h
Go to the documentation of this file.
1 /*
2  * SPDX-License-Identifier: GPL-3.0-only
3  * This file is part of Lazuli.
4  */
5 
14 #ifndef LAZULI_SYS_ARCH_AVR_USART_H
15 #define LAZULI_SYS_ARCH_AVR_USART_H
16 
17 #include <stdint.h>
18 
19 #include <Lazuli/common.h>
20 
22 
23 /*
24  * USART Register Definitions.
25  * Ordered by address.
26  */
27 
29 #define UCSR0A DIRECT(0xc0)
30 
32 #define UCSR0B DIRECT(0xc1)
33 
35 #define UCSR0C DIRECT(0xc2)
36 
38 #define UBRROL DIRECT(0xc4)
39 
41 #define UBRR0H DIRECT(0xc5)
42 
44 #define UDR0 DIRECT(0xc6)
45 
49 typedef struct {
50  volatile uint8_t ucsr0a;
51  volatile uint8_t ucsr0b;
52  volatile uint8_t ucsr0c;
53  volatile uint8_t _reserved;
54  volatile uint8_t ubrr0l;
55  volatile uint8_t ubrr0h;
56  volatile uint8_t udr0;
57 }Usart;
58 
62 enum {
71 };
72 
76 enum {
85 };
86 
90 enum {
99 };
100 
102 
103 #endif /* LAZULI_SYS_ARCH_AVR_USART_H */
volatile uint8_t ucsr0c
USART Control and Status Register C.
Definition: usart.h:52
Data Register Empty Interrupt Enable.
Definition: usart.h:79
volatile uint8_t ucsr0b
USART Control and Status Register B.
Definition: usart.h:51
Transmit Data Bit 8.
Definition: usart.h:84
volatile uint8_t ubrr0l
USART Baud Rate Register low.
Definition: usart.h:54
Character Size 0.
Definition: usart.h:97
#define _EXTERN_C_DECL_BEGIN
Open C++ header file declarations.
Definition: common.h:37
volatile uint8_t _reserved
Unsed.
Definition: usart.h:53
Describes the memory mapping for the USART.
Definition: usart.h:49
USART Receive Complete.
Definition: usart.h:63
Data OverRun.
Definition: usart.h:67
Character size 1.
Definition: usart.h:96
USART Data Register Empty.
Definition: usart.h:65
Frame Error.
Definition: usart.h:66
Character Size 2.
Definition: usart.h:82
USART Transmit Complete.
Definition: usart.h:64
RX Complete Interrupt Enable.
Definition: usart.h:77
volatile uint8_t ubrr0h
USART Baud Rate Register high.
Definition: usart.h:55
volatile uint8_t ucsr0a
USART Control and Status Register A.
Definition: usart.h:50
#define POSITION(X)
Define a constant bit at position X, starting from index 0.
Definition: common.h:174
Receive Data Bit 8.
Definition: usart.h:83
USART Mode Select 1.
Definition: usart.h:91
unsigned char uint8_t
Represents a unsigned integer type with width of exactly 8 bits.
Definition: stdint.h:89
Double USART Transmission Speed.
Definition: usart.h:69
TX Complete Interrupt Enable.
Definition: usart.h:78
Receiver Enable.
Definition: usart.h:80
Multi-processor Communication Mode.
Definition: usart.h:70
volatile uint8_t udr0
USART I/O Data Register.
Definition: usart.h:56
Parity Mode 1.
Definition: usart.h:93
Basic type definitions and useful macros.
#define _EXTERN_C_DECL_END
Close C++ header file declarations.
Definition: common.h:42
Parity Mode 0.
Definition: usart.h:94
Transmitter Enable.
Definition: usart.h:81
Stop Bit Select.
Definition: usart.h:95
USART Mode Select 0.
Definition: usart.h:92
USART Parity Error.
Definition: usart.h:68
Clock Polarity.
Definition: usart.h:98