#pragma once // Pin mappings as on the arduino board #define PIN_D0 D, 0 #define PIN_D1 D, 1 #define PIN_D2 D, 2 #define PIN_D3 D, 3 #define PIN_D4 D, 4 #define PIN_D5 D, 5 #define PIN_D6 D, 6 #define PIN_D7 D, 7 #define PIN_D8 B, 0 #define PIN_D9 B, 1 #define PIN_D10 B, 2 #define PIN_D11 B, 3 #define PIN_D12 B, 4 #define PIN_D13 B, 5 #define PIN_A0 C, 0 #define PIN_A1 C, 1 #define PIN_A2 C, 2 #define PIN_A3 C, 3 #define PIN_A4 C, 4 #define PIN_A5 C, 5 // Alternative names for certain pins #define PIN_SPI_SS PIN_D10 #define PIN_SPI_MOSI PIN_D11 #define PIN_SPI_MISO PIN_D12 #define PIN_SPI_SCK PIN_D13 #define PIN_WIRE_SDA PIN_A4 #define PIN_WIRE_SCL PIN_A5 #define LED_BUILTIN PIN_D13 // Button #define PIN_MOSFET PIN_A0 #define PIN_SWITCH PIN_A1 // Cart #define PIN_WRITE PIN_A3 #define PIN_CS PIN_A4 #define PIN_READ PIN_A5 // Shift registers #define PIN_STORE PIN_D10 // Data pins #define PIN_DAT0 PIN_D2 #define PIN_DAT1 PIN_D3 #define PIN_DAT2 PIN_D4 #define PIN_DAT3 PIN_D5 #define PIN_DAT4 PIN_D6 #define PIN_DAT5 PIN_D7 #define PIN_DAT6 PIN_D8 #define PIN_DAT7 PIN_D9 #define PINS_DATB (pin(PIN_DAT7) | pin(PIN_DAT6)) #define PINS_DATD (pin(PIN_DAT5) | pin(PIN_DAT4) | pin(PIN_DAT3) | pin(PIN_DAT2) | pin(PIN_DAT1) | pin(PIN_DAT0)) #define PINS_DAT (PINB << 6 | PIND >> 2)