Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Microduino SD #4428

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
124 changes: 124 additions & 0 deletions libraries/SD/src/utility/Sd2PinMap.h
Expand Up @@ -133,6 +133,130 @@ static const pin_map_t digitalPinMap[] = {
{&DDRK, &PINK, &PORTK, 7} // K7 69
};
//------------------------------------------------------------------------------
#elif (defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && defined(CORE_MICRODUINO)
// Microduino Core+

// Two Wire (aka I2C) ports
uint8_t const SDA_PIN = 20;
uint8_t const SCL_PIN = 21;

// SPI port
uint8_t const SS_PIN = 10;
uint8_t const MOSI_PIN = 11;
uint8_t const MISO_PIN = 12;
uint8_t const SCK_PIN = 13;

static const pin_map_t digitalPinMap[] = {
{&DDRD, &PIND, &PORTD, 0}, // D0 PD0
{&DDRD, &PIND, &PORTD, 1}, // D1 PD1
{&DDRD, &PIND, &PORTD, 2}, // D2 PD2
{&DDRD, &PIND, &PORTD, 3}, // D3 PD3
{&DDRB, &PINB, &PORTB, 0}, // D4 PB0
{&DDRB, &PINB, &PORTB, 1}, // D5 PB1
{&DDRB, &PINB, &PORTB, 2}, // D6 PB2
{&DDRB, &PINB, &PORTB, 3}, // D7 PB3
{&DDRD, &PIND, &PORTD, 6}, // D8 PD6
{&DDRD, &PIND, &PORTD, 5}, // D9 PD5
{&DDRB, &PINB, &PORTB, 4}, // D10 PB4
{&DDRB, &PINB, &PORTB, 5}, // D11 PB5
{&DDRB, &PINB, &PORTB, 6}, // D12 PB6
{&DDRB, &PINB, &PORTB, 7}, // D13 PB7
{&DDRC, &PINC, &PORTC, 7}, // D14 PC7
{&DDRC, &PINC, &PORTC, 6}, // D15 PC6
{&DDRC, &PINC, &PORTC, 5}, // D16 PC5
{&DDRC, &PINC, &PORTC, 4}, // D17 PC4
{&DDRC, &PINC, &PORTC, 3}, // D18 PC3
{&DDRC, &PINC, &PORTC, 2}, // D19 PC2
{&DDRC, &PINC, &PORTC, 1}, // D20 PC1
{&DDRC, &PINC, &PORTC, 0}, // D21 PC0
{&DDRD, &PIND, &PORTD, 4}, // D22 PD4
{&DDRD, &PIND, &PORTD, 7}, // D23 PD7
{&DDRA, &PINA, &PORTA, 7}, // D24 PA7
{&DDRA, &PINA, &PORTA, 6}, // D25 PA6
{&DDRA, &PINA, &PORTA, 5}, // D26 PA5
{&DDRA, &PINA, &PORTA, 4}, // D27 PA4
{&DDRA, &PINA, &PORTA, 3}, // D28 PA3
{&DDRA, &PINA, &PORTA, 2}, // D29 PA2
{&DDRA, &PINA, &PORTA, 1}, // D30 PA1
{&DDRA, &PINA, &PORTA, 0} // D31 PA0
};
//------------------------------------------------------------------------------
#elif defined(__AVR_ATmega128RFA1__) && defined(CORE_MICRODUINO)
// Microduino Core RF

// Two Wire (aka I2C) ports
uint8_t const SDA_PIN = 18;
uint8_t const SCL_PIN = 19;

// SPI port
uint8_t const SS_PIN = 10;
uint8_t const MOSI_PIN = 11;
uint8_t const MISO_PIN = 12;
uint8_t const SCK_PIN = 13;

static const pin_map_t digitalPinMap[] = {
{&DDRD, &PINE, &PORTE, 0}, // D0 PE0
{&DDRD, &PINE, &PORTE, 1}, // D1 PE1
{&DDRD, &PIND, &PORTD, 2}, // D2 PD2
{&DDRD, &PIND, &PORTD, 3}, // D3 PD3
{&DDRB, &PINE, &PORTE, 3}, // D4 PE3
{&DDRB, &PINE, &PORTE, 4}, // D5 PE4
{&DDRB, &PINE, &PORTE, 5}, // D6 PE5
{&DDRB, &PINB, &PORTB, 7}, // D7 PB7
{&DDRD, &PINB, &PORTB, 6}, // D8 PB6
{&DDRD, &PINB, &PORTB, 5}, // D9 PB5
{&DDRB, &PINB, &PORTB, 4}, // D10 PB4
{&DDRB, &PINB, &PORTB, 2}, // D11 PB2
{&DDRB, &PINB, &PORTB, 3}, // D12 PB3
{&DDRB, &PINB, &PORTB, 1}, // D13 PB1
{&DDRF, &PINF, &PORTF, 7}, // D14 PF7
{&DDRF, &PINF, &PORTF, 6}, // D15 PF6
{&DDRF, &PINF, &PORTF, 5}, // D16 PF5
{&DDRF, &PINF, &PORTF, 4}, // D17 PF4
{&DDRD, &PIND, &PORTD, 1}, // D18 PD1
{&DDRD, &PIND, &PORTD, 0}, // D19 PD0
{&DDRF, &PINF, &PORTF, 3}, // D20 PF3
{&DDRF, &PINF, &PORTF, 2}, // D21 PF2
};
//------------------------------------------------------------------------------
#elif defined(__AVR_ATmega32U4__) && defined(CORE_MICRODUINO)
// Microduino Core USB

// Two Wire (aka I2C) ports
uint8_t const SDA_PIN = 18;
uint8_t const SCL_PIN = 19;

// SPI port
uint8_t const SS_PIN = 10;
uint8_t const MOSI_PIN = 11;
uint8_t const MISO_PIN = 12;
uint8_t const SCK_PIN = 13;

static const pin_map_t digitalPinMap[] = {
{&DDRD, &PIND, &PORTD, 2}, // D0 - PD2
{&DDRD, &PIND, &PORTD, 3}, // D1 - PD3
{&DDRE, &PINE, &PORTE, 6}, // D2 - PE6
{&DDRD, &PIND, &PORTD, 6}, // D3 - PD6
{&DDRD, &PIND, &PORTD, 7}, // D4 - PD7
{&DDRC, &PINC, &PORTC, 6}, // D5 - PC6
{&DDRC, &PINC, &PORTC, 7}, // D6 - PC7
{&DDRE, &PINE, &PORTE, 7}, // D7 - PE7
{&DDRB, &PINB, &PORTB, 6}, // D8 - PB6
{&DDRB, &PINB, &PORTB, 5}, // D9 - PB5
{&DDRB, &PINB, &PORTB, 0}, // D10 - PB0
{&DDRB, &PINB, &PORTB, 2}, // D11 - MOSI - PB2
{&DDRB, &PINB, &PORTB, 3}, // D12 -MISO - PB3
{&DDRB, &PINB, &PORTB, 1}, // D13 -SCK - PB1
{&DDRF, &PINF, &PORTF, 7}, // D14 - A0 - PF7
{&DDRF, &PINF, &PORTF, 6}, // D15 - A1 - PF6
{&DDRF, &PINF, &PORTF, 5}, // D16 - A2 - PF5
{&DDRF, &PINF, &PORTF, 4}, // D17 - A3 - PF4
{&DDRD, &PIND, &PORTD, 1}, // D18 - PD1
{&DDRD, &PIND, &PORTD, 0}, // D19 - PD0
{&DDRF, &PINF, &PORTF, 1}, // D20 - A6 - PF1
{&DDRF, &PINF, &PORTF, 0}, // D21 - A7 - PF0
};
//------------------------------------------------------------------------------
#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
// Sanguino

Expand Down