|
|
|
@ -28,15 +28,15 @@
|
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
|
|
|
/* Output Maximum frequency selection ----------------------------------------*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
GPIO_Speed_10MHz = 1,
|
|
|
|
|
GPIO_Speed_2MHz,
|
|
|
|
|
GPIO_Speed_2MHz,
|
|
|
|
|
GPIO_Speed_50MHz
|
|
|
|
|
}GPIOSpeed_TypeDef;
|
|
|
|
|
|
|
|
|
|
#define IS_GPIO_SPEED(SPEED) ((SPEED == GPIO_Speed_10MHz) || (SPEED == GPIO_Speed_2MHz) || \
|
|
|
|
|
(SPEED == GPIO_Speed_50MHz))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Configuration Mode enumeration --------------------------------------------*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{ GPIO_Mode_AIN = 0x0,
|
|
|
|
@ -53,7 +53,7 @@ typedef enum
|
|
|
|
|
(MODE == GPIO_Mode_IPD) || (MODE == GPIO_Mode_IPU) || \
|
|
|
|
|
(MODE == GPIO_Mode_Out_OD) || (MODE == GPIO_Mode_Out_PP) || \
|
|
|
|
|
(MODE == GPIO_Mode_AF_OD) || (MODE == GPIO_Mode_AF_PP))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* GPIO Init structure definition */
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
@ -90,7 +90,7 @@ typedef enum
|
|
|
|
|
#define GPIO_Pin_All ((u16)0xFFFF) /* All pins selected */
|
|
|
|
|
|
|
|
|
|
#define IS_GPIO_PIN(PIN) (((PIN & (u16)0x00) == 0x00) && (PIN != (u16)0x00))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* GPIO Remap define ---------------------------------------------------------*/
|
|
|
|
|
#define GPIO_Remap_SPI1 ((u32)0x00000001) /* SPI1 Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap_I2C1 ((u32)0x00000002) /* I2C1 Alternate Function mapping */
|
|
|
|
@ -106,7 +106,7 @@ typedef enum
|
|
|
|
|
#define GPIO_PartialRemap_TIM3 ((u32)0x001A0800) /* TIM3 Partial Alternate Function mapping */
|
|
|
|
|
#define GPIO_FullRemap_TIM3 ((u32)0x001A0C00) /* TIM3 Full Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap_TIM4 ((u32)0x00001000) /* TIM4 Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap1_CAN ((u32)0x001D2000) /* CAN Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap1_CAN ((u32)0x001D4000) /* CAN Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap2_CAN ((u32)0x001D6000) /* CAN Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap_PD01 ((u32)0x00008000) /* PD01 Alternate Function mapping */
|
|
|
|
|
#define GPIO_Remap_SWJ_NoJTRST ((u32)0x00300100) /* Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST */
|
|
|
|
@ -123,7 +123,7 @@ typedef enum
|
|
|
|
|
(REMAP == GPIO_Remap1_CAN) || (REMAP == GPIO_Remap2_CAN) || \
|
|
|
|
|
(REMAP == GPIO_Remap_PD01) || (REMAP == GPIO_Remap_SWJ_NoJTRST) || \
|
|
|
|
|
(REMAP == GPIO_Remap_SWJ_JTAGDisable) || (REMAP == GPIO_Remap_SWJ_Disable))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* GPIO Port Sources ---------------------------------------------------------*/
|
|
|
|
|
#define GPIO_PortSourceGPIOA ((u8)0x00)
|
|
|
|
|
#define GPIO_PortSourceGPIOB ((u8)0x01)
|
|
|
|
@ -136,7 +136,7 @@ typedef enum
|
|
|
|
|
(PORTSOURCE == GPIO_PortSourceGPIOC) || \
|
|
|
|
|
(PORTSOURCE == GPIO_PortSourceGPIOD) || \
|
|
|
|
|
(PORTSOURCE == GPIO_PortSourceGPIOE))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* GPIO Pin sources ----------------------------------------------------------*/
|
|
|
|
|
#define GPIO_PinSource0 ((u8)0x00)
|
|
|
|
|
#define GPIO_PinSource1 ((u8)0x01)
|
|
|
|
@ -171,7 +171,7 @@ typedef enum
|
|
|
|
|
(PINSOURCE == GPIO_PinSource13) || \
|
|
|
|
|
(PINSOURCE == GPIO_PinSource14) || \
|
|
|
|
|
(PINSOURCE == GPIO_PinSource15))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
|
|
|
/* Exported functions ------------------------------------------------------- */
|
|
|
|
|
void GPIO_DeInit(GPIO_TypeDef* GPIOx);
|
|
|
|
|