#ifndef _MEGA128_H_ #define _MEGA128_H_ /* Part-Code ISP */ #define DEVTYPE_ISP 0x43 /* Part-Code Boot */ #define DEVTYPE_BOOT 0x44 #define SIG_BYTE1 0x1E #define SIG_BYTE2 0x97 #define SIG_BYTE3 0x02 #ifdef UART_DOUBLESPEED #define UART_CALC_BAUDRATE(baudRate) ((uint32_t)(F_CPU) / ((uint32_t)(baudRate) *8) -1) #else #define UART_CALC_BAUDRATE(baudRate) ((uint32_t)(F_CPU) / ((uint32_t)(baudRate)*16) -1) #endif #ifndef UART_USE_SECOND #define UART_BAUD_HIGH UBRR0H #define UART_BAUD_LOW UBRR0L #define UART_STATUS UCSR0A #define UART_TXREADY UDRE0 #define UART_RXREADY RXC0 #define UART_DOUBLE U2X0 #define UART_CTRL UCSR0B #define UART_CTRL_DATA ((1<