Bluecontroller (BCA8-BTM)  Epsilon
Bluecontroller BCA8-BTM (bluetooth module BTM-222, microcontroller ATmega328P)
 All Files Functions Macros
uart.h
Go to the documentation of this file.
1 
15 #ifndef UART_H_
16  #define UART_H_
17 
18  /* Define */
19  #define MCU atmega328p
20 
21  #define F_CPU 8000000UL
22 
23  #define BAUD 19200
24 
25  #define MYUBRR F_CPU/16/BAUD-1
26 
27  /* Include */
28  #include <avr/io.h>
29  #include <avr/interrupt.h> // Used for sei(), cli() and ISR()
30 
31  /* Register names USART0 */
32  #define UBRRH UBRR0H
33  #define UBRRL UBRR0L
34 
35  #define UCSRA UCSR0A
36  #define UCSRB UCSR0B
37  #define UCSRC UCSR0C
38 
39  #define UDR UDR0
40  #define UDRE UDRE0
41  #define UPE UPE0
42 
43  #define DOR DOR0
44  #define FE FE0
45  #define RXC RXC0
46  #define TXB8 TXB80
47 
48  /* Method */
49  void uart_init(unsigned int ubrr);
50  void uart_putc(unsigned char data);
51 
52 #endif /* UART_H_ */