AnsweredAssumed Answered

Use of the same port both input and output

Question asked by lapiana.francesco on Aug 6, 2015
Latest reply on Aug 11, 2015 by Clive One
Hello,
I need use a port both input and output. What should I do?
Should I use something like this?
GPIO_InitTypeDef GPIO_InitStructure;
  
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
  
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOA, &GPIO_InitStructure);


Can I use GPIO_ReadInputData, GPIO_SetBits and GPIO_ResetBits now?

Outcomes