Browse Source

pin defs for more attiny

Spence Konde (aka Dr. Azzy) 6 years ago
parent
commit
a5c9de3fd0
1 changed files with 170 additions and 26 deletions
  1. 170 26
      optiboot/bootloaders/optiboot/pin_defs.h

+ 170 - 26
optiboot/bootloaders/optiboot/pin_defs.h

@@ -42,20 +42,29 @@
  * Note that mega8/m32 still needs special handling, because ubrr is handled
  * differently.
  */
+#ifndef SOFT_UART
 #if UART == 0
- #if defined(LINDAT)
-#define LIN_UART 1
-#define UART_SRA UCSRA
-#define UART_SRB UCSRB
-#define UART_SRC UCSRC
-#define UART_SRL UBRRL
-#define UART_UDR LINDAT
- #else
+#if defined(UDR0)
 # define UART_SRA UCSR0A
 # define UART_SRB UCSR0B
 # define UART_SRC UCSR0C
 # define UART_SRL UBRR0L
 # define UART_UDR UDR0
+#elif defined(UDR)
+# define UART_SRA UCSRA
+# define UART_SRB UCSRB
+# define UART_SRC UCSRC
+# define UART_SRL UBRRL
+# define UART_UDR UDR
+#elif defined(LINDAT)
+# define LIN_UART 1
+# define UART_SRA UCSRA
+# define UART_SRB UCSRB
+# define UART_SRC UCSRC
+# define UART_SRL UBRRL
+# define UART_UDR LINDAT
+#else
+# error UART == 0, but no UART0 on device
 #endif
 #elif UART == 1
 #if !defined(UDR1)
@@ -85,6 +94,7 @@
 # define UART_SRL UBRR3L
 # define UART_UDR UDR3
 #endif
+#endif //end #ifndef SOFT_UART
 
 #if    defined(__AVR_ATmega8__)		\
     || defined (__AVR_ATmega32__)	\
@@ -104,24 +114,6 @@
   #define WDCE		WDTOE
 #endif
 
-/* Luminet support */
-/*------------------------------------------------------------------------ */
-#if defined(__AVR_ATtiny84__)
-/*------------------------------------------------------------------------ */
-/* Red LED is connected to pin PA4 */ 
-#if !defined(LED)
-#define LED         A4
-#endif
-
-/* Ports for soft UART - left port only for now. TX/RX on PA2/PA3 */
-#ifdef SOFT_UART
-#define UART_PORT   PORTA
-#define UART_PIN    PINA
-#define UART_DDR    DDRA
-#define UART_TX_BIT 2
-#define UART_RX_BIT 3
-#endif
-#endif
 
 /*------------------------------------------------------------------------ */
 /* Sanguino support (and other 40pin DIP cpus) */
@@ -522,6 +514,158 @@
 #endif
 #endif
 
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny441__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B2
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTA
+#define UART_PIN    PINA
+#define UART_DDR    DDRA
+#define UART_TX_BIT 2
+#define UART_RX_BIT 3
+#endif
+#endif
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny84__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B2
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTA
+#define UART_PIN    PINA
+#define UART_DDR    DDRA
+#define UART_TX_BIT 1
+#define UART_RX_BIT 2
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny44__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B2
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTA
+#define UART_PIN    PINA
+#define UART_DDR    DDRA
+#define UART_TX_BIT 1
+#define UART_RX_BIT 2
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny85__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B2
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTB
+#define UART_PIN    PINB
+#define UART_DDR    DDRB
+#define UART_TX_BIT 0
+#define UART_RX_BIT 1
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny45__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B2
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTB
+#define UART_PIN    PINB
+#define UART_DDR    DDRB
+#define UART_TX_BIT 0
+#define UART_RX_BIT 1
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny861__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B3
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTA
+#define UART_PIN    PINA
+#define UART_DDR    DDRA
+#define UART_TX_BIT 6
+#define UART_RX_BIT 7
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny461__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B3
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTA
+#define UART_PIN    PINA
+#define UART_DDR    DDRA
+#define UART_TX_BIT 6
+#define UART_RX_BIT 7
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny88__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B5
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTD
+#define UART_PIN    PIND
+#define UART_DDR    DDRD
+#define UART_TX_BIT 6
+#define UART_RX_BIT 7
+#endif
+#endif
+
+/*------------------------------------------------------------------------ */
+#if defined(__AVR_ATtiny48__)
+/*------------------------------------------------------------------------ */
+/* LED is on B2 */
+#if !defined(LED)
+#define LED   B5
+#endif
+
+#ifdef SOFT_UART
+#define UART_PORT   PORTD
+#define UART_PIN    PIND
+#define UART_DDR    DDRD
+#define UART_TX_BIT 6
+#define UART_RX_BIT 7
+#endif
+#endif
+
 /*------------------------------------------------------------------------ */
 #if defined(__AVR_ATtiny167__)
 /*------------------------------------------------------------------------ */