Lazuli
Data Structures | Macros | Enumerations
usart.h File Reference

USART API for the ATmega328P. More...

#include <stdint.h>
#include <Lazuli/common.h>

Go to the source code of this file.

Data Structures

struct  Usart
 Describes the memory mapping for the USART. More...
 

Macros

#define UCSR0A   DIRECT(0xc0)
 USART Control and Status Register A.
 
#define UCSR0B   DIRECT(0xc1)
 USART Control and Status Register B.
 
#define UCSR0C   DIRECT(0xc2)
 USART Control and Status Register C.
 
#define UBRROL   DIRECT(0xc4)
 USART Baud Rate Register low.
 
#define UBRR0H   DIRECT(0xc5)
 USART Baud Rate Register high.
 
#define UDR0   DIRECT(0xc6)
 USART I/O Data Register.
 

Enumerations

enum  {
  UCSR0A_RXC0 = POSITION(7U),
  UCSR0A_TXC0 = POSITION(6U),
  UCSR0A_UDRE0 = POSITION(5U),
  UCSR0A_FE0 = POSITION(4U),
  UCSR0A_DOR0 = POSITION(3U),
  UCSR0A_UPE0 = POSITION(2U),
  UCSR0A_U2X0 = POSITION(1U),
  UCSR0A_MPCM0 = POSITION(0U)
}
 Content of the UCSR0A register. More...
 
enum  {
  UCSR0B_RXCIE0 = POSITION(7U),
  UCSR0B_TXCIE0 = POSITION(6U),
  UCSR0B_UDRIE0 = POSITION(5U),
  UCSR0B_RXEN0 = POSITION(4U),
  UCSR0B_TXEN0 = POSITION(3U),
  UCSR0B_UCSZ02 = POSITION(2U),
  UCSR0B_RXB80 = POSITION(1U),
  UCSR0B_TXB80 = POSITION(0U)
}
 Content of the UCSR0B register. More...
 
enum  {
  UCSR0C_UMSEL01 = POSITION(7U),
  UCSR0C_UMSEL00 = POSITION(6U),
  UCSR0C_UPM01 = POSITION(5U),
  UCSR0C_UPM00 = POSITION(4U),
  UCSR0C_USBS0 = POSITION(3U),
  UCSR0C_UCSZ01 = POSITION(2U),
  UCSR0C_UCSZ00 = POSITION(1U),
  UCSR0C_UCPOL0 = POSITION(0U)
}
 Content of the UCSR0C register. More...
 

Detailed Description

USART API for the ATmega328P.

Describes the interface of the USART driver for the ATMega328p.

Definition in file usart.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Content of the UCSR0A register.

Enumerator
UCSR0A_RXC0 

USART Receive Complete.

UCSR0A_TXC0 

USART Transmit Complete.

UCSR0A_UDRE0 

USART Data Register Empty.

UCSR0A_FE0 

Frame Error.

UCSR0A_DOR0 

Data OverRun.

UCSR0A_UPE0 

USART Parity Error.

UCSR0A_U2X0 

Double USART Transmission Speed.

UCSR0A_MPCM0 

Multi-processor Communication Mode.

Definition at line 62 of file usart.h.

◆ anonymous enum

anonymous enum

Content of the UCSR0B register.

Enumerator
UCSR0B_RXCIE0 

RX Complete Interrupt Enable.

UCSR0B_TXCIE0 

TX Complete Interrupt Enable.

UCSR0B_UDRIE0 

Data Register Empty Interrupt Enable.

UCSR0B_RXEN0 

Receiver Enable.

UCSR0B_TXEN0 

Transmitter Enable.

UCSR0B_UCSZ02 

Character Size 2.

UCSR0B_RXB80 

Receive Data Bit 8.

UCSR0B_TXB80 

Transmit Data Bit 8.

Definition at line 76 of file usart.h.

◆ anonymous enum

anonymous enum

Content of the UCSR0C register.

Enumerator
UCSR0C_UMSEL01 

USART Mode Select 1.

UCSR0C_UMSEL00 

USART Mode Select 0.

UCSR0C_UPM01 

Parity Mode 1.

UCSR0C_UPM00 

Parity Mode 0.

UCSR0C_USBS0 

Stop Bit Select.

UCSR0C_UCSZ01 

Character size 1.

UCSR0C_UCSZ00 

Character Size 0.

UCSR0C_UCPOL0 

Clock Polarity.

Definition at line 90 of file usart.h.