Question
Switching STM32F103 GPIO From Input and Output
Posted on June 13, 2016 at 02:06
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 asGPIO_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
RCC_APB2PeriphClockCmd(DATACLK, ENABLE);
//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?