aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mcu/ATmega8A.h15
-rw-r--r--mcu/mcu.h3
-rw-r--r--mcu/mcu_def.h4
3 files changed, 22 insertions, 0 deletions
diff --git a/mcu/ATmega8A.h b/mcu/ATmega8A.h
new file mode 100644
index 0000000..1ded665
--- /dev/null
+++ b/mcu/ATmega8A.h
@@ -0,0 +1,15 @@
+/* This is specific configuration for ATmega8A.
+ */
+#include <avr/io.h>
+
+// SPI
+#define DDR_SPI DDRB
+#define DD_SS DDB2
+#define DD_SCLK DDB5
+#define DD_MOSI DDB3
+#define DD_MISO DDB4
+#define PORT_SPI PORTB
+#define PORT_SS PORTB2
+#define PORT_SCLK PORTB5
+#define PORT_MOSI PORTB3
+#define PORT_MISO PORTB4
diff --git a/mcu/mcu.h b/mcu/mcu.h
index 2a950c8..5e7993d 100644
--- a/mcu/mcu.h
+++ b/mcu/mcu.h
@@ -13,3 +13,6 @@
#define __MCU_ATtiny85__ \
((defined __AVR_ATtiny85__ || defined __AVR_ATtiny45__ || \
defined __AVR_ATtiny25__))
+
+#define __MCU_ATmega8A__ \
+ (defined __AVR_ATmega8A__)
diff --git a/mcu/mcu_def.h b/mcu/mcu_def.h
index b423a77..51b70fe 100644
--- a/mcu/mcu_def.h
+++ b/mcu/mcu_def.h
@@ -8,6 +8,10 @@
#include "ATmega32U4.h"
#endif
+#if __MCU_ATmega8A__
+#include "ATmega8A.h"
+#endif
+
#if __MCU_ATtiny4313__
#include "ATtiny4313.h"
#endif