Skip to content

Commit 89113df

Browse files
committed
Review pin mapping
Move SDA/SCL to D14/D15 to be more Arduino compliant as it is the default. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent da60562 commit 89113df

File tree

2 files changed

+21
-33
lines changed

2 files changed

+21
-33
lines changed

variants/FEATHER_F405/variant.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ const PinName digitalPin[] = {
5252
PC_3,
5353
PC_2,
5454
PC_1, // D13
55-
PA_4, // D14 - A0
55+
PB_7, // D14 SDA
56+
PB_6, // D15 SCL
57+
PA_4, // D16 - A0
5658
PA_5,
5759
PA_6,
5860
PA_7,
5961
PC_4,
6062
PC_5,
61-
PA_3, // D20 - A6
62-
PB_6, // D21 SCL
63-
PB_7, // D22 SDA
63+
PA_3, // D22 - A6
6464
PB_13, // D23 SCK
6565
PB_14, // D24 MISO
6666
PB_15, // D25 MOSI

variants/FEATHER_F405/variant.h

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ extern "C" {
5858
#define PC2 12
5959
#define PC1 13
6060

61-
#define PA4 14 // A0
62-
#define PA5 15 // A1
63-
#define PA6 16 // A2
64-
#define PA7 17 // A3
65-
#define PC4 18 // A4
66-
#define PC5 19 // A5
67-
#define PA3 20 // A6 - VDIV
61+
#define PB7 14 // SDA
62+
#define PB6 15 // SCL
6863

69-
#define PB6 21 // SCL
70-
#define PB7 22 // SDA
64+
#define PA4 16 // A0
65+
#define PA5 17 // A1
66+
#define PA6 18 // A2
67+
#define PA7 19 // A3
68+
#define PC4 20 // A4
69+
#define PC5 21 // A5
70+
#define PA3 22 // A6 - VDIV
7171

7272
#define PB13 23 // SCK
7373
#define PB14 24 // MISO
@@ -95,7 +95,7 @@ extern "C" {
9595
#define NUM_DIGITAL_PINS 39
9696
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
9797
#define NUM_ANALOG_INPUTS 7
98-
#define NUM_ANALOG_FIRST 14
98+
#define NUM_ANALOG_FIRST 16
9999

100100
// Below ADC, DAC and PWM definitions already done in the core
101101
// Could be redefined here if needed
@@ -116,22 +116,16 @@ extern "C" {
116116
// On-board user button
117117
//#define BTN_K_UP PA0 - no user button
118118

119-
// Below SPI and I2C definitions already done in the core
120-
// Could be redefined here if differs from the default one
121119
// SPI Definitions
122120
#define PIN_SPI_MOSI PB15
123121
#define PIN_SPI_MISO PB14
124122
#define PIN_SPI_SCK PB13
125123
#define PIN_SPI_SS PA15
126124

127-
#define PIN_SPI1_MOSI PB5
128-
#define PIN_SPI1_MISO PB4
129-
#define PIN_SPI1_SCK PB3
130-
#define PIN_SPI1_SS PA15
131-
132-
// I2C Definitions
133-
#define PIN_WIRE_SDA PB7
134-
#define PIN_WIRE_SCL PB6
125+
#define PIN_SPI1_MOSI PB5
126+
#define PIN_SPI1_MISO PB4
127+
#define PIN_SPI1_SCK PB3
128+
#define PIN_SPI1_SS PA15
135129

136130
// Timer Definitions
137131
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
@@ -140,15 +134,9 @@ extern "C" {
140134

141135
// UART Definitions
142136
// Define here Serial instance number to map on Serial generic name
143-
#define SERIAL_UART_INSTANCE 3 //ex: 2 for Serial2 (USART2)
144-
// DEBUG_UART could be redefined to print on another instance than 'Serial'
145-
//#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3
146-
// DEBUG_UART baudrate, default: 9600 if not defined
147-
//#define DEBUG_UART_BAUDRATE x
148-
// DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART
149-
//#define DEBUG_PINNAME_TX PX_n // PinName used for TX
150-
151-
// Default pin used for 'Serial' instance (ex: ST-Link)
137+
#define SERIAL_UART_INSTANCE 3
138+
139+
// Default pin used for 'Serial' instance
152140
// Mandatory for Firmata
153141
#define PIN_SERIAL_RX PB11
154142
#define PIN_SERIAL_TX PB10

0 commit comments

Comments
 (0)