Skip to content

Instantly share code, notes, and snippets.

@hocarm
Created August 14, 2016 07:28
Show Gist options
  • Save hocarm/d9bf37c7271a408e1ee36264facdf44a to your computer and use it in GitHub Desktop.
Save hocarm/d9bf37c7271a408e1ee36264facdf44a to your computer and use it in GitHub Desktop.
// see stm32f10x_usart.h
USART_InitTypeDef USART_InitStructure;
// Initialize USART structure
USART_StructInit (& USART_InitStructure);
// Modify USART_InitStructure for non -default values , e.g.
// USART_InitStructure.USART_BaudRate = 38400;
USART_InitStructure.USART_BaudRate = 9600;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(USART1 ,& USART_InitStructure);
USART_Cmd(USART1 , ENABLE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment