GPIOC_CRL CNF2[1:0]
STM32F103RB
Hi. I tried to learn register level programming and got a problem with Port configuration register.
hire is my codes:
#include "stm32f1xx_hal.h"
int main(void){
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
GPIOC->CRL=0;
GPIOC->CRL = GPIO_CRL_MODE2 | GPIO_CRL_MODE3;
//GPIOC->CRL |= GPIO_CRL_CNF2_0 | GPIO_CRL_CNF3_0;
//when I set other then 00 it not generating pulses. I want to set it output Open-drain.
while (1){
GPIOC->BSRR|=GPIO_PIN_2<<16;
GPIOC->BSRR|=GPIO_PIN_2;
GPIOC->BSRR|=GPIO_PIN_3<<16;
GPIOC->BSRR|=GPIO_PIN_3;
}
}
