void Open_BT_RST(void) { GPIO_InitTypeDef GPIO_InitStruct; GPIO_CLK_CMD(PORT_BT_RST_CLK,ENABLE); GPIO_InitStruct.GPIO_Pin = PIN_BT_RST; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP; GPIO_Init(PORT_BT_RST, &GPIO_InitStruct); }
void Open_JP_RC(void) { GPIO_InitTypeDef GPIO_InitStruct; GPIO_CLK_CMD(PORT_JP_RC_CLK,ENABLE); GPIO_InitStruct.GPIO_Pin = PIN_JP_RC; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(PORT_JP_RC, &GPIO_InitStruct); }
void Open_Power_Detect(void) { GPIO_InitTypeDef GPIO_InitStruct; GPIO_CLK_CMD(PORT_POWER_FAIL_CLK,ENABLE); GPIO_InitStruct.GPIO_Pin = PIN_POWER_FAIL; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(PORT_JP_RC, &GPIO_InitStruct); }
void Init_LedBi(void) { GPIO_InitTypeDef GPIO_InitStruct; GPIO_CLK_CMD(PORT_LED1_CLK ,ENABLE); GPIO_InitStruct.GPIO_Pin = PIN_LED1; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(PORT_LED1, &GPIO_InitStruct); GPIO_ResetBits(PORT_LED1,PIN_LED1); GPIO_CLK_CMD(PORT_LED2_CLK ,ENABLE); GPIO_InitStruct.GPIO_Pin = PIN_LED2; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(PORT_LED2, &GPIO_InitStruct); GPIO_ResetBits(PORT_LED2,PIN_LED2); }
void gpio_setToOutput(gpio_Pin pin, GPIOSpeed_TypeDef speed, GPIOOType_TypeDef PPtype) { /* GPIOD Periph clock enable */ GPIO_CLK_CMD(pin->RRC_Periph, ENABLE); /* Configure in output pushpull mode */ GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = pin->Pin; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = PPtype; GPIO_InitStructure.GPIO_Speed = speed; GPIO_Init(pin->Port, &GPIO_InitStructure); }