#include MY_USART_Init( USART_InitTypeDef USART_InitStrue; NVIC_InitTypeDef NVIC_InitStrue; |=GPIO_Mode_AF_PP; GPIO_InitStrue.GPIO_Pin=GPIO_Pin_9; GPIO_InitStrue.GPIO_Speed=GPIO_Speed_50MHz; GPIO_Init(GPIOA,&=GPIO_Mode_IN_FLOATING; GPIO_InitStrue.GPIO_Pin=GPIO_Pin_10; GPIO_Init(GPIOA,&=; USART_InitStrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None; USART_InitStrue.USART_Mode=USART_Mode_Rx|USART_Mode_Tx; USART_InitStrue.USART_Parity=USART_Parity_No; USART_InitStrue.USART_StopBits=USART_StopBits_1; USART_InitStrue.USART_WordLength=USART_WordLength_8b; USART_Init(USART1,&USART_InitStrue); =USART1_IRQn; NVIC_InitStrue.NVIC_IRQChannelCmd=ENABLE; NVIC_InitStrue.NVIC_IRQChannelPreemptionPriority=; NVIC_InitStrue.NVIC_IRQChannelSubPriority=; NVIC_Init(&NVIC_InitStrue); USART1_IRQHandler() (USART_GetITStatus(USART1,USART_IT_RXNE))=USART_ReceiveData(USART1); USART_SendData(USART1,DATA); main() MY_USART_Init(); ();
#include MY_USART_Init( USART_InitTypeDef USART_InitStrue; NVIC_InitTypeDef NVIC_InitStrue; |=GPIO_Mode_AF_PP; GPIO_InitStrue.GPIO_Pin=GPIO_Pin_9; GPIO_InitStrue.GPIO_Speed=GPIO_Speed_50MHz; GPIO_Init(GPIOA,&=GPIO_Mode_IN_FLOATING; GPIO_InitStrue.GPIO_Pin=GPIO_Pin_10; GPIO_Init(GPIOA,&=; USART_InitStrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None; USART_InitStrue.USART_Mode=USART_Mode_Rx|USART_Mode_Tx; USART_InitStrue.USART_Parity=USART_Parity_No; USART_InitStrue.USART_StopBits=USART_StopBits_1; USART_InitStrue.USART_WordLength=USART_WordLength_8b; USART_Init(USART1,&USART_InitStrue); =USART1_IRQn; NVIC_InitStrue.NVIC_IRQChannelCmd=ENABLE; NVIC_InitStrue.NVIC_IRQChannelPreemptionPriority=; NVIC_InitStrue.NVIC_IRQChannelSubPriority=; NVIC_Init(&NVIC_InitStrue); USART1_IRQHandler() (USART_GetITStatus(USART1,USART_IT_RXNE))=USART_ReceiveData(USART1); USART_SendData(USART1,DATA); main() MY_USART_Init(); ();
举报