2017-05-04 12:30 AM
Hi.
I can't find GPIO_PinAFConfig(). when i write it function, i don't find GPIO_AF parameter.
void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
{ uint32_t temp = 0x00; uint32_t temp_2 = 0x00; /* Check the parameters */ assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource)); assert_param(IS_GPIO_AF(GPIO_AF)); temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)); GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)); temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp; GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2;}2017-05-04 05:24 AM
I'm not sure what you are actually asking. You don't mention a specific part, pin or peripheral you are looking to configure.
The Data Sheet provides pin tables indicating the selections/options for each.
It takes the form
GPIO_PinAFConfig(GPIOB, GPIO_PinSource4, GPIO_AF_6);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_USART2);
2017-05-04 05:41 AM
Hi,
It seems you are missing pin configuration !! you should have the syntax form as mentioned by Clive