STM32103ZET6 port multiplexing and remapping

Port multiplexing

(1) Definition
STM32 has many built-in peripherals, external pins with the GPIO these peripherals are multiplexed. In other words, if a GPIO can be reused as a built-in peripheral function pin, then when the time GPIO as built-in peripheral use, is called multiplexing.

(2) Process Configuration

  1. Enable GPIO port clock.
  2. A peripheral clock enable multiplexing.
  3. Port mode configuration.

Remapping

(1) the definition of
each peripheral has built a number of input and output pins, these general output port pins are fixed, in order to allow design engineers to better organize and function pins, the STM32 introduced the notion peripheral pin remapping, i.e., a default peripheral pin addition port, but also by setting the register remapping manner, this pin is mapped to other peripheral port.

(2) partially and completely remap remapping
part remapping: Some pin function peripheral remapping, as well as part of the original default pin pin.
Completely remap: All pin function peripherals are re-mapped.

(3) Process Configuration

  1. GPIO clock enable (IO after remapping);
  2. Peripheral clock enable function (e.g., a serial port);
  3. Enable AFIO clock.
    1 remapping AFIO clock must be enabled: RCC_APB2PeriphClockCmd (RCC_APB2Periph_AFIO, the ENABLE);
    . 2 register AFIO_MAPR (alternate function remapping configuration), AFIO_EXTICRX (external interrupt mapping configuration) and AFIO_EVCR (EVENTOUT event output configuration) read before a write operation, it should first open AFIO clock.
  4. Open remapping
    GPIO_PinRemapConfig (GPIO_Remap_USART1, ENABLE);
    according to the first parameter, determining a portion or all remap remap
发布了4 篇原创文章 · 获赞 1 · 访问量 127

Guess you like

Origin blog.csdn.net/qq_44431690/article/details/104102574