Skip to content

Commit 5c29ed8

Browse files
justinkimCruz Monrreal II
authored andcommitted
add GPIO Pad Type Define & fix typo
1 parent 822bf98 commit 5c29ed8

File tree

1 file changed

+18
-1
lines changed
  • targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library

1 file changed

+18
-1
lines changed

targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,40 @@ typedef enum
6868
GPIO_PuPd_UP = Px_PCR_PUPD_UP,
6969
GPIO_PuPd_DOWN = Px_PCR_PUPD_DOWN,
7070
GPIO_PuPd_Default = 0x0ul,
71+
GPIO_DS = Px_PCR_DS_HIGH,
72+
GPIO_IE = Px_PCR_IE,
73+
GPIO_SUMMIT = Px_PCR_CS_SUMMIT
7174
}GPIOPad_TypeDef;
7275

76+
#define IS_GPIO_PUPD(PUPD) (((PUPD) == GPIO_PuPd_UP) || ((PUPD) == GPIO_PuPd_DOWN))
77+
7378
typedef struct
7479
{
7580
uint32_t GPIO_Pin;
7681
GPIOMode_TypeDef GPIO_Mode;
7782
GPIOPad_TypeDef GPIO_Pad;
7883
}GPIO_InitTypeDef;
7984

85+
typedef enum
86+
{
87+
Falling = 0,
88+
Rising = 1
89+
}GPIOPol_TypeDef;
90+
91+
typedef enum
92+
{
93+
Reset = 0,
94+
Set = 1
95+
}GPIOSet_TypeDef;
96+
8097
typedef enum
8198
{
8299
Bit_RESET = 0,
83100
Bit_SET
84101
}BitAction;
85102

86103

87-
#define IS_PAD_TYPE(Px) (((Px) == PAD_PA) || ((Px) == PAD_PB) \
104+
#define IS_PAD_TYPE(Px) (((Px) == PAD_PA) || ((Px) == PAD_PB) || \
88105
((Px) == PAD_PC) || ((Px) == PAD_PD))
89106

90107
#define IS_PA_NUM(NUM) (((NUM)>=0) && ((NUM)<16))

0 commit comments

Comments
 (0)