X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fconfig_common.h;h=bc4d9ec1af1a03a9f4d079cf0c6a8abaae93fb8e;hb=7ec583e5efb276ce90a40a1df985de7d0d0b8f46;hp=cbff372eaf364cc5663ffa8ca4c38a58556e11a2;hpb=47c91fc7f75ae0a477e55b687aa0fc30da0a283c;p=qmk_firmware.git diff --git a/quantum/config_common.h b/quantum/config_common.h index cbff372ea..bc4d9ec1a 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -21,6 +21,9 @@ #define ROW2COL 1 #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ +// useful for direct pin mapping +#define NO_PIN (~0) + #ifdef __AVR__ #ifndef __ASSEMBLER__ #include @@ -56,6 +59,11 @@ #define PINC_ADDRESS 0x3 #define PINB_ADDRESS 0x6 #define PINA_ADDRESS 0x9 + #elif defined(__AVR_ATmega328P__) + #define ADDRESS_BASE 0x00 + #define PINB_ADDRESS 0x3 + #define PINC_ADDRESS 0x6 + #define PIND_ADDRESS 0x9 #else #error "Pins are not defined" #endif @@ -125,6 +133,45 @@ #endif #elif defined(PROTOCOL_CHIBIOS) + // Defines mapping for Proton C replacement + #ifdef CONVERT_TO_PROTON_C + // Left side (front) + #define D3 PAL_LINE(GPIOA, 9) + #define D2 PAL_LINE(GPIOA, 10) + // GND + // GND + #define D1 PAL_LINE(GPIOB, 7) + #define D0 PAL_LINE(GPIOB, 6) + #define D4 PAL_LINE(GPIOB, 5) + #define C6 PAL_LINE(GPIOB, 4) + #define D7 PAL_LINE(GPIOB, 3) + #define E6 PAL_LINE(GPIOB, 2) + #define B4 PAL_LINE(GPIOB, 1) + #define B5 PAL_LINE(GPIOB, 0) + + // Right side (front) + // RAW + // GND + // RESET + // VCC + #define F4 PAL_LINE(GPIOA, 2) + #define F5 PAL_LINE(GPIOA, 1) + #define F6 PAL_LINE(GPIOA, 0) + #define F7 PAL_LINE(GPIOB, 8) + #define B1 PAL_LINE(GPIOB, 13) + #define B3 PAL_LINE(GPIOB, 14) + #define B2 PAL_LINE(GPIOB, 15) + #define B6 PAL_LINE(GPIOB, 9) + + // LEDs (only D5/C13 uses an actual LED) + #ifdef CONVERT_TO_PROTON_C_RXLED + #define D5 PAL_LINE(GPIOC, 13) + #define B0 PAL_LINE(GPIOC, 13) + #else + #define D5 PAL_LINE(GPIOC, 13) + #define B0 PAL_LINE(GPIOC, 14) + #endif + #else #define A0 PAL_LINE(GPIOA, 0) #define A1 PAL_LINE(GPIOA, 1) #define A2 PAL_LINE(GPIOA, 2) @@ -157,6 +204,8 @@ #define B13 PAL_LINE(GPIOB, 13) #define B14 PAL_LINE(GPIOB, 14) #define B15 PAL_LINE(GPIOB, 15) + #define B16 PAL_LINE(GPIOB, 16) + #define B17 PAL_LINE(GPIOB, 17) #define C0 PAL_LINE(GPIOC, 0) #define C1 PAL_LINE(GPIOC, 1) #define C2 PAL_LINE(GPIOC, 2) @@ -221,6 +270,7 @@ #define F13 PAL_LINE(GPIOF, 13) #define F14 PAL_LINE(GPIOF, 14) #define F15 PAL_LINE(GPIOF, 15) + #endif #endif /* USART configuration */