首页 > 解决方案 > how do i write a binary number to STM32 GPIO

问题描述

I want to control a 4 bit multiplexer with my nucleo board. I understand I have to write either to the higher or lower parts of the BSRR resgister, to set bits high and set bits low.

I want to increment some variable, say multp_select and then output it to GPIOA (in AVR I can do this just by writing PORTA = multp_select for example) what is the best way to do this?

标签: cembeddedstm32

解决方案


Use the register ODR instead.

My advice is: read the Reference Manual - everything is described there.


推荐阅读