Deep parsing of Stm32 port remapping

Source: Internet
Author: User

Due to project needs, I need to remap Usart3 ports PB10 and PB11 to PC10 and PC11, according to the official information, this is a partial re-image:

, first turn on the Apio clock:

Rcc_apb2periphclockcmd (RCC_APB2PERIPH_GPIOC | rcc_apb2periph_afio,enable); Then you need to set the port Gpio_initstructure.gpio_pin = gpio_pin_10; Gpio_initstructure.gpio_mode = gpio_mode_af_pp; Gpio_initstructure.gpio_speed = Gpio_speed_50mhz; Gpio_init (GPIOC, &gpio_initstructure); Gpio_initstructure.gpio_pin = Gpio_pin_11; Gpio_initstructure.gpio_mode = gpio_mode_in_floating; Gpio_init (GPIOC, &gpio_initstructure);    Turn on port remapping Gpio_pinremapconfig (gpio_partialremap_usart3,enable) when you need to use a remap port; Gpio_partialremap_usart3 for USART3 multiplexing function partial mapping//gpio_fullremap_usart3 full mapping//when no mapping is needed, when used, resets the mapping to the bit, Gpio_ Afiodeinit (); Just open it again when you want to use it.


Deep parsing of Stm32 port remapping

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.