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

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

?? stm32f10x_usart.c

?? stm32+ucos-ii
?? C
?? 第 1 頁 / 共 3 頁
字號:
  
  if (NewState != DISABLE)
  {
    /* Enable the selected USART by setting the UE bit in the CR1 register */
    USARTx->CR1 |= CR1_UE_Set;
  }
  else
  {
    /* Disable the selected USART by clearing the UE bit in the CR1 register */
    USARTx->CR1 &= CR1_UE_Reset;
  }
}

/**
  * @brief  Enables or disables the specified USART interrupts.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_IT: specifies the USART interrupt sources to be enabled or disabled.
  *   This parameter can be one of the following values:
  *     @arg USART_IT_CTS:  CTS change interrupt (not available for UART4 and UART5)
  *     @arg USART_IT_LBD:  LIN Break detection interrupt
  *     @arg USART_IT_TXE:  Tansmit Data Register empty interrupt
  *     @arg USART_IT_TC:   Transmission complete interrupt
  *     @arg USART_IT_RXNE: Receive Data register not empty interrupt
  *     @arg USART_IT_IDLE: Idle line detection interrupt
  *     @arg USART_IT_PE:   Parity Error interrupt
  *     @arg USART_IT_ERR:  Error interrupt(Frame error, noise error, overrun error)
  * @param  NewState: new state of the specified USARTx interrupts.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState)
{
  uint32_t usartreg = 0x00, itpos = 0x00, itmask = 0x00;
  uint32_t usartxbase = 0x00;
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_CONFIG_IT(USART_IT));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  /* The CTS interrupt is not available for UART4 and UART5 */
  if (USART_IT == USART_IT_CTS)
  {
    assert_param(IS_USART_123_PERIPH(USARTx));
  }   
  
  usartxbase = (uint32_t)USARTx;

  /* Get the USART register index */
  usartreg = (((uint8_t)USART_IT) >> 0x05);

  /* Get the interrupt position */
  itpos = USART_IT & IT_Mask;
  itmask = (((uint32_t)0x01) << itpos);
    
  if (usartreg == 0x01) /* The IT is in CR1 register */
  {
    usartxbase += 0x0C;
  }
  else if (usartreg == 0x02) /* The IT is in CR2 register */
  {
    usartxbase += 0x10;
  }
  else /* The IT is in CR3 register */
  {
    usartxbase += 0x14; 
  }
  if (NewState != DISABLE)
  {
    *(__IO uint32_t*)usartxbase  |= itmask;
  }
  else
  {
    *(__IO uint32_t*)usartxbase &= ~itmask;
  }
}

/**
  * @brief  Enables or disables the USART抯 DMA interface.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_DMAReq: specifies the DMA request.
  *   This parameter can be any combination of the following values:
  *     @arg USART_DMAReq_Tx: USART DMA transmit request
  *     @arg USART_DMAReq_Rx: USART DMA receive request
  * @param  NewState: new state of the DMA Request sources.
  *   This parameter can be: ENABLE or DISABLE.
  * @note The DMA mode is not available for UART5 except in the STM32
  *       High density value line devices(STM32F10X_HD_VL).  
  * @retval None
  */
void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_DMAREQ(USART_DMAReq));  
  assert_param(IS_FUNCTIONAL_STATE(NewState)); 
  if (NewState != DISABLE)
  {
    /* Enable the DMA transfer for selected requests by setting the DMAT and/or
       DMAR bits in the USART CR3 register */
    USARTx->CR3 |= USART_DMAReq;
  }
  else
  {
    /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
       DMAR bits in the USART CR3 register */
    USARTx->CR3 &= (uint16_t)~USART_DMAReq;
  }
}

/**
  * @brief  Sets the address of the USART node.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_Address: Indicates the address of the USART node.
  * @retval None
  */
void USART_SetAddress(USART_TypeDef* USARTx, uint8_t USART_Address)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_ADDRESS(USART_Address)); 
    
  /* Clear the USART address */
  USARTx->CR2 &= CR2_Address_Mask;
  /* Set the USART address node */
  USARTx->CR2 |= USART_Address;
}

/**
  * @brief  Selects the USART WakeUp method.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_WakeUp: specifies the USART wakeup method.
  *   This parameter can be one of the following values:
  *     @arg USART_WakeUp_IdleLine: WakeUp by an idle line detection
  *     @arg USART_WakeUp_AddressMark: WakeUp by an address mark
  * @retval None
  */
void USART_WakeUpConfig(USART_TypeDef* USARTx, uint16_t USART_WakeUp)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_WAKEUP(USART_WakeUp));
  
  USARTx->CR1 &= CR1_WAKE_Mask;
  USARTx->CR1 |= USART_WakeUp;
}

/**
  * @brief  Determines if the USART is in mute mode or not.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  NewState: new state of the USART mute mode.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void USART_ReceiverWakeUpCmd(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 USART mute mode  by setting the RWU bit in the CR1 register */
    USARTx->CR1 |= CR1_RWU_Set;
  }
  else
  {
    /* Disable the USART mute mode by clearing the RWU bit in the CR1 register */
    USARTx->CR1 &= CR1_RWU_Reset;
  }
}

/**
  * @brief  Sets the USART LIN Break detection length.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_LINBreakDetectLength: specifies the LIN break detection length.
  *   This parameter can be one of the following values:
  *     @arg USART_LINBreakDetectLength_10b: 10-bit break detection
  *     @arg USART_LINBreakDetectLength_11b: 11-bit break detection
  * @retval None
  */
void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, uint16_t USART_LINBreakDetectLength)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength));
  
  USARTx->CR2 &= CR2_LBDL_Mask;
  USARTx->CR2 |= USART_LINBreakDetectLength;  
}

/**
  * @brief  Enables or disables the USART抯 LIN mode.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  NewState: new state of the USART LIN mode.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void USART_LINCmd(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 LIN mode by setting the LINEN bit in the CR2 register */
    USARTx->CR2 |= CR2_LINEN_Set;
  }
  else
  {
    /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */
    USARTx->CR2 &= CR2_LINEN_Reset;
  }
}

/**
  * @brief  Transmits single data through the USARTx peripheral.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  Data: the data to transmit.
  * @retval None
  */
void USART_SendData(USART_TypeDef* USARTx, uint16_t Data)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_DATA(Data)); 
    
  /* Transmit Data */
  USARTx->DR = (Data & (uint16_t)0x01FF);
}

/**
  * @brief  Returns the most recent received data by the USARTx peripheral.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @retval The received data.
  */
uint16_t USART_ReceiveData(USART_TypeDef* USARTx)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  
  /* Receive Data */
  return (uint16_t)(USARTx->DR & (uint16_t)0x01FF);
}

/**
  * @brief  Transmits break characters.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @retval None
  */
void USART_SendBreak(USART_TypeDef* USARTx)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  
  /* Send break characters */
  USARTx->CR1 |= CR1_SBK_Set;
}

/**
  * @brief  Sets the specified USART guard time.
  * @param  USARTx: where x can be 1, 2 or 3 to select the USART peripheral.
  * @param  USART_GuardTime: specifies the guard time.
  * @note The guard time bits are not available for UART4 and UART5.   
  * @retval None
  */
void USART_SetGuardTime(USART_TypeDef* USARTx, uint8_t USART_GuardTime)
{    
  /* Check the parameters */
  assert_param(IS_USART_123_PERIPH(USARTx));
  
  /* Clear the USART Guard time */
  USARTx->GTPR &= GTPR_LSB_Mask;
  /* Set the USART guard time */
  USARTx->GTPR |= (uint16_t)((uint16_t)USART_GuardTime << 0x08);
}

/**
  * @brief  Sets the system clock prescaler.
  * @param  USARTx: Select the USART or the UART peripheral. 
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_Prescaler: specifies the prescaler clock.  
  * @note   The function is used for IrDA mode with UART4 and UART5.
  * @retval None
  */
void USART_SetPrescaler(USART_TypeDef* USARTx, uint8_t USART_Prescaler)
{ 
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  
  /* Clear the USART prescaler */
  USARTx->GTPR &= GTPR_MSB_Mask;
  /* Set the USART prescaler */
  USARTx->GTPR |= USART_Prescaler;
}

/**
  * @brief  Enables or disables the USART抯 Smart Card mode.
  * @param  USARTx: where x can be 1, 2 or 3 to select the USART peripheral.
  * @param  NewState: new state of the Smart Card mode.
  *   This parameter can be: ENABLE or DISABLE.     
  * @note The Smart Card mode is not available for UART4 and UART5. 
  * @retval 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;
  }
}

/**
  * @brief  Enables or disables NACK transmission.
  * @param  USARTx: where x can be 1, 2 or 3 to select the USART peripheral. 
  * @param  NewState: new state of the NACK transmission.
  *   This parameter can be: ENABLE or DISABLE.  
  * @note The Smart Card mode is not available for UART4 and UART5.
  * @retval None
  */
void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产精品专区| 天天免费综合色| 欧美日韩国产影片| 丁香啪啪综合成人亚洲小说 | 亚洲最大的成人av| 欧美mv和日韩mv国产网站| 91色视频在线| 粉嫩嫩av羞羞动漫久久久| 欧美aaa在线| 91麻豆精品91久久久久久清纯| 美女视频网站久久| 亚洲一区二区三区中文字幕| 国产偷国产偷亚洲高清人白洁| 欧美另类videos死尸| 99re成人在线| 国产99一区视频免费| 美女视频免费一区| 婷婷久久综合九色综合伊人色| 1000部国产精品成人观看| 欧美日本不卡视频| 欧美午夜精品一区二区三区| 99国产精品视频免费观看| 国产成人在线观看| 国产又粗又猛又爽又黄91精品| 日韩电影在线观看电影| 亚洲一二三专区| 亚洲最大成人网4388xx| 亚洲欧美日韩久久精品| 成人欧美一区二区三区黑人麻豆| 国产亚洲精品精华液| 久久影院电视剧免费观看| 精品少妇一区二区| 日韩三级视频在线看| 欧美一区二区三区视频| 欧美一区二区精美| 欧美丰满一区二区免费视频 | 国产欧美精品一区| 国产色婷婷亚洲99精品小说| 国产夜色精品一区二区av| 久久理论电影网| 国产欧美精品一区二区三区四区| 久久一区二区三区四区| 久久久影视传媒| 国产精品免费视频一区| 中文字幕一区二区三区蜜月| 日韩理论片中文av| 一区二区三区中文字幕| 香蕉成人啪国产精品视频综合网| 婷婷丁香久久五月婷婷| 九九视频精品免费| 精品一区二区成人精品| 久久国产精品色婷婷| 麻豆一区二区三区| 国产在线看一区| 成人免费看黄yyy456| av高清不卡在线| 欧美日韩中文字幕一区二区| 欧美军同video69gay| 亚洲精品一区二区三区四区高清 | 亚洲欧美日韩国产手机在线| 亚洲香蕉伊在人在线观| 日本特黄久久久高潮| 国产在线视频一区二区三区| 国产成人亚洲综合a∨婷婷| av在线播放不卡| 欧美亚洲综合色| 精品人伦一区二区色婷婷| 亚洲国产成人在线| 亚洲成人一区在线| 国产在线播放一区二区三区| 91免费国产在线观看| 亚洲欧洲一区二区三区| 欧美mv日韩mv国产网站| 国产欧美日韩精品一区| 一区二区三区蜜桃| 七七婷婷婷婷精品国产| 国产精品1区2区| 91成人免费在线视频| 欧美xxxx在线观看| 亚洲日本在线视频观看| 蜜臀av亚洲一区中文字幕| 大美女一区二区三区| 欧美日本一道本在线视频| 久久久综合视频| 亚洲sss视频在线视频| 国产精品一二一区| 欧美在线影院一区二区| 久久久久久电影| 亚洲123区在线观看| 岛国av在线一区| 日韩精品中午字幕| 亚洲伦理在线精品| 国产精品一区专区| 欧美日韩精品一区视频| 亚洲欧洲av色图| 国产一区二区三区在线看麻豆| 色成年激情久久综合| 制服丝袜亚洲精品中文字幕| 欧美一二三四在线| 亚洲美女屁股眼交| 精品在线免费观看| 欧美日韩成人在线| 亚洲精品久久久蜜桃| 成人动漫一区二区在线| 亚洲精品在线网站| 日本女人一区二区三区| 色综合久久88色综合天天6| 欧美精品一区二区久久久| 午夜精品福利在线| 色婷婷久久久久swag精品| 国产精品理论片| 国产精品996| 久久综合五月天婷婷伊人| 无吗不卡中文字幕| 在线观看国产一区二区| 中文字幕不卡三区| 国产精品影视网| 久久综合九色综合97_久久久| 日本va欧美va欧美va精品| 欧美日韩你懂得| 亚洲一区二区高清| 91福利视频在线| 一区二区三区四区国产精品| eeuss鲁片一区二区三区| 国产欧美精品一区二区色综合朱莉| 91精品国产全国免费观看| 老汉av免费一区二区三区| 欧美专区亚洲专区| 亚洲品质自拍视频网站| 播五月开心婷婷综合| 国产欧美精品一区二区色综合| 国产精品一区二区在线播放| 精品国产区一区| 韩国在线一区二区| 欧美mv日韩mv亚洲| 国产综合久久久久影院| 久久久久久日产精品| 国产精品亚洲午夜一区二区三区| 久久久电影一区二区三区| 国产激情一区二区三区四区| 欧美激情综合在线| 91丨九色丨黑人外教| 一区二区三区高清在线| 欧美日韩亚洲综合在线 | 91精品综合久久久久久| 丝袜美腿亚洲色图| 欧美成人福利视频| 国产精品资源在线看| 国产精品天干天干在线综合| 91一区二区三区在线观看| 亚洲精品第1页| 在线不卡免费av| 亚洲精品一区二区三区99| 日韩精品1区2区3区| 日韩一级在线观看| 国产一区二区三区免费看| 国产精品麻豆一区二区| 91官网在线免费观看| 日本一不卡视频| 久久亚洲一区二区三区明星换脸| 高清不卡在线观看| 亚洲综合免费观看高清在线观看| 4438x成人网最大色成网站| 精品一区二区免费在线观看| 国产精品色哟哟| 欧美亚洲图片小说| 激情五月激情综合网| 亚洲天堂2014| 欧美一三区三区四区免费在线看| 国产一区在线观看麻豆| 最新热久久免费视频| 欧美老女人在线| 丁香婷婷综合激情五月色| 午夜电影网亚洲视频| 国产亚洲综合av| 欧美日韩欧美一区二区| 国产成人日日夜夜| 亚洲电影一级片| 国产女主播一区| 欧美一区二区视频在线观看| 成人美女视频在线观看18| 婷婷综合五月天| 中文字幕日韩一区| 欧美不卡一区二区三区| 日本中文字幕不卡| 日本一区二区在线不卡| 欧美一区二区黄| 色综合久久久久综合体| 国产毛片精品视频| 日日夜夜免费精品视频| 中文字幕一区在线观看| 精品美女一区二区| 欧美三级视频在线| 成人app网站| 国模大尺度一区二区三区| 午夜在线电影亚洲一区| 亚洲视频一区二区在线观看| 久久久久亚洲综合| 欧美大胆人体bbbb| 欧美日韩国产bt|