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

fix: Cygnet USER_BTN mapping #2530

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ WEAK const PinMap PinMap_TIM[] = {
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - CHARGE_DETECT
{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N - D11
{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N - A4
// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - USER_BTN
// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - USB_DETECT
// {PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 1)}, // TIM16_CH1N - SCL
{PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1 - D5
// {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - LPUART1_VCP_RX
Expand Down Expand Up @@ -156,7 +156,7 @@ WEAK const PinMap PinMap_UART_RTS[] = {
// {PA_15, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // - CHARGE_DETECT
{PB_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // - A4
{PB_1_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // - A4
// {PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // - USER_BTN
// {PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // - USB_DETECT
// {PB_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // - NC
{PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // - D9
{NC, NP, 0}
Expand Down Expand Up @@ -204,8 +204,8 @@ WEAK const PinMap PinMap_SPI_MISO[] = {
WEAK const PinMap PinMap_SPI_SCLK[] = {
{PA_1, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // - A1
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // - CK
// {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // - USER_BTN
// {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, // - USER_BTN
// {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // - USB_DETECT
// {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, // - USB_DETECT
// {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // - LPUART1_VCP_RX
{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // - D10
{NC, NP, 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ const PinName digitalPin[] = {
PA_13, // 21 - SWDIO
PA_14, // 22 - SWCLK
PA_15, // 23 - CHARGE_DETECT
PB_3, // 24 - USER_BTN
PB_3, // 24 - USB_DETECT
PB_5, // 25 - MO
PB_6, // 26 - SCL
PB_7, // 27 - SDA
PB_10, // 28 - LPUART1_VCP_RX
PB_11, // 29 - LPUART1_VCP_TX
PC_13, // 30 - USB_DETECT
PC_13, // 30 - USER_BTN
PC_14, // 31 - OSC32_IN
PC_15, // 32 - OSC32_OUT
PH_0, // 33 - ENABLE_3V3
Expand Down Expand Up @@ -85,8 +85,8 @@ WEAK void initVariant(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pin = GPIO_PIN_1;
HAL_GPIO_Init(GPIOH, &GPIO_InitStruct); /* PH1 DISCHARGE_3V3 */
GPIO_InitStruct.Pin = GPIO_PIN_13;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* PC13 is USB_DETECT */
GPIO_InitStruct.Pin = GPIO_PIN_3;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /* PB3 is USB_DETECT */
GPIO_InitStruct.Pin = GPIO_PIN_15;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* PA15 is CHARGE_DETECT */
GPIO_InitStruct.Pin = GPIO_PIN_4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
#define PA13 21 // SWDIO
#define PA14 22 // SWCLK
#define PA15 23 // CHARGE_DETECT
#define PB3 24 // USER_BTN
#define PB3 24 // USB_DETECT
#define PB5 25 // MO
#define PB6 26 // SCL
#define PB7 27 // SDA
#define PB10 28 // LPUART1_VCP_RX
#define PB11 29 // LPUART1_VCP_TX
#define PC13 30 // USB_DETECT
#define PC13 30 // USER_BTN
#define PC14 31 // OSC32_IN
#define PC15 32 // OSC32_OUT
#define PH0 33 // ENABLE_3V3
Expand Down Expand Up @@ -83,7 +83,7 @@

// On-board user button
#ifndef USER_BTN
#define USER_BTN PB3
#define USER_BTN PC13
#endif

// Power switch ENABLE and DISCHARGE pins
Expand Down
Loading