diff options
Diffstat (limited to 'mcu')
-rw-r--r-- | mcu/ATmega328P.h | 16 | ||||
-rw-r--r-- | mcu/ATmega32U4.h | 16 | ||||
-rw-r--r-- | mcu/ATtiny4313.h | 17 | ||||
-rw-r--r-- | mcu/ATtiny85.h | 15 |
4 files changed, 42 insertions, 22 deletions
diff --git a/mcu/ATmega328P.h b/mcu/ATmega328P.h index c26d55d..dc42233 100644 --- a/mcu/ATmega328P.h +++ b/mcu/ATmega328P.h @@ -4,8 +4,14 @@ */ #include <avr/io.h> -#define DDR_SPI DDRB -#define DD_SS DDB2 -#define DD_MOSI DDB3 -#define DD_MISO DDB4 -#define DD_SCLK DDB5 +// SPI +#define DDR_SPI DDRB +#define DD_SS DDB2 +#define DD_MOSI DDB3 +#define DD_MISO DDB4 +#define DD_SCLK DDB5 +#define PORT_SPI PORTB +#define PORT_SS PORTB2 +#define PORT_MOSI PORTB3 +#define PORT_MISO PORTB4 +#define PORT_SCLK PORTB5 diff --git a/mcu/ATmega32U4.h b/mcu/ATmega32U4.h index 204dce4..acf3a24 100644 --- a/mcu/ATmega32U4.h +++ b/mcu/ATmega32U4.h @@ -3,8 +3,14 @@ */ #include <avr/io.h> -#define DDR_SPI DDRB -#define DD_SS DDB0 -#define DD_MOSI DDB2 -#define DD_MISO DDB3 -#define DD_SCLK DDB5 +// SPI +#define DDR_SPI DDRB +#define DD_SS DDB0 +#define DD_SCLK DDB1 +#define DD_MOSI DDB2 +#define DD_MISO DDB3 +#define PORT_SPI PORTB +#define PORT_SS PORTB0 +#define PORT_SCLK PORTB1 +#define PORT_MOSI PORTB2 +#define PORT_MISO PORTB3 diff --git a/mcu/ATtiny4313.h b/mcu/ATtiny4313.h index fca810b..748f6ff 100644 --- a/mcu/ATtiny4313.h +++ b/mcu/ATtiny4313.h @@ -3,9 +3,14 @@ */ #include <avr/io.h> -#define USI_DIR_REG DDRB -#define USI_OUT_REG PORTB -#define USI_IN_REG PINB -#define USI_USCK_PIN PORTB7 -#define USI_DO_PIN PORTB6 -#define USI_DI_PIN PORTB5 +// SPI USI +#define DDR_USI DDRB +#define DD_DI DDB5 +#define DD_DO DDB6 +#define DD_USCK DDB7 +#define PORT_USI PORTB +#define PORT_DI PORTB5 +#define PORT_DO PORTB6 +#define PORT_USCK PORTB7 + +// SPI USART diff --git a/mcu/ATtiny85.h b/mcu/ATtiny85.h index 9ecbbcc..57f53e7 100644 --- a/mcu/ATtiny85.h +++ b/mcu/ATtiny85.h @@ -3,9 +3,12 @@ */ #include <avr/io.h> -#define USI_DIR_REG DDRB -#define USI_OUT_REG PORTB -#define USI_IN_REG PINB -#define USI_USCK_PIN PORTB2 -#define USI_DO_PIN PORTB1 -#define USI_DI_PIN PORTB0 +// SPI USI +#define DDR_USI DDRB +#define DD_DI DDB0 +#define DD_DO DDB1 +#define DD_USCK DDB2 +#define PORT_USI PORTB +#define PORT_DI PORTB0 +#define PORT_DO PORTB1 +#define PORT_USCK PORTB2 |