Re-use of the PB3/PB4/PA13/PA14/PA15 pin of the GPIO initialization--version of the Register

Source: Internet
Author: User
Tags mapr

In order to save IO Resources single-chip opportunity in one IO multiplexing a lot of functions, the general microcontroller with a function can be reused after two functions, which reflects the power of the STM32 Gpio, we use a remap method to map one of the peripherals to the other IO feet, This allows you to take full advantage of on-chip resources!

The following code can be implemented JETG pin, used as a normal pin to use, simple 3 lines of code, the version of the library function is much better.

rcc->apb2enr|=1; Turn on multiplexing function Afio clock
flash->acr|=0x32; Delay 2 Clock cycles
afio->mapr&=0xf8ffffff; Removing the PB34 function of the complex
afio->mapr|=0xf4ffffff;

Re-use of the PB3/PB4/PA13/PA14/PA15 pin of the GPIO initialization--version of the Register

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.