AVR Bootloader (avrboot cleanup)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
736 B

  1. #ifndef _MEGA169_H_
  2. #define _MEGA169_H_
  3. #define DEVTYPE_ISP 0x78
  4. #define DEVTYPE_BOOT 0x79
  5. #define SIG_BYTE3 0x1E
  6. #define SIG_BYTE2 0x94
  7. #define SIG_BYTE1 0x05
  8. #ifdef UART_DOUBLESPEED
  9. #define UART_CALC_BAUDRATE(baudRate) ((uint32_t)(F_CPU) / ((uint32_t)(baudRate) *8) -1)
  10. #else
  11. #define UART_CALC_BAUDRATE(baudRate) ((uint32_t)(F_CPU) / ((uint32_t)(baudRate)*16) -1)
  12. #endif
  13. #define UART_BAUD_HIGH UBRRH
  14. #define UART_BAUD_LOW UBRRL
  15. #define UART_STATUS UCSRA
  16. #define UART_TXREADY UDRE
  17. #define UART_RXREADY RXC
  18. #define UART_DOUBLE U2X
  19. #define UART_CTRL UCSRB
  20. #define UART_CTRL_DATA ((1<<TXEN) | (1<<RXEN))
  21. #define UART_CTRL2 UCSRC
  22. #define UART_CTRL2_DATA ((1<<UCSZ1) | (1<<UCSZ0))
  23. #define UART_DATA UDR
  24. #endif // #ifndef _MEGA169_H_