Skip to content

Add support for ATmega88/A/P/PA and ATmega328PB #10

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/boards/ATmega328pbGpioPinMap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* ATmega328 Pin Mapping as supported by MiniCore
* https://github.com/MCUdude/MiniCore
*/
#ifndef ATmega328pbGpioPinMap_h
#define ATmega328pbGpioPinMap_h
static const GpioPinMap_t GpioPinMap[] = {
GPIO_PIN(D, 0), // D0
GPIO_PIN(D, 1), // D1
GPIO_PIN(D, 2), // D2
GPIO_PIN(D, 3), // D3
GPIO_PIN(D, 4), // D4
GPIO_PIN(D, 5), // D5
GPIO_PIN(D, 6), // D6
GPIO_PIN(D, 7), // D7
GPIO_PIN(B, 0), // D8
GPIO_PIN(B, 1), // D9
GPIO_PIN(B, 2), // D10
GPIO_PIN(B, 3), // D11
GPIO_PIN(B, 4), // D12
GPIO_PIN(B, 5), // D13
GPIO_PIN(C, 0), // D14
GPIO_PIN(C, 1), // D15
GPIO_PIN(C, 2), // D16
GPIO_PIN(C, 3), // D17
GPIO_PIN(C, 4), // D18
GPIO_PIN(C, 5), // D19
GPIO_PIN(B, 6), // D20 (Only available if no external crystal is used)
GPIO_PIN(B, 7), // D21 (Only available if no external crystal is used)
GPIO_PIN(C, 6), // D22 (Only available if reset pin has been disabled)
GPIO_PIN(E, 0), // D23
GPIO_PIN(E, 1), // D24
GPIO_PIN(E, 2), // D25
GPIO_PIN(E, 3) // D26
};
#endif // ATmega328pbGpioPinMap_h
9 changes: 8 additions & 1 deletion src/boards/GpioPinMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
*/
#ifndef GpioPinMap_h
#define GpioPinMap_h
#if defined(__AVR_ATmega168__)\
#if defined(__AVR_ATmega88__)\
||defined(__AVR_ATmega88A__)\
||defined(__AVR_ATmega88P__)\
||defined(__AVR_ATmega88PA__)\
||defined(__AVR_ATmega168__)\
||defined(__AVR_ATmega168P__)\
||defined(__AVR_ATmega328P__)
// 168 and 328 Arduinos
#include "UnoGpioPinMap.h"
#elif defined(__AVR_ATmega328PB__)\
// ATmega328PB (as supported by MiniCore)
#include "ATmega328pbGpioPinMap.h"
#elif defined(__AVR_ATmega1280__)\
|| defined(__AVR_ATmega2560__)
// Mega ADK
Expand Down
3 changes: 2 additions & 1 deletion src/boards/LeonardoGpioPinMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static const GpioPinMap_t GpioPinMap[] = {
GPIO_PIN(B, 4), // D26
GPIO_PIN(B, 5), // D27
GPIO_PIN(B, 6), // D28
GPIO_PIN(D, 6) // D29
GPIO_PIN(D, 6), // D29
GPIO_PIN(D, 5) // D30
};
#endif // LeonardoGpioPinMap_h