What is the difference control between ODR and BSRRL(BSRRH)
Hi
I'm currently working with STM32F429I-disco kit.
and testing about gpio control.
the below code is working well.
But I want to know
int main(void){RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); // GPIOG->CRL = 0x2800;GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 ;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;GPIO_Init(GPIOG, &GPIO_InitStructure);&sharpusing ODR
while (1)
{ if(GPIOA->IDR & GPIO_Pin_0) GPIOG->ODR =GPIO_Pin_14;else GPIOG->ODR = 0x00;}}
&sharpusing BSRR
while (1)
{if(GPIOA->IDR & GPIO_Pin_0)GPIOG->BSRRL = GPIO_Pin_14;elseGPIOG->BSRRH = 0xFFFF;}
My question is what is the difference between
ODR and BSRR?
#gpio