More pin remappings
This commit is contained in:
@@ -111,6 +111,11 @@
|
|||||||
#define GPIO_PIN_SW_D_L (~GPIOE->IDR)
|
#define GPIO_PIN_SW_D_L (~GPIOE->IDR)
|
||||||
#define PIN_SW_D_H GPIO_Pin_9 //PE.09
|
#define PIN_SW_D_H GPIO_Pin_9 //PE.09
|
||||||
#define PIN_SW_D_L GPIO_Pin_8 //PE.08
|
#define PIN_SW_D_L GPIO_Pin_8 //PE.08
|
||||||
|
#elif defined(REVPLUS)
|
||||||
|
#define GPIO_PIN_SW_D_H (GPIOE->IDR)
|
||||||
|
#define GPIO_PIN_SW_D_L (GPIOE->IDR)
|
||||||
|
#define PIN_SW_D_H GPIO_Pin_7 //PE.07
|
||||||
|
#define PIN_SW_D_L GPIO_Pin_13 //PE.13
|
||||||
#else
|
#else
|
||||||
#define GPIO_PIN_SW_D_H GPIOE->IDR
|
#define GPIO_PIN_SW_D_H GPIOE->IDR
|
||||||
#define GPIO_PIN_SW_D_L GPIOB->IDR
|
#define GPIO_PIN_SW_D_L GPIOB->IDR
|
||||||
@@ -121,6 +126,9 @@
|
|||||||
#if defined(REV3)
|
#if defined(REV3)
|
||||||
#define GPIO_PIN_SW_H (~GPIOE->IDR)
|
#define GPIO_PIN_SW_H (~GPIOE->IDR)
|
||||||
#define PIN_SW_H GPIO_Pin_13 //PE.13
|
#define PIN_SW_H GPIO_Pin_13 //PE.13
|
||||||
|
#elif defined(REVPLUS)
|
||||||
|
#define GPIO_PIN_SW_H GPIOD->IDR
|
||||||
|
#define PIN_SW_H GPIO_Pin_14 //PD.14
|
||||||
#else
|
#else
|
||||||
#define GPIO_PIN_SW_H GPIOE->IDR
|
#define GPIO_PIN_SW_H GPIOE->IDR
|
||||||
#define PIN_SW_H GPIO_Pin_13 //PE.13
|
#define PIN_SW_H GPIO_Pin_13 //PE.13
|
||||||
@@ -139,6 +147,9 @@
|
|||||||
#else
|
#else
|
||||||
#define PIN_FLP_J2 GPIO_Pin_0 //PB.00
|
#define PIN_FLP_J2 GPIO_Pin_0 //PB.00
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(REVPLUS)
|
||||||
|
#define PIN_FLP_J3 GPIO_Pin_1 //PB.01
|
||||||
|
#endif
|
||||||
#define PIN_MVOLT GPIO_Pin_0 //PC.00
|
#define PIN_MVOLT GPIO_Pin_0 //PC.00
|
||||||
#if defined(REV3)
|
#if defined(REV3)
|
||||||
#define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC
|
#define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC
|
||||||
@@ -156,8 +167,15 @@
|
|||||||
#define RCC_AHB1Periph_GPIOPWR RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD
|
#define RCC_AHB1Periph_GPIOPWR RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD
|
||||||
#define GPIOPWRLED GPIOC
|
#define GPIOPWRLED GPIOC
|
||||||
#define GPIOPWR GPIOD
|
#define GPIOPWR GPIOD
|
||||||
#define PIN_INT_RF_PWR GPIO_Pin_15
|
#define GPIO_EXT_RF_PWR GPIOD
|
||||||
#define PIN_EXT_RF_PWR GPIO_Pin_8
|
#define PIN_EXT_RF_PWR GPIO_Pin_8
|
||||||
|
#if defined(REVPLUS)
|
||||||
|
#define GPIO_INT_RF_PWR GPIOC
|
||||||
|
#define PIN_INT_RF_PWR GPIO_Pin_6
|
||||||
|
#else
|
||||||
|
#define GPIO_INT_RF_PWR GPIOD
|
||||||
|
#define PIN_INT_RF_PWR GPIO_Pin_15
|
||||||
|
#endif
|
||||||
|
|
||||||
// Trainer Port
|
// Trainer Port
|
||||||
#define GPIO_TR_INOUT GPIOC
|
#define GPIO_TR_INOUT GPIOC
|
||||||
@@ -219,11 +237,20 @@
|
|||||||
#define PIN_FS_DM GPIO_Pin_11 //PA.11
|
#define PIN_FS_DM GPIO_Pin_11 //PA.11
|
||||||
#define PIN_FS_DP GPIO_Pin_12 //PA.12
|
#define PIN_FS_DP GPIO_Pin_12 //PA.12
|
||||||
|
|
||||||
// BackLight PB8
|
// BackLight
|
||||||
|
#if defined (REVPLUS)
|
||||||
|
#define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOD
|
||||||
|
#define GPIO_Pin_BL GPIO_Pin_15 //PD.15
|
||||||
|
#define GPIOBL GPIOD
|
||||||
|
#define GPIO_PinSource_BL GPIO_PinSource15
|
||||||
|
#define GPIO_Pin_BLW GPIO_Pin_13 //PD.13
|
||||||
|
#define GPIO_PinSource_BLW GPIO_PinSource13
|
||||||
|
#else
|
||||||
#define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOB
|
#define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOB
|
||||||
#define GPIO_Pin_BL GPIO_Pin_8 //PB.08
|
#define GPIO_Pin_BL GPIO_Pin_8 //PB.08
|
||||||
#define GPIOBL GPIOB
|
#define GPIOBL GPIOB
|
||||||
#define GPIO_PinSource_BL GPIO_PinSource8
|
#define GPIO_PinSource_BL GPIO_PinSource8
|
||||||
|
#endif
|
||||||
|
|
||||||
// LCD
|
// LCD
|
||||||
#if defined(REVPLUS)
|
#if defined(REVPLUS)
|
||||||
|
|||||||
@@ -66,13 +66,21 @@ void pwrInit()
|
|||||||
GPIO_Init(GPIOPWRLED, &GPIO_InitStructure);
|
GPIO_Init(GPIOPWRLED, &GPIO_InitStructure);
|
||||||
|
|
||||||
#if !defined(REV3)
|
#if !defined(REV3)
|
||||||
GPIO_ResetBits(GPIOPWR, PIN_INT_RF_PWR | PIN_EXT_RF_PWR);
|
GPIO_ResetBits(GPIO_INT_RF_PWR, PIN_INT_RF_PWR;
|
||||||
GPIO_InitStructure.GPIO_Pin = PIN_INT_RF_PWR | PIN_EXT_RF_PWR;
|
GPIO_InitStructure.GPIO_Pin = PIN_INT_RF_PWR;
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||||
GPIO_Init(GPIOPWR, &GPIO_InitStructure);
|
GPIO_Init(GPIO_INT_RF_PWR, &GPIO_InitStructure);
|
||||||
|
|
||||||
|
GPIO_ResetBits(GPIO_EXT_RF_PWR, PIN_EXT_RF_PWR);
|
||||||
|
GPIO_InitStructure.GPIO_Pin = PIN_EXT_RF_PWR;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||||
|
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||||
|
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||||
|
GPIO_Init(GPIO_EXT_RF_PWR, &GPIO_InitStructure);
|
||||||
|
|
||||||
GPIO_InitStructure.GPIO_Pin = PIN_TRNDET;
|
GPIO_InitStructure.GPIO_Pin = PIN_TRNDET;
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||||
|
|||||||
Reference in New Issue
Block a user