aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mcu/ATmega328P.h11
-rw-r--r--mcu/ATmega32U4.h10
-rw-r--r--mcu/ATtiny4313.h11
-rw-r--r--mcu/ATtiny85.h11
-rw-r--r--mcu/mcu.h19
5 files changed, 62 insertions, 0 deletions
diff --git a/mcu/ATmega328P.h b/mcu/ATmega328P.h
new file mode 100644
index 0000000..c26d55d
--- /dev/null
+++ b/mcu/ATmega328P.h
@@ -0,0 +1,11 @@
+/* This is specific configuration for ATmega328P.
+ * Also applies on ATmega48A, ATmega48PA, ATmega88A, ATmega88PA, ATmega168A and
+ * ATmega168PA.
+ */
+#include <avr/io.h>
+
+#define DDR_SPI DDRB
+#define DD_SS DDB2
+#define DD_MOSI DDB3
+#define DD_MISO DDB4
+#define DD_SCLK DDB5
diff --git a/mcu/ATmega32U4.h b/mcu/ATmega32U4.h
new file mode 100644
index 0000000..204dce4
--- /dev/null
+++ b/mcu/ATmega32U4.h
@@ -0,0 +1,10 @@
+/* This is specific configuration for ATmega32U4.
+ * This configuration also applies on ATmega16U4.
+ */
+#include <avr/io.h>
+
+#define DDR_SPI DDRB
+#define DD_SS DDB0
+#define DD_MOSI DDB2
+#define DD_MISO DDB3
+#define DD_SCLK DDB5
diff --git a/mcu/ATtiny4313.h b/mcu/ATtiny4313.h
new file mode 100644
index 0000000..fca810b
--- /dev/null
+++ b/mcu/ATtiny4313.h
@@ -0,0 +1,11 @@
+/* This is specific configuration for ATtiny4313.
+ * This configuration also applies on ATtiny2313A.
+ */
+#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
diff --git a/mcu/ATtiny85.h b/mcu/ATtiny85.h
new file mode 100644
index 0000000..9ecbbcc
--- /dev/null
+++ b/mcu/ATtiny85.h
@@ -0,0 +1,11 @@
+/* This is specific configuration for ATtiny85.
+ * This configuration also applies on ATtiny45 and ATtiny25.
+ */
+#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
diff --git a/mcu/mcu.h b/mcu/mcu.h
new file mode 100644
index 0000000..2caf432
--- /dev/null
+++ b/mcu/mcu.h
@@ -0,0 +1,19 @@
+#if (defined __AVR_ATmega328P__ || defined __AVR_ATmega328__ || \
+ defined __AVR_ATmega1688PA__ || defined __AVR_ATmega168A__ || \
+ defined __AVR_ATmega88PA__ || defined __AVR_ATmega88A__ || \
+ defined __AVR_ATmega48PA__ || defined AVR_ATmega48A__)
+#include "ATmega328P.h"
+#endif
+
+#if (defined __AVR_ATmega328U4__ || defined __AVR_ATmega16U4)
+#include "ATmega32U4.h"
+#endif
+
+#if (defined __AVR_ATtiny4313__ || defined __AVR_ATtiny2313A__)
+#include "ATtiny4313.h"
+#endif
+
+#if (defined __AVR_ATtiny85__ || defined __AVR_ATtiny45__ || \
+ defined __AVR_ATtiny25__)
+#include "ATtiny85.h"
+#endif