Lines Matching refs:GPIOx

100 void GPIO_DeInit(GPIO_TypeDef* GPIOx)  in GPIO_DeInit()  argument
103 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_DeInit()
105 switch (*(uint32_t*)&GPIOx) in GPIO_DeInit()
138 void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) in GPIO_Init() argument
143 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_Init()
160 tmpreg = GPIOx->CRL; in GPIO_Init()
177 GPIOx->BRR = (((uint32_t)0x01) << pinpos); in GPIO_Init()
184 GPIOx->BSRR = (((uint32_t)0x01) << pinpos); in GPIO_Init()
189 GPIOx->CRL = tmpreg; in GPIO_Init()
195 tmpreg = GPIOx->CRH; in GPIO_Init()
212 GPIOx->BRR = (((uint32_t)0x01) << (pinpos + 0x08)); in GPIO_Init()
217 GPIOx->BSRR = (((uint32_t)0x01) << (pinpos + 0x08)); in GPIO_Init()
221 GPIOx->CRH = tmpreg; in GPIO_Init()
244 GPIOx->BRR = (((uint32_t)0x01) << pinpos); in GPIO_Init()
251 GPIOx->BSRR = (((uint32_t)0x01) << pinpos); in GPIO_Init()
281 uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) in GPIO_ReadInputDataBit() argument
286 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_ReadInputDataBit()
289 if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)Bit_RESET) in GPIO_ReadInputDataBit()
305 uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx) in GPIO_ReadInputData() argument
308 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_ReadInputData()
310 return ((uint16_t)GPIOx->IDR); in GPIO_ReadInputData()
320 uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) in GPIO_ReadOutputDataBit() argument
324 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_ReadOutputDataBit()
327 if ((GPIOx->ODR & GPIO_Pin) != (uint32_t)Bit_RESET) in GPIO_ReadOutputDataBit()
343 uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx) in GPIO_ReadOutputData() argument
346 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_ReadOutputData()
348 return ((uint16_t)GPIOx->ODR); in GPIO_ReadOutputData()
359 void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint32_t GPIO_Pin) in GPIO_SetBits() argument
362 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_SetBits()
366 GPIOx->BSRR = GPIO_Pin; in GPIO_SetBits()
378 void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint32_t GPIO_Pin) in GPIO_ResetBits() argument
381 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_ResetBits()
383 GPIOx->BRR = GPIO_Pin; in GPIO_ResetBits()
397 void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal) in GPIO_WriteBit() argument
400 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_WriteBit()
406 GPIOx->BSRR = GPIO_Pin; in GPIO_WriteBit()
410 GPIOx->BRR = GPIO_Pin; in GPIO_WriteBit()
421 void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal) in GPIO_Write() argument
424 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_Write()
426 GPIOx->ODR = PortVal; in GPIO_Write()
437 void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) in GPIO_PinLockConfig() argument
442 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_PinLockConfig()
447 GPIOx->LCKR = tmp; in GPIO_PinLockConfig()
449 GPIOx->LCKR = GPIO_Pin; in GPIO_PinLockConfig()
451 GPIOx->LCKR = tmp; in GPIO_PinLockConfig()
453 tmp = GPIOx->LCKR; in GPIO_PinLockConfig()
455 tmp = GPIOx->LCKR; in GPIO_PinLockConfig()
486 void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint32_t GPIO_Pin, uint8_t GPIO_AF) in GPIO_PinAFConfig() argument
492 assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); in GPIO_PinAFConfig()
516 GPIOx->AFRH &= ~((uint32_t)0xF << ((uint32_t)(i<<2))); //AF配置占半字节,要x4,即<<2 in GPIO_PinAFConfig()
517 GPIOx->AFRH |= ((uint32_t)GPIO_AF << ((uint32_t)(i<<2))); in GPIO_PinAFConfig()
528 GPIOx->AFRL &= ~((uint32_t)0xF << ((uint32_t)(i<<2))); //AF配置占半字节,要x4,即<<2 in GPIO_PinAFConfig()
529 GPIOx->AFRL |= ((uint32_t)GPIO_AF << ((uint32_t)(i<<2))); in GPIO_PinAFConfig()