131 else if(GPIOx ==
GPIOB)
136 else if(GPIOx ==
GPIOC)
141 else if(GPIOx ==
GPIOD)
146 else if(GPIOx ==
GPIOE)
176 uint32_t pinpos = 0x00, pos = 0x00 , currentpin = 0x00;
177 uint32_t tmpreg = 0x00;
187 for (pinpos = 0x00; pinpos < 0x10; pinpos++)
189 pos = ((uint32_t)0x01) << pinpos;
192 currentpin = (GPIO_InitStruct->
GPIO_Pin) & pos;
194 if (currentpin == pos)
210 GPIOx->
OTYPER |= (uint16_t)(((uint16_t)GPIO_InitStruct->
GPIO_OType) << ((uint16_t)pinpos));
215 GPIOx->
MODER |= (((uint32_t)GPIO_InitStruct->
GPIO_Mode) << (pinpos * 2));
219 tmpreg = GPIOx->
PUPDR;
221 tmpreg |= (((uint32_t)GPIO_InitStruct->
GPIO_PuPd) << (pinpos * 2));
222 GPIOx->
PUPDR = tmpreg;
256 uint32_t tmp = 0x00010000;
302 uint8_t bitstatus = 0x00;
314 bitstatus = (uint8_t)Bit_RESET;
329 return ((uint16_t)GPIOx->
IDR);
343 uint8_t bitstatus = 0x00;
355 bitstatus = (uint8_t)Bit_RESET;
370 return ((uint16_t)GPIOx->
ODR);
451 GPIOx->
ODR = PortVal;
505 uint32_t
temp = 0x00;
506 uint32_t temp_2 = 0x00;
513 temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4));
514 GPIOx->
AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4));
515 temp_2 = GPIOx->
AFR[GPIO_PinSource >> 0x03] |
temp;
516 GPIOx->
AFR[GPIO_PinSource >> 0x03] = temp_2;
void GPIO_PinAFConfig(GPIO_TypeDef *GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
Changes the mapping of the specified pin.
GPIOOType_TypeDef GPIO_OType
#define IS_GPIO_MODE(MODE)
uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
Reads the specified input port pin.
#define IS_GPIO_OTYPE(OTYPE)
BitAction
GPIO Bit SET and Bit RESET enumeration.
#define RCC_AHBPeriph_GPIOF
#define IS_GPIO_ALL_PERIPH(PERIPH)
#define RCC_AHBPeriph_GPIOB
GPIOSpeed_TypeDef GPIO_Speed
void assert_param(int val)
void GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_InitStruct)
Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct.
#define GPIO_OSPEEDER_OSPEEDR0
#define RCC_AHBPeriph_GPIOC
void GPIO_StructInit(GPIO_InitTypeDef *GPIO_InitStruct)
Fills each GPIO_InitStruct member with its default value.
void GPIO_Write(GPIO_TypeDef *GPIOx, uint16_t PortVal)
Writes data to the specified GPIO data port.
#define GPIO_MODER_MODER0
This file contains all the functions prototypes for the GPIO firmware library.
This file contains all the functions prototypes for the RCC firmware library.
#define IS_GET_GPIO_PIN(PIN)
GPIO Init structure definition.
#define IS_GPIO_SPEED(SPEED)
void GPIO_WriteBit(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
Sets or clears the selected data port bit.
static volatile int16_t temp
#define RCC_AHBPeriph_GPIOD
#define GPIO_PUPDR_PUPDR0
void GPIO_PinLockConfig(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
Locks GPIO Pins configuration registers.
#define RCC_AHBPeriph_GPIOE
GPIOMode_TypeDef GPIO_Mode
#define IS_GPIO_BIT_ACTION(ACTION)
uint16_t GPIO_ReadInputData(GPIO_TypeDef *GPIOx)
Reads the specified GPIO input data port.
void GPIO_DeInit(GPIO_TypeDef *GPIOx)
De-initializes the GPIOx peripheral registers to their default reset values.
uint16_t GPIO_ReadOutputData(GPIO_TypeDef *GPIOx)
Reads the specified GPIO output data port.
void GPIO_ResetBits(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
Clears the selected data port bits.
#define RCC_AHBPeriph_GPIOA
GPIOPuPd_TypeDef GPIO_PuPd
void GPIO_SetBits(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
Sets the selected data port bits.
uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
Reads the specified output data port bit.
#define IS_GPIO_PUPD(PUPD)
#define IS_GPIO_LIST_PERIPH(PERIPH)
#define IS_GPIO_PIN_SOURCE(PINSOURCE)
void RCC_AHBPeriphResetCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState)
Forces or releases AHB peripheral reset.