AnsweredAssumed Answered

Switching STM32F103 GPIO From Input and Output

Question asked by willbot on Jun 13, 2016
Latest reply on Jun 13, 2016 by willbot
Very new to STM32 development and am not an engineer, so apologies for what is likely a very silly question.

I'm attempting to use an STM32F103 as a programmable replacement for a game cartridge ROM. When switching from read I want to disconnect from the data bus. So I have my data port setup as GPIO_Mode_AF_PP as such:

void configure_gpio_data(void){
  //GPIO structure used to initialize port
  GPIO_InitTypeDef GPIO_InitStructure;
  //Enable clock on APB2 pripheral bus
  //Select pins to initialize
  GPIO_InitStructure.GPIO_Pin = DATA;
  //Select output mode
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  //Select speed
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
 //Call initialization
  GPIO_Init(DATAPORT, &GPIO_InitStructure);

And am attempting to switch with DATAPORT -> IDR and DATAPORT -> ODR. Where am I going wrong?