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

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

?? stm32f10x_usart.c

?? STM32不完全手冊 例程源碼 29個
?? C
?? 第 1 頁 / 共 3 頁
字號:
* Function Name  : USART_SmartCardCmd
* Description    : Enables or disables the USART抯 Smart Card mode.
* 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 Smart Card mode.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* 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.
*                       - 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.
*
*                    Note: - For IDLE, ORE, NE, FE and PE flags user has to read 
*                          the USART DR register after calling this function.
*                          - TXE flag can't be cleared by this function, it's
*                          cleared only by a write to the USART DR register.                        
* 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_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.
*                       - 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.
*
*                    Note: - For IDLE, ORE, NE, FE and PE pending bits user has to 
*                            read the USART DR register after calling this function.
*                          - TXE pending bit can't be cleared by this function, it's
*                            cleared only by a write to the USART DR register.
* 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一区二区三区免费野_久草精品视频
中文字幕在线观看一区| 天堂午夜影视日韩欧美一区二区| 亚洲精品成人少妇| 蜜乳av一区二区三区| 99国产精品久久久久| 欧美成人a视频| 亚洲国产一区二区三区青草影视| 国产黄色精品视频| 欧美一区二区三区色| 亚洲男人天堂av网| 成人黄色国产精品网站大全在线免费观看| 欧美色涩在线第一页| 国产精品成人免费| 国产白丝精品91爽爽久久| 欧美一区二区三区免费观看视频| 亚洲另类春色国产| a4yy欧美一区二区三区| 欧美激情中文字幕| 国产米奇在线777精品观看| 91精品国产综合久久精品图片| 一区二区三区资源| 91视频一区二区| 国产精品久久久久久久久免费相片 | 亚洲免费在线视频一区 二区| 美女高潮久久久| 日韩一区二区不卡| 日韩精品一二三区| 制服丝袜亚洲精品中文字幕| 亚洲成人一区在线| 欧美日韩国产综合一区二区| 亚洲国产精品视频| 91.com在线观看| 日韩不卡手机在线v区| 欧美日本视频在线| 日本欧美肥老太交大片| 91精品久久久久久久99蜜桃| 日韩av午夜在线观看| 91精品在线免费观看| 奇米色777欧美一区二区| 欧美一区二区视频在线观看2022| 日韩精品免费视频人成| 欧美精品一级二级三级| 日韩av一区二| 久久综合狠狠综合久久激情| 国产真实乱对白精彩久久| 国产视频一区在线观看 | 欧美优质美女网站| 一区二区高清免费观看影视大全| 欧美私人免费视频| 日韩成人伦理电影在线观看| 日韩欧美激情四射| 成人一区二区三区视频| 亚洲精选一二三| 欧美另类一区二区三区| 久久草av在线| 中文字幕一区二区三区不卡在线| 精品视频全国免费看| 久久99国产精品免费| 中文幕一区二区三区久久蜜桃| 色88888久久久久久影院按摩| 视频一区在线视频| 国产欧美1区2区3区| 色综合久久天天综合网| 日韩和的一区二区| 国产欧美日韩不卡| 欧美精品一二三区| 国产麻豆精品在线| 亚洲影视资源网| 亚洲精品一区在线观看| 成人av在线播放网址| 亚州成人在线电影| 久久精品人人做| 欧美日韩国产电影| 成人h动漫精品一区二区| 亚洲3atv精品一区二区三区| 欧美韩国日本一区| 欧美一区二区三区四区在线观看| 成人午夜电影久久影院| 男男成人高潮片免费网站| 国产精品久久国产精麻豆99网站| 欧美日韩国产a| 91免费看视频| 国产一区二区三区免费播放| 一区二区三区四区蜜桃| 久久精品视频免费| 欧美日韩国产电影| 色综合咪咪久久| 国产sm精品调教视频网站| 日本成人在线电影网| 最新热久久免费视频| 国产亚洲精品aa| 欧美一级欧美三级在线观看| 色乱码一区二区三区88| 国产二区国产一区在线观看| 青青草一区二区三区| 午夜精品久久久久久久久久久| 国产精品无圣光一区二区| 日韩欧美高清在线| 欧美色涩在线第一页| 91在线国产观看| 成人精品高清在线| 国产精品亚洲人在线观看| 另类小说图片综合网| 视频一区视频二区在线观看| 一二三四社区欧美黄| 亚洲品质自拍视频| 国产精品成人网| 中文字幕一区二区三区在线观看| 国产亚洲成aⅴ人片在线观看| 日韩美一区二区三区| 日韩一区二区中文字幕| 欧美一激情一区二区三区| 91.com在线观看| 日韩三区在线观看| 欧美电视剧在线观看完整版| 欧美电影免费提供在线观看| 欧美成人bangbros| 26uuu色噜噜精品一区| 精品欧美乱码久久久久久1区2区| 91精品国产综合久久久久久漫画| 欧美二区三区91| 日韩欧美一区二区久久婷婷| 日韩女同互慰一区二区| www国产精品av| 日本一区二区动态图| **网站欧美大片在线观看| 一区二区三区欧美久久| 亚洲电影你懂得| 麻豆91精品视频| 韩国av一区二区| a美女胸又www黄视频久久| 色综合久久综合中文综合网| 欧美日韩一区二区在线视频| 91精品国产色综合久久不卡蜜臀| 欧美大片顶级少妇| 中文字幕欧美国产| 亚洲电影视频在线| 国产最新精品免费| 99精品国产视频| 欧美日韩在线播| 精品国产乱码久久久久久久| 亚洲国产高清aⅴ视频| 亚洲男同1069视频| 免费人成精品欧美精品| 国产精品系列在线播放| 日本福利一区二区| 日韩女优毛片在线| 亚洲美女少妇撒尿| 免费成人在线观看视频| 成人av动漫在线| 6080yy午夜一二三区久久| 久久精品一区二区三区不卡| 一区二区三区在线不卡| 精彩视频一区二区| 色综合久久精品| 精品国产乱子伦一区| 成人免费一区二区三区在线观看| 日韩国产成人精品| 粉嫩久久99精品久久久久久夜| 欧美日韩一级片在线观看| 中文字幕乱码一区二区免费| 日韩不卡在线观看日韩不卡视频| 懂色一区二区三区免费观看| 欧美日韩成人一区| 亚洲欧洲日韩av| 国产乱码精品1区2区3区| 欧美在线你懂得| 亚洲欧美综合在线精品| 国产主播一区二区三区| 欧美人与禽zozo性伦| 亚洲欧洲日产国码二区| 精品一二线国产| 欧美日韩国产系列| 亚洲人成伊人成综合网小说| 国产精品综合网| 日韩午夜激情av| 日日骚欧美日韩| 欧美四级电影在线观看| 亚洲欧美一区二区视频| 国产成人高清在线| www国产精品av| 蜜臀av亚洲一区中文字幕| 欧美无砖砖区免费| 亚洲免费观看视频| 成人av高清在线| 日本一区二区三区国色天香 | 久久久国产精品不卡| 麻豆精品新av中文字幕| 欧美人体做爰大胆视频| 亚洲一区二区三区精品在线| 色综合天天综合网国产成人综合天| 国产亚洲1区2区3区| 国产一区二区不卡老阿姨| 久久综合久久99| 国产在线精品免费| 精品久久国产老人久久综合| 蜜桃精品在线观看| 日韩欧美123| 国产精品一线二线三线精华| 欧美精品一区二区蜜臀亚洲|