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

Define C++-compatible pin map for Argon #2187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
75 changes: 75 additions & 0 deletions hal/src/argon/pinmap_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,79 @@

#if PLATFORM_ID == PLATFORM_ARGON

#ifdef __cplusplus

constexpr pin_t TOTAL_PINS = 36;

// Digital pins
constexpr pin_t D0 = 0;
constexpr pin_t D1 = 1;
constexpr pin_t D2 = 2;
constexpr pin_t D3 = 3;
constexpr pin_t D4 = 4;
constexpr pin_t D5 = 5;
constexpr pin_t D6 = 6;
constexpr pin_t D7 = 7;
constexpr pin_t D8 = 8;
constexpr pin_t D9 = 9;
constexpr pin_t D10 = 10;
constexpr pin_t D11 = 11;
constexpr pin_t D12 = 12;
constexpr pin_t D13 = 13;
constexpr pin_t D14 = 14;
constexpr pin_t D15 = 15;
constexpr pin_t D16 = 16;
constexpr pin_t D17 = 17;
constexpr pin_t D18 = 18;
constexpr pin_t D19 = 19;

constexpr pin_t BTN = 20;
constexpr pin_t RGBR = 21;
constexpr pin_t RGBG = 22;
constexpr pin_t RGBB = 23;

// Analog pins
constexpr pin_t TOTAL_ANALOG_PINS = 6;
constexpr pin_t FIRST_ANALOG_PIN = D14;

constexpr pin_t A0 = D19;
constexpr pin_t A1 = D18;
constexpr pin_t A2 = D17;
constexpr pin_t A3 = D16;
constexpr pin_t A4 = D15;
constexpr pin_t A5 = D14;

constexpr pin_t SS = D14;
constexpr pin_t SCK = D13;
constexpr pin_t MISO = D11;
constexpr pin_t MOSI = D12;

constexpr pin_t SDA = D0;
constexpr pin_t SCL = D1;

constexpr pin_t TX = D9;
constexpr pin_t RX = D10;
constexpr pin_t CTS = D3;
constexpr pin_t RTS = D2;

constexpr pin_t WKP = D8;

constexpr pin_t TX1 = 24;
constexpr pin_t RX1 = 25;
constexpr pin_t CTS1 = 26;
constexpr pin_t RTS1 = 27;

constexpr pin_t ESPBOOT = 28;
constexpr pin_t ESPEN = 29;
constexpr pin_t HWAKE = 30;
constexpr pin_t ANTSW1 = 31;
constexpr pin_t ANTSW2 = 32;
constexpr pin_t BATT = 33;
constexpr pin_t PWR = 34;
constexpr pin_t CHG = 35;

#else // !__cplusplus

#define TOTAL_PINS 36
#define TOTAL_ANALOG_PINS 6
#define FIRST_ANALOG_PIN D14
Expand Down Expand Up @@ -87,6 +160,8 @@
#define PWR 34
#define CHG 35

#endif // !__cplusplus

#endif // PLATFORM_ID == PLATFORM_ARGON

#if PLATFORM_ID == PLATFORM_ASOM
Expand Down