![ARTERY AT32F421 GPIO User Manual Download Page 16](http://html1.mh-extra.com/html/artery/at32f421-gpio/at32f421-gpio_user-manual_2977597016.webp)
AT32F421 GPIO user guide
2020.07.30
16
Rev.1.0.0
/* Connect PB6 to TMR1_BKIN */
GPIO_PinAFConfig(GPIOB, GPIO_PinsSource6, GPIO_AF_1);
/* Connect PB7 to TMR1_CH1 */
GPIO_PinAFConfig(GPIOB, GPIO_PinsSource7, GPIO_AF_1);
/* Configure I2C1_SCL and I2C1_SDA as alternate functions. Note that I2C pin should be open-drain
output */
GPIO_InitStructure.GPIO_Pins = GPIO_Pins_6 | GPIO_Pins_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OutType = GPIO_OutType_OD;
GPIO_InitStructure.GPIO_Pull = GPIO_Pull_NOPULL;
GPIO_InitStructure.GPIO_MaxSpeed = GPIO_MaxSpeed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);