From 082a9165f0aceed31f659a4c2568f8c473e417ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 14 Mar 2015 11:38:29 +0100 Subject: Add required mcu specifications Added mcu specification for previous commits. --- mcu/ATmega328P.h | 11 +++++++++++ mcu/ATmega32U4.h | 10 ++++++++++ mcu/ATtiny4313.h | 11 +++++++++++ mcu/ATtiny85.h | 11 +++++++++++ mcu/mcu.h | 19 +++++++++++++++++++ 5 files changed, 62 insertions(+) create mode 100644 mcu/ATmega328P.h create mode 100644 mcu/ATmega32U4.h create mode 100644 mcu/ATtiny4313.h create mode 100644 mcu/ATtiny85.h create mode 100644 mcu/mcu.h 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 + +#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 + +#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 + +#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 + +#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 -- cgit v1.2.3