亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32f10x_usart.c

?? 基于STM32的 模擬時序
?? C
?? 第 1 頁 / 共 3 頁
字號:
* Return         : None
*******************************************************************************/
void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_123_PERIPH(USARTx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the SC mode by setting the SCEN bit in the CR3 register */
    USARTx->CR3 |= CR3_SCEN_Set;
  }
  else
  {
    /* Disable the SC mode by clearing the SCEN bit in the CR3 register */
    USARTx->CR3 &= CR3_SCEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_SmartCardNACKCmd
* Description    : Enables or disables NACK transmission.
* Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
*                    peripheral. 
*                    Note: The Smart Card mode is not available for UART4 and UART5.
*                  - NewState: new state of the NACK transmission.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_123_PERIPH(USARTx));  
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the NACK transmission by setting the NACK bit in the CR3 register */
    USARTx->CR3 |= CR3_NACK_Set;
  }
  else
  {
    /* Disable the NACK transmission by clearing the NACK bit in the CR3 register */
    USARTx->CR3 &= CR3_NACK_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_HalfDuplexCmd
* Description    : Enables or disables the USART抯 Half Duplex communication.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - NewState: new state of the USART Communication.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Enable the Half-Duplex mode by setting the HDSEL bit in the CR3 register */
    USARTx->CR3 |= CR3_HDSEL_Set;
  }
  else
  {
    /* Disable the Half-Duplex mode by clearing the HDSEL bit in the CR3 register */
    USARTx->CR3 &= CR3_HDSEL_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_IrDAConfig
* Description    : Configures the USART抯 IrDA interface.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_IrDAMode: specifies the IrDA mode.
*                    This parameter can be one of the following values:
*                       - USART_IrDAMode_LowPower
*                       - USART_IrDAMode_Normal
* Output         : None
* Return         : None
*******************************************************************************/
void USART_IrDAConfig(USART_TypeDef* USARTx, u16 USART_IrDAMode)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_IRDA_MODE(USART_IrDAMode));
    
  USARTx->CR3 &= CR3_IRLP_Mask;
  USARTx->CR3 |= USART_IrDAMode;
}

/*******************************************************************************
* Function Name  : USART_IrDACmd
* Description    : Enables or disables the USART抯 IrDA interface.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - NewState: new state of the IrDA mode.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
    
  if (NewState != DISABLE)
  {
    /* Enable the IrDA mode by setting the IREN bit in the CR3 register */
    USARTx->CR3 |= CR3_IREN_Set;
  }
  else
  {
    /* Disable the IrDA mode by clearing the IREN bit in the CR3 register */
    USARTx->CR3 &= CR3_IREN_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_GetFlagStatus
* Description    : Checks whether the specified USART flag is set or not.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_FLAG: specifies the flag to check.
*                    This parameter can be one of the following values:
*                       - USART_FLAG_CTS:  CTS Change flag (not available for 
*                                          UART4 and UART5)
*                       - USART_FLAG_LBD:  LIN Break detection flag
*                       - USART_FLAG_TXE:  Transmit data register empty flag
*                       - USART_FLAG_TC:   Transmission Complete flag
*                       - USART_FLAG_RXNE: Receive data register not empty flag
*                       - USART_FLAG_IDLE: Idle Line detection flag
*                       - USART_FLAG_ORE:  OverRun Error flag
*                       - USART_FLAG_NE:   Noise Error flag
*                       - USART_FLAG_FE:   Framing Error flag
*                       - USART_FLAG_PE:   Parity Error flag
* Output         : None
* Return         : The new state of USART_FLAG (SET or RESET).
*******************************************************************************/
FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, u16 USART_FLAG)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_FLAG(USART_FLAG));
  assert_param(IS_USART_PERIPH_FLAG(USARTx, USART_FLAG)); /* The CTS flag is not available for UART4 and UART5 */   

  if ((USARTx->SR & USART_FLAG) != (u16)RESET)
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  return bitstatus;
}

/*******************************************************************************
* Function Name  : USART_ClearFlag
* Description    : Clears the USARTx's pending flags.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_FLAG: specifies the flag to clear.
*                    This parameter can be any combination of the following values:
*                       - USART_FLAG_CTS:  CTS Change flag (not available for
*                                          UART4 and UART5).
*                       - USART_FLAG_LBD:  LIN Break detection flag.
*                       - USART_FLAG_TC:   Transmission Complete flag.
*                       - USART_FLAG_RXNE: Receive data register not empty flag.
*
*                  Notes:
*                        - PE (Parity error), FE (Framing error), NE (Noise error),
*                          ORE (OverRun error) and IDLE (Idle line detected) 
*                          flags are cleared by software sequence: a read 
*                          operation to USART_SR register (USART_GetFlagStatus()) 
*                          followed by a read operation to USART_DR register 
*                          (USART_ReceiveData()).
*                        - RXNE flag can be also cleared by a read to the 
*                          USART_DR register (USART_ReceiveData()).
*                        - TC flag can be also cleared by software sequence: a 
*                          read operation to USART_SR register 
*                          (USART_GetFlagStatus()) followed by a write operation
*                          to USART_DR register (USART_SendData()).                                                      
*                        - TXE flag is cleared only by a write to the USART_DR 
*                          register (USART_SendData()).                        
* Output         : None
* Return         : None
*******************************************************************************/
void USART_ClearFlag(USART_TypeDef* USARTx, u16 USART_FLAG)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_CLEAR_FLAG(USART_FLAG));
  assert_param(IS_USART_PERIPH_FLAG(USARTx, USART_FLAG)); /* The CTS flag is not available for UART4 and UART5 */   
   
  USARTx->SR = (u16)~USART_FLAG;
}

/*******************************************************************************
* Function Name  : USART_GetITStatus
* Description    : Checks whether the specified USART interrupt has occurred or not.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_IT: specifies the USART interrupt source to check.
*                    This parameter can be one of the following values:
*                       - USART_IT_CTS:  CTS change interrupt (not available for 
*                                        UART4 and UART5)
*                       - USART_IT_LBD:  LIN Break detection interrupt
*                       - USART_IT_TXE:  Tansmit Data Register empty interrupt
*                       - USART_IT_TC:   Transmission complete interrupt
*                       - USART_IT_RXNE: Receive Data register not empty 
*                                        interrupt
*                       - USART_IT_IDLE: Idle line detection interrupt
*                       - USART_IT_ORE:  OverRun Error interrupt
*                       - USART_IT_NE:   Noise Error interrupt
*                       - USART_IT_FE:   Framing Error interrupt
*                       - USART_IT_PE:   Parity Error interrupt
* Output         : None
* Return         : The new state of USART_IT (SET or RESET).
*******************************************************************************/
ITStatus USART_GetITStatus(USART_TypeDef* USARTx, u16 USART_IT)
{
  u32 bitpos = 0x00, itmask = 0x00, usartreg = 0x00;
  ITStatus bitstatus = RESET;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_GET_IT(USART_IT));
  assert_param(IS_USART_PERIPH_IT(USARTx, USART_IT)); /* The CTS interrupt is not available for UART4 and UART5 */  
  
  /* Get the USART register index */
  usartreg = (((u8)USART_IT) >> 0x05);

  /* Get the interrupt position */
  itmask = USART_IT & IT_Mask;

  itmask = (u32)0x01 << itmask;
  
  if (usartreg == 0x01) /* The IT  is in CR1 register */
  {
    itmask &= USARTx->CR1;
  }
  else if (usartreg == 0x02) /* The IT  is in CR2 register */
  {
    itmask &= USARTx->CR2;
  }
  else /* The IT  is in CR3 register */
  {
    itmask &= USARTx->CR3;
  }
  
  bitpos = USART_IT >> 0x08;

  bitpos = (u32)0x01 << bitpos;
  bitpos &= USARTx->SR;

  if ((itmask != (u16)RESET)&&(bitpos != (u16)RESET))
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  
  return bitstatus;  
}

/*******************************************************************************
* Function Name  : USART_ClearITPendingBit
* Description    : Clears the USARTx抯 interrupt pending bits.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_IT: specifies the interrupt pending bit to clear.
*                    This parameter can be one of the following values:
*                       - USART_IT_CTS:  CTS change interrupt (not available for 
*                                        UART4 and UART5)
*                       - USART_IT_LBD:  LIN Break detection interrupt
*                       - USART_IT_TC:   Transmission complete interrupt. 
*                       - USART_IT_RXNE: Receive Data register not empty interrupt.
*                    
*                  Notes:
*                        - PE (Parity error), FE (Framing error), NE (Noise error),
*                          ORE (OverRun error) and IDLE (Idle line detected) 
*                          pending bits are cleared by software sequence: a read 
*                          operation to USART_SR register (USART_GetITStatus()) 
*                          followed by a read operation to USART_DR register 
*                          (USART_ReceiveData()).
*                        - RXNE pending bit can be also cleared by a read to the 
*                          USART_DR register (USART_ReceiveData()).
*                        - TC pending bit can be also cleared by software 
*                          sequence: a read operation to USART_SR register 
*                          (USART_GetITStatus()) followed by a write operation
*                          to USART_DR register (USART_SendData()).                                                      
*                        - TXE pending bit is cleared only by a write to the 
*                          USART_DR register (USART_SendData()).  
* Output         : None
* Return         : None
*******************************************************************************/
void USART_ClearITPendingBit(USART_TypeDef* USARTx, u16 USART_IT)
{
  u16 bitpos = 0x00, itmask = 0x00;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_CLEAR_IT(USART_IT));
  assert_param(IS_USART_PERIPH_IT(USARTx, USART_IT)); /* The CTS interrupt is not available for UART4 and UART5 */
  
  bitpos = USART_IT >> 0x08;

  itmask = (u16)((u16)0x01 << bitpos);
  USARTx->SR = (u16)~itmask;
}

/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲gay无套男同| 青青草精品视频| 欧美一区二区黄| bt7086福利一区国产| 日日骚欧美日韩| 国产精品久久久久桃色tv| 欧美高清视频不卡网| 成人精品国产福利| 久久精品99国产精品日本| 亚洲日本在线看| 中文字幕在线一区二区三区| 91精品国产麻豆国产自产在线| 97久久精品人人澡人人爽| 美女一区二区视频| 亚洲国产一区视频| 亚洲欧美日韩国产中文在线| 久久九九久精品国产免费直播| 5858s免费视频成人| 在线观看av一区二区| 豆国产96在线|亚洲| 国产自产2019最新不卡| 青青草97国产精品免费观看 | 国产欧美一区二区精品婷婷| 欧美浪妇xxxx高跟鞋交| 色婷婷精品大在线视频| 成人动漫视频在线| 成人午夜在线免费| 国产成人欧美日韩在线电影| 久久av中文字幕片| 免费在线观看不卡| 蜜芽一区二区三区| 捆绑调教美女网站视频一区| 欧美区视频在线观看| 欧美网站一区二区| 欧美性猛交xxxx黑人交| 91久久香蕉国产日韩欧美9色| 成人97人人超碰人人99| 国产经典欧美精品| 国产河南妇女毛片精品久久久| 国产一区二区三区免费观看| 精品一区二区三区在线播放视频| 免费观看在线综合色| 日本欧美加勒比视频| 日本不卡123| 麻豆精品久久精品色综合| 美女网站视频久久| 精品在线免费视频| 国产成人免费视频网站 | 欧美男生操女生| 91麻豆精品国产无毒不卡在线观看| 欧美日韩一区精品| 日韩欧美国产高清| 国产色综合久久| 欧美精品xxxxbbbb| 狠狠色综合色综合网络| 国产成人免费视频精品含羞草妖精 | 91在线精品秘密一区二区| 国产精品性做久久久久久| 国产成人一级电影| 国产成人在线影院| 成人99免费视频| 一本一道久久a久久精品| 在线免费观看日本欧美| 在线91免费看| 久久久99精品免费观看| 国产精品天美传媒沈樵| 亚洲一区二区三区美女| 爽爽淫人综合网网站| 狠狠色丁香婷婷综合久久片| 成人国产精品免费观看视频| 91福利精品视频| 欧美一区二区三区不卡| 久久精品人人做| 亚洲精品午夜久久久| 美女在线观看视频一区二区| 成人性生交大合| 在线电影欧美成精品| 久久久噜噜噜久久人人看| 亚洲男人的天堂一区二区| 男人的天堂久久精品| 成人精品国产一区二区4080| 欧美日韩大陆一区二区| 久久久久亚洲蜜桃| 亚洲男同性视频| 国内精品免费在线观看| 97国产精品videossex| 日韩一级黄色片| 国产精品福利在线播放| 日韩不卡在线观看日韩不卡视频| 国产91露脸合集magnet| 欧美电影影音先锋| 亚洲欧洲av在线| 精品无人码麻豆乱码1区2区| 91色乱码一区二区三区| 亚洲精品一区在线观看| 亚洲一区二区中文在线| 国产伦精品一区二区三区免费迷 | av男人天堂一区| 91精品国产欧美一区二区成人| 中文字幕五月欧美| 国产一区二区三区观看| 欧美精品日韩精品| 樱花影视一区二区| 成人免费视频国产在线观看| 日韩午夜在线观看视频| 亚洲一区二区五区| av中文字幕亚洲| 久久亚洲一区二区三区明星换脸| 亚洲动漫第一页| 不卡视频一二三| 久久老女人爱爱| 日韩电影免费一区| 欧美日韩一区二区三区高清| 亚洲图片你懂的| www.亚洲在线| 国产午夜精品一区二区三区嫩草| 国产在线一区观看| 亚洲精品中文在线观看| 国产激情91久久精品导航 | 精品中文字幕一区二区| 欧美日本乱大交xxxxx| 亚洲精品久久7777| 91香蕉视频黄| 中文字幕一区二区三区乱码在线 | 久久精品国产秦先生| 91精选在线观看| 日韩成人一级片| 这里只有精品免费| 五月婷婷另类国产| 欧美群妇大交群中文字幕| 亚洲成人精品一区| 欧美久久久久久久久久| 亚洲成人动漫在线观看| 欧美日韩免费电影| 日本怡春院一区二区| 69p69国产精品| 美女脱光内衣内裤视频久久网站| 欧美一区二区人人喊爽| 美国毛片一区二区| 欧美r级在线观看| 黑人精品欧美一区二区蜜桃 | 一区二区三区四区不卡在线| 99久久精品情趣| 一区二区三区电影在线播| 91福利社在线观看| 日日夜夜免费精品视频| 日韩欧美www| 岛国精品在线观看| 亚洲欧美色图小说| 欧美日韩大陆一区二区| 久久精品国产久精国产| 久久精品欧美一区二区三区麻豆| 国产不卡视频在线播放| 亚洲人成精品久久久久| 欧美亚洲另类激情小说| 日本美女一区二区三区| 久久综合国产精品| av亚洲精华国产精华精| 亚洲国产精品天堂| 日韩三级视频在线观看| 国产成人在线视频网站| 亚洲精品视频自拍| 欧美一级搡bbbb搡bbbb| 韩国av一区二区三区四区| 亚洲国产精品激情在线观看| 国产a视频精品免费观看| 亚洲三级在线看| 91精品黄色片免费大全| 黄一区二区三区| 亚洲欧美偷拍三级| 欧美剧在线免费观看网站| 国产剧情av麻豆香蕉精品| 亚洲综合在线电影| 精品国产乱码久久久久久浪潮| www.爱久久.com| 美腿丝袜在线亚洲一区| 亚洲人吸女人奶水| 日韩欧美激情四射| 色综合天天在线| 国内精品视频一区二区三区八戒| 亚洲三级在线免费| 精品sm捆绑视频| 在线看国产日韩| 国产成人小视频| 婷婷久久综合九色综合绿巨人| 2020国产精品自拍| 在线观看不卡视频| 国产成人av在线影院| 天天影视色香欲综合网老头| 中文字幕国产精品一区二区| 欧美二区三区的天堂| 91一区一区三区| 国产精品一色哟哟哟| 亚洲成av人片在线观看无码| 国产精品美女久久久久久2018| 日韩天堂在线观看| 在线区一区二视频| 成人影视亚洲图片在线| 久久国产人妖系列| 亚洲成人高清在线|