|
@ -27,8 +27,6 @@ |
|
|
* These use GPIO functions instead of Direct Port Manipulation, as on AVR. |
|
|
* These use GPIO functions instead of Direct Port Manipulation, as on AVR. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
#define _BV(b) (1 << (b)) |
|
|
|
|
|
|
|
|
|
|
|
#define READ(IO) digitalRead(IO) |
|
|
#define READ(IO) digitalRead(IO) |
|
|
#define WRITE(IO,V) digitalWrite(IO,V) |
|
|
#define WRITE(IO,V) digitalWrite(IO,V) |
|
|
|
|
|
|
|
@ -66,95 +64,105 @@ |
|
|
|
|
|
|
|
|
#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) |
|
|
#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) |
|
|
|
|
|
|
|
|
#define PA0 _STM32_PIN(A, 0) |
|
|
#ifndef PA0 |
|
|
#define PA1 _STM32_PIN(A, 1) |
|
|
#define PA0 _STM32_PIN(A, 0) |
|
|
#define PA2 _STM32_PIN(A, 2) |
|
|
#define PA1 _STM32_PIN(A, 1) |
|
|
#define PA3 _STM32_PIN(A, 3) |
|
|
#define PA2 _STM32_PIN(A, 2) |
|
|
#define PA4 _STM32_PIN(A, 4) |
|
|
#define PA3 _STM32_PIN(A, 3) |
|
|
#define PA5 _STM32_PIN(A, 5) |
|
|
#define PA4 _STM32_PIN(A, 4) |
|
|
#define PA6 _STM32_PIN(A, 6) |
|
|
#define PA5 _STM32_PIN(A, 5) |
|
|
#define PA7 _STM32_PIN(A, 7) |
|
|
#define PA6 _STM32_PIN(A, 6) |
|
|
#define PA8 _STM32_PIN(A, 8) |
|
|
#define PA7 _STM32_PIN(A, 7) |
|
|
#define PA9 _STM32_PIN(A, 9) |
|
|
#define PA8 _STM32_PIN(A, 8) |
|
|
#define PA10 _STM32_PIN(A, 10) |
|
|
#define PA9 _STM32_PIN(A, 9) |
|
|
#define PA11 _STM32_PIN(A, 11) |
|
|
#define PA10 _STM32_PIN(A, 10) |
|
|
#define PA12 _STM32_PIN(A, 12) |
|
|
#define PA11 _STM32_PIN(A, 11) |
|
|
#define PA13 _STM32_PIN(A, 13) |
|
|
#define PA12 _STM32_PIN(A, 12) |
|
|
#define PA14 _STM32_PIN(A, 14) |
|
|
#define PA13 _STM32_PIN(A, 13) |
|
|
#define PA15 _STM32_PIN(A, 15) |
|
|
#define PA14 _STM32_PIN(A, 14) |
|
|
|
|
|
#define PA15 _STM32_PIN(A, 15) |
|
|
#define PB0 _STM32_PIN(B, 0) |
|
|
#endif |
|
|
#define PB1 _STM32_PIN(B, 1) |
|
|
|
|
|
#define PB2 _STM32_PIN(B, 2) |
|
|
#ifndef PB0 |
|
|
#define PB3 _STM32_PIN(B, 3) |
|
|
#define PB0 _STM32_PIN(B, 0) |
|
|
#define PB4 _STM32_PIN(B, 4) |
|
|
#define PB1 _STM32_PIN(B, 1) |
|
|
#define PB5 _STM32_PIN(B, 5) |
|
|
#define PB2 _STM32_PIN(B, 2) |
|
|
#define PB6 _STM32_PIN(B, 6) |
|
|
#define PB3 _STM32_PIN(B, 3) |
|
|
#define PB7 _STM32_PIN(B, 7) |
|
|
#define PB4 _STM32_PIN(B, 4) |
|
|
#define PB8 _STM32_PIN(B, 8) |
|
|
#define PB5 _STM32_PIN(B, 5) |
|
|
#define PB9 _STM32_PIN(B, 9) |
|
|
#define PB6 _STM32_PIN(B, 6) |
|
|
#define PB10 _STM32_PIN(B, 10) |
|
|
#define PB7 _STM32_PIN(B, 7) |
|
|
#define PB11 _STM32_PIN(B, 11) |
|
|
#define PB8 _STM32_PIN(B, 8) |
|
|
#define PB12 _STM32_PIN(B, 12) |
|
|
#define PB9 _STM32_PIN(B, 9) |
|
|
#define PB13 _STM32_PIN(B, 13) |
|
|
#define PB10 _STM32_PIN(B, 10) |
|
|
#define PB14 _STM32_PIN(B, 14) |
|
|
#define PB11 _STM32_PIN(B, 11) |
|
|
#define PB15 _STM32_PIN(B, 15) |
|
|
#define PB12 _STM32_PIN(B, 12) |
|
|
|
|
|
#define PB13 _STM32_PIN(B, 13) |
|
|
#define PC0 _STM32_PIN(C, 0) |
|
|
#define PB14 _STM32_PIN(B, 14) |
|
|
#define PC1 _STM32_PIN(C, 1) |
|
|
#define PB15 _STM32_PIN(B, 15) |
|
|
#define PC2 _STM32_PIN(C, 2) |
|
|
#endif |
|
|
#define PC3 _STM32_PIN(C, 3) |
|
|
|
|
|
#define PC4 _STM32_PIN(C, 4) |
|
|
#ifndef PC0 |
|
|
#define PC5 _STM32_PIN(C, 5) |
|
|
#define PC0 _STM32_PIN(C, 0) |
|
|
#define PC6 _STM32_PIN(C, 6) |
|
|
#define PC1 _STM32_PIN(C, 1) |
|
|
#define PC7 _STM32_PIN(C, 7) |
|
|
#define PC2 _STM32_PIN(C, 2) |
|
|
#define PC8 _STM32_PIN(C, 8) |
|
|
#define PC3 _STM32_PIN(C, 3) |
|
|
#define PC9 _STM32_PIN(C, 9) |
|
|
#define PC4 _STM32_PIN(C, 4) |
|
|
#define PC10 _STM32_PIN(C, 10) |
|
|
#define PC5 _STM32_PIN(C, 5) |
|
|
#define PC11 _STM32_PIN(C, 11) |
|
|
#define PC6 _STM32_PIN(C, 6) |
|
|
#define PC12 _STM32_PIN(C, 12) |
|
|
#define PC7 _STM32_PIN(C, 7) |
|
|
#define PC13 _STM32_PIN(C, 13) |
|
|
#define PC8 _STM32_PIN(C, 8) |
|
|
#define PC14 _STM32_PIN(C, 14) |
|
|
#define PC9 _STM32_PIN(C, 9) |
|
|
#define PC15 _STM32_PIN(C, 15) |
|
|
#define PC10 _STM32_PIN(C, 10) |
|
|
|
|
|
#define PC11 _STM32_PIN(C, 11) |
|
|
#define PD0 _STM32_PIN(D, 0) |
|
|
#define PC12 _STM32_PIN(C, 12) |
|
|
#define PD1 _STM32_PIN(D, 1) |
|
|
#define PC13 _STM32_PIN(C, 13) |
|
|
#define PD2 _STM32_PIN(D, 2) |
|
|
#define PC14 _STM32_PIN(C, 14) |
|
|
#define PD3 _STM32_PIN(D, 3) |
|
|
#define PC15 _STM32_PIN(C, 15) |
|
|
#define PD4 _STM32_PIN(D, 4) |
|
|
#endif |
|
|
#define PD5 _STM32_PIN(D, 5) |
|
|
|
|
|
#define PD6 _STM32_PIN(D, 6) |
|
|
#ifndef PD0 |
|
|
#define PD7 _STM32_PIN(D, 7) |
|
|
#define PD0 _STM32_PIN(D, 0) |
|
|
#define PD8 _STM32_PIN(D, 8) |
|
|
#define PD1 _STM32_PIN(D, 1) |
|
|
#define PD9 _STM32_PIN(D, 9) |
|
|
#define PD2 _STM32_PIN(D, 2) |
|
|
#define PD10 _STM32_PIN(D, 10) |
|
|
#define PD3 _STM32_PIN(D, 3) |
|
|
#define PD11 _STM32_PIN(D, 11) |
|
|
#define PD4 _STM32_PIN(D, 4) |
|
|
#define PD12 _STM32_PIN(D, 12) |
|
|
#define PD5 _STM32_PIN(D, 5) |
|
|
#define PD13 _STM32_PIN(D, 13) |
|
|
#define PD6 _STM32_PIN(D, 6) |
|
|
#define PD14 _STM32_PIN(D, 14) |
|
|
#define PD7 _STM32_PIN(D, 7) |
|
|
#define PD15 _STM32_PIN(D, 15) |
|
|
#define PD8 _STM32_PIN(D, 8) |
|
|
|
|
|
#define PD9 _STM32_PIN(D, 9) |
|
|
#define PE0 _STM32_PIN(E, 0) |
|
|
#define PD10 _STM32_PIN(D, 10) |
|
|
#define PE1 _STM32_PIN(E, 1) |
|
|
#define PD11 _STM32_PIN(D, 11) |
|
|
#define PE2 _STM32_PIN(E, 2) |
|
|
#define PD12 _STM32_PIN(D, 12) |
|
|
#define PE3 _STM32_PIN(E, 3) |
|
|
#define PD13 _STM32_PIN(D, 13) |
|
|
#define PE4 _STM32_PIN(E, 4) |
|
|
#define PD14 _STM32_PIN(D, 14) |
|
|
#define PE5 _STM32_PIN(E, 5) |
|
|
#define PD15 _STM32_PIN(D, 15) |
|
|
#define PE6 _STM32_PIN(E, 6) |
|
|
#endif |
|
|
#define PE7 _STM32_PIN(E, 7) |
|
|
|
|
|
#define PE8 _STM32_PIN(E, 8) |
|
|
#ifndef PE0 |
|
|
#define PE9 _STM32_PIN(E, 9) |
|
|
#define PE0 _STM32_PIN(E, 0) |
|
|
#define PE10 _STM32_PIN(E, 10) |
|
|
#define PE1 _STM32_PIN(E, 1) |
|
|
#define PE11 _STM32_PIN(E, 11) |
|
|
#define PE2 _STM32_PIN(E, 2) |
|
|
#define PE12 _STM32_PIN(E, 12) |
|
|
#define PE3 _STM32_PIN(E, 3) |
|
|
#define PE13 _STM32_PIN(E, 13) |
|
|
#define PE4 _STM32_PIN(E, 4) |
|
|
#define PE14 _STM32_PIN(E, 14) |
|
|
#define PE5 _STM32_PIN(E, 5) |
|
|
#define PE15 _STM32_PIN(E, 15) |
|
|
#define PE6 _STM32_PIN(E, 6) |
|
|
|
|
|
#define PE7 _STM32_PIN(E, 7) |
|
|
|
|
|
#define PE8 _STM32_PIN(E, 8) |
|
|
|
|
|
#define PE9 _STM32_PIN(E, 9) |
|
|
|
|
|
#define PE10 _STM32_PIN(E, 10) |
|
|
|
|
|
#define PE11 _STM32_PIN(E, 11) |
|
|
|
|
|
#define PE12 _STM32_PIN(E, 12) |
|
|
|
|
|
#define PE13 _STM32_PIN(E, 13) |
|
|
|
|
|
#define PE14 _STM32_PIN(E, 14) |
|
|
|
|
|
#define PE15 _STM32_PIN(E, 15) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#ifdef STM32F7 |
|
|
#ifdef STM32F7 |
|
|
#define PORTF 5 |
|
|
|
|
|
#define PORTG 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef PF0 |
|
|
|
|
|
#define PORTF 5 |
|
|
#define PF0 _STM32_PIN(F, 0) |
|
|
#define PF0 _STM32_PIN(F, 0) |
|
|
#define PF1 _STM32_PIN(F, 1) |
|
|
#define PF1 _STM32_PIN(F, 1) |
|
|
#define PF2 _STM32_PIN(F, 2) |
|
|
#define PF2 _STM32_PIN(F, 2) |
|
@ -171,7 +179,10 @@ |
|
|
#define PF13 _STM32_PIN(F, 13) |
|
|
#define PF13 _STM32_PIN(F, 13) |
|
|
#define PF14 _STM32_PIN(F, 14) |
|
|
#define PF14 _STM32_PIN(F, 14) |
|
|
#define PF15 _STM32_PIN(F, 15) |
|
|
#define PF15 _STM32_PIN(F, 15) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef PG0 |
|
|
|
|
|
#define PORTG 6 |
|
|
#define PG0 _STM32_PIN(G, 0) |
|
|
#define PG0 _STM32_PIN(G, 0) |
|
|
#define PG1 _STM32_PIN(G, 1) |
|
|
#define PG1 _STM32_PIN(G, 1) |
|
|
#define PG2 _STM32_PIN(G, 2) |
|
|
#define PG2 _STM32_PIN(G, 2) |
|
@ -188,5 +199,6 @@ |
|
|
#define PG13 _STM32_PIN(G, 13) |
|
|
#define PG13 _STM32_PIN(G, 13) |
|
|
#define PG14 _STM32_PIN(G, 14) |
|
|
#define PG14 _STM32_PIN(G, 14) |
|
|
#define PG15 _STM32_PIN(G, 15) |
|
|
#define PG15 _STM32_PIN(G, 15) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#endif // STM32GENERIC && STM32F7
|
|
|
#endif // STM32GENERIC && STM32F7
|
|
|