Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
stm32:peripherals:gpio_output [2016/11/08 07:59] – [Programming Example] feur | stm32:peripherals:gpio_output [2022/12/28 08:17] (current) – ruan | ||
---|---|---|---|
Line 10: | Line 10: | ||
\\ {{gpio_output.svg}} \\ \\ | \\ {{gpio_output.svg}} \\ \\ | ||
- | ===== Programming | + | ===== Programming |
==== Enable Peripheral ==== | ==== Enable Peripheral ==== | ||
Line 17: | Line 17: | ||
* Enable GPIOx in '' | * Enable GPIOx in '' | ||
- | ==== Setup input mode ==== | + | ==== Setup output |
Configure the MODE and PUPDR as well as the output type and speed register, \\ for every pin that should act as digital output: | Configure the MODE and PUPDR as well as the output type and speed register, \\ for every pin that should act as digital output: | ||
Line 24: | Line 24: | ||
* Configure output type in '' | * Configure output type in '' | ||
* Configure output speed in '' | * Configure output speed in '' | ||
- | \\ | ||
- | |||
- | > {{logo_hal.svg? | ||
- | > [[https:// | ||
- | > [[https:// | ||
\\ | \\ | ||
===== Configuration Registers ===== | ===== Configuration Registers ===== | ||
- | ==== MODER ==== | + | ==== GPIOx_MODER - Port mode register |
- | + | ||
- | Mode register | + | |
\\ {{gpio_reg_common.svg}} \\ \\ | \\ {{gpio_reg_common.svg}} \\ \\ | ||
Line 42: | Line 35: | ||
|Pin x|01|Output mode| | |Pin x|01|Output mode| | ||
- | ==== PUPDR ==== | + | ==== GPIOx_PUPDR - Port pull-up / pull-down register |
- | + | ||
- | Push-up / pull-down register | + | |
\\ {{gpio_reg_common.svg}} \\ \\ | \\ {{gpio_reg_common.svg}} \\ \\ | ||
Line 54: | Line 45: | ||
|::: | |::: | ||
- | ==== OTYPER | + | ==== GPIOx_OTYPER - Port output type register |
- | + | ||
- | Output type register | + | |
\\ {{gpio_reg_otyper.svg}} \\ \\ | \\ {{gpio_reg_otyper.svg}} \\ \\ | ||
Line 64: | Line 53: | ||
|::: | |::: | ||
- | ==== OSPEEDR | + | ==== GPIOx_OSPEEDR - Port output speed register |
- | + | ||
- | Output speed register | + | |
\\ {{gpio_reg_common.svg}} \\ \\ | \\ {{gpio_reg_common.svg}} \\ \\ | ||
Line 78: | Line 65: | ||
===== Data Registers ===== | ===== Data Registers ===== | ||
- | ==== ODR ==== | + | ==== GPIOx_ODR - Port output data register |
- | + | ||
- | Output data register | + | |
\\ {{gpio_reg_odr.svg}} \\ \\ | \\ {{gpio_reg_odr.svg}} \\ \\ | ||
Line 88: | Line 73: | ||
|:::|1|Set pin x| | |:::|1|Set pin x| | ||
- | ==== BSRR ==== | + | ==== GPIOx_BSRR Port bit set / reset register |
- | + | ||
- | Bit set / reset register | + | |
\\ {{gpio_reg_bsrr.svg}} \\ \\ | \\ {{gpio_reg_bsrr.svg}} \\ \\ | ||
Line 100: | Line 83: | ||
|::: | |::: | ||
- | ===== Legend ===== | ||
- | |||
- | \\ {{legende.svg}} \\ \\ |