And this for pins_arduino.h entry for the 2561. Needs a little work in PCINT area still, I don't follow what it's doing yet.
I trimmed a bunch of similar stuff that I do understand so it fits here, mostly so the port assignments I am contemplating can be seen.
/*
pins_arduino.h - Pin definition functions for Arduino
Part of Arduino - [iurl=http://www.arduino.cc/]http://www.arduino.cc/[/iurl]
Copyright (c) 2007 David A. Mellis
This library is free software; you can redistribute it and/or
... bunch of stuff trimmed for posting ...
*/
/* modified for 2561 with fewer ports RWP 2015 */
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <avr/pgmspace.h>
#define NUM_DIGITAL_PINS 46
#define NUM_ANALOG_INPUTS 8
#define analogInputToDigitalPin(p) ((p < 8) ? (p) + 46 : -1)
#define digitalPinHasPWM(p) (p==3 || p==4 || p==5 || p==12 || p==13 || p==14 || p==15 || p==45)
static const uint8_t SS = 8;
static const uint8_t MOSI = 10;
static const uint8_t MISO = 11;
static const uint8_t SCK = 9;
static const uint8_t SDA = 17;
static const uint8_t SCL = 16;
static const uint8_t LED_BUILTIN = 9;
static const uint8_t A0 = 46;
static const uint8_t A1 = 47;
static const uint8_t A2 = 48;
static const uint8_t A3 = 49;
static const uint8_t A4 = 50;
static const uint8_t A5 = 51;
static const uint8_t A6 = 52;
static const uint8_t A7 = 53;
// A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
// Only pins available for RECEIVE (TRANSMIT can be on any pin):
// (I've deliberately left out pin mapping to the Hardware USARTs - seems senseless to me)
// 2560: Pins: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
// 2561 PCINTs: 8-15, all on PORTB - I DON"T KNOW WHAT TO DO HERE
#define digitalPinToPCICR(p) ( (((p) >= 10) && ((p) <= 13)) || \
(((p) >= 50) && ((p) <= 53)) || \
(((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
#define digitalPinToPCICRbit(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? 0 : \
( (((p) >= 62) && ((p) <= 69)) ? 2 : \
0 ) )
#define digitalPinToPCMSK(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? (&PCMSK0) : \
( (((p) >= 62) && ((p) <= 69)) ? (&PCMSK2) : \
((uint8_t *)0) ) )
#define digitalPinToPCMSKbit(p) ( (((p) >= 10) && ((p) <= 13)) ? ((p) - 6) : \
( ((p) == 50) ? 3 : \
( ((p) == 51) ? 2 : \
( ((p) == 52) ? 1 : \
( ((p) == 53) ? 0 : \
( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
0 ) ) ) ) ) )
#ifdef ARDUINO_MAIN
// bunch of stuff trimmed for posting ...
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// PORTLIST
// -------------------------------------------
PE , // PE 0 ** 0 ** USART0_RX
PE , // PE 1 ** 1 ** USART0_TX
PE , // PE 2 ** 2 **
PE , // PE 3 ** 3 ** PWM0
PE , // PE 4 ** 4 ** PWM1
PE , // PE 5 ** 5 ** PWM2
PE , // PE 6 ** 6 **
PE , // PE 7 ** 7 **
PB , // PH 0 ** 8 ** SS
PB , // PH 1 ** 9 ** SCK
PB , // PB 2 ** 10 ** MOSI
PB , // PB 3 ** 11 ** MISO
PB , // PB 4 ** 12 ** PWM3
PB , // PB 5 ** 13 ** PWM4
PB , // PJ 6 ** 14 ** PWM5
PB , // PJ 7 ** 15 ** PWM6
PD , // PD 0 ** 16 ** I2C - SCL - INT0
PD , // PD 1 ** 17 ** I2C - SDA - INT1
PD , // PD 2 ** 18 ** USART1_RX - INT2
PD , // PD 3 ** 19 ** USART1_TX - INT3
PD , // PD 4 ** 20 **
PD , // PD 5 ** 21 **
PD , // PD 6 ** 22 **
PD , // PD 7 ** 23 **
PA , // PA 0 ** 24 ** D24
PA , // PA 1 ** 25 ** D25
PA , // PA 2 ** 26 ** D26
PA , // PA 3 ** 27 ** D27
PA , // PA 4 ** 28 ** D28
PA , // PA 5 ** 29 ** D29
PA , // PC 6 ** 30 ** D30
PA , // PC 7 ** 31 ** D31
PC , // PC 0 ** 32 ** D32
PC , // PC 1 ** 33 ** D33
PC , // PC 2 ** 34 ** D34
PC , // PC 3 ** 35 ** D35
PC , // PC 4 ** 36 ** D36
PC , // PC 5 ** 37 ** D37
PC , // PC 6 ** 38 ** D38
PC , // PC 7 ** 39 ** D39
PG , // PG 0 ** 40 ** D40
PG , // PG 1 ** 41 ** D41
PG , // PG 2 ** 42 ** D42
PG , // PG 3 ** 43 ** D43
PG , // PG 4 ** 44 ** D44
PG , // PG 5 ** 45 ** D45
PF , // PF 0 ** 46 ** D46
PF , // PF 1 ** 47 ** D47
PF , // PF 2 ** 48 ** D48
PF , // PF 3 ** 49 ** D49
PF , // PF 4 ** 50 ** D50
PF , // PF 5 ** 51 ** D51
PF , // PF 6 ** 52 ** D52
PB , // PF 7 ** 53 ** D53
};
// other similar tables trimmed for posting
#endif
#endif
pins_arduino_2561.h (9.85 KB)