From 5d29fe79d30f430ae326d9dc57ccfaed6fe61328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 8 Mar 2016 16:10:33 +0100 Subject: Another full update of current work --- include/mcu/attiny4313.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/mcu/attiny4313.h (limited to 'include/mcu/attiny4313.h') diff --git a/include/mcu/attiny4313.h b/include/mcu/attiny4313.h new file mode 100644 index 0000000..3a2d0b9 --- /dev/null +++ b/include/mcu/attiny4313.h @@ -0,0 +1,46 @@ +/* This is specific configuration for ATtiny4313. + * This configuration also applies on ATtiny2313A. + */ +#include + +// IO Ports +#define MCUSUPPORT_IOPORTS +#define IO_A 0 +#define IO_B 1 +#define IO_D 3 +#define IO_PIN(GROUP) (* (volatile uint8_t *)(PINB + 0x3*GROUP)) +#define IO_DDR(GROUP) (* (volatile uint8_t *)(DDRB + 0x3*GROUP)) +#define IO_PORT(GROUP) (* (volatile uint8_t *)(PORTB + 0x3*GROUP)) +#define IO_A0 IO_A, (1 << 0) +#define IO_A1 IO_A, (1 << 1) +#define IO_A2 IO_A, (1 << 2) +#define IO_B0 IO_B, (1 << 0) +#define IO_B1 IO_B, (1 << 1) +#define IO_B2 IO_B, (1 << 2) +#define IO_B3 IO_B, (1 << 3) +#define IO_B4 IO_B, (1 << 4) +#define IO_B5 IO_B, (1 << 5) +#define IO_B6 IO_B, (1 << 6) +#define IO_B7 IO_B, (1 << 7) +#define IO_D0 IO_D, (1 << 0) +#define IO_D1 IO_D, (1 << 1) +#define IO_D2 IO_D, (1 << 2) +#define IO_D3 IO_D, (1 << 3) +#define IO_D4 IO_D, (1 << 4) +#define IO_D5 IO_D, (1 << 5) +#define IO_D6 IO_D, (1 << 6) +#define MCUSUPPORT_PCINT0 8 // TODO this is B +#define MCUSUPPORT_PCINT1 7 // But this is D +#define MCUSUPPORT_PCINT2 3 // And this is A, this is not expected in ioport.c +// SPI USI +#define MCUSUPPORT_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 +// USART +#define MCUSUPPORT_USART0 -- cgit v1.2.3