Skip to content

Instantly share code, notes, and snippets.

@utkarshsethi
Last active June 5, 2021 15:43
Show Gist options
  • Save utkarshsethi/dc09c9caa9944b6a22b0fb8acabffd14 to your computer and use it in GitHub Desktop.
Save utkarshsethi/dc09c9caa9944b6a22b0fb8acabffd14 to your computer and use it in GitHub Desktop.
STM32 CMSIS CHEATSHEET
USART:
//BRR = (Pclk + (BaudRate / 2)) / BaudRate
static uint16_t calc_brr(uint32_t Pclk, uint32_t BaudRate)
{
uint16_t brr = (Pclk + (BaudRate / 2)) / BaudRate;
return brr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment