1
0

uart1.c 701 B

12345678910111213141516171819202122232425262728293031
  1. /*---------------------------------------------------------*/
  2. /* UART functions for ATmega164A/PA/324A/PA/644A/PA/1284/P */
  3. /*---------------------------------------------------------*/
  4. #include <avr/interrupt.h>
  5. #include "uart1.h"
  6. #define _PORT PORTD
  7. #define _DDR DDRD
  8. #define _RX PD2
  9. #define _TX PD3
  10. #define _UCSRA UCSR1A
  11. #define _UCSRB UCSR1B
  12. #define _UBRR UBRR1
  13. #define _RXEN RXEN1
  14. #define _RXCIE RXCIE1
  15. #define _TXEN TXEN1
  16. #define _UDRIE UDRIE1
  17. #define _UDRE UDRE1
  18. #define _UDR UDR1
  19. #define _USART_RX_vect USART1_RX_vect
  20. #define _USART_UDRE_vect USART1_UDRE_vect
  21. #define UART_BAUD 230400
  22. #define USE_TXINT 1
  23. #define SZ_FIFO 64
  24. #define RECEIVE 1
  25. #define TRANSMIT 1
  26. #include "uart.c"