uart0.c 700 B

12345678910111213141516171819202122232425262728293031
  1. /*---------------------------------------------------------*/
  2. /* UART functions for ATmega164A/PA/324A/PA/644A/PA/1284/P */
  3. /*---------------------------------------------------------*/
  4. #include <avr/interrupt.h>
  5. #include "uart0.h"
  6. #define _PORT PORTD
  7. #define _DDR DDRD
  8. #define _RX PD0
  9. #define _TX PD1
  10. #define _UCSRA UCSR0A
  11. #define _UCSRB UCSR0B
  12. #define _UBRR UBRR0
  13. #define _RXEN RXEN0
  14. #define _RXCIE RXCIE0
  15. #define _TXEN TXEN0
  16. #define _UDRIE UDRIE0
  17. #define _UDRE UDRE0
  18. #define _UDR UDR0
  19. #define _USART_RX_vect USART0_RX_vect
  20. #define _USART_UDRE_vect USART0_UDRE_vect
  21. #define UART_BAUD 9600
  22. #define USE_TXINT 0
  23. #define SZ_FIFO 512
  24. #define RECEIVE 1
  25. #define TRANSMIT 1
  26. #include "uart.c"