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

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

?? stm32f10x_usart.c

?? STM32SDCardSourceCodeFATFS.rar
?? 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 or UART4.  
  * @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.  
  * @retval None
  */
void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_1234_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
  */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费观看高清| 日产国产高清一区二区三区| 亚洲成a人片综合在线| 福利一区在线观看| 91精品国产综合久久香蕉的特点| 国产精品久久久久久亚洲毛片| 亚洲高清一区二区三区| 91免费精品国自产拍在线不卡| 欧美xxxx老人做受| 午夜精品久久久久影视| 99国内精品久久| 久久久久久毛片| 激情文学综合插| 欧美一区二区三区小说| 亚洲国产日韩a在线播放| 99久久精品费精品国产一区二区| 久久九九久久九九| 国产在线观看一区二区| 91精品午夜视频| 亚洲成人av福利| 欧美影院午夜播放| 一区二区三区日韩欧美精品| 91首页免费视频| 亚洲激情一二三区| 色综合天天综合网天天看片| 久久精品一区八戒影视| 国产精品一区二区久久不卡| 欧美成人乱码一区二区三区| 久久精品噜噜噜成人av农村| 日韩欧美国产一二三区| 日本一道高清亚洲日美韩| 欧美精品一二三| 日本亚洲免费观看| xfplay精品久久| 国产精品嫩草影院com| av男人天堂一区| 国产精品久久久久影院老司| 成人小视频免费在线观看| 欧美国产乱子伦 | 久久只精品国产| 精品在线播放免费| 久久九九影视网| 成人精品免费看| 一区二区三区中文字幕| 精品视频在线免费观看| 日本欧美在线看| www国产精品av| av网站一区二区三区| 亚洲一区精品在线| 欧美成人艳星乳罩| 不卡的看片网站| 亚洲国产精品一区二区www| 91精品国产一区二区三区香蕉| 精品一区二区三区日韩| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 三级欧美在线一区| 日韩精品中文字幕在线不卡尤物| 国产一区二区三区日韩| 亚洲欧洲成人自拍| 56国语精品自产拍在线观看| 韩国女主播成人在线观看| 国产精品私人影院| 7777精品伊人久久久大香线蕉完整版| 久久国产视频网| 1000精品久久久久久久久| 欧美丰满高潮xxxx喷水动漫| 国产成人三级在线观看| 亚洲一区二区三区国产| 欧美tickling网站挠脚心| 99精品视频在线观看免费| 日日摸夜夜添夜夜添亚洲女人| 久久久久久影视| 欧美猛男gaygay网站| 成人伦理片在线| 麻豆国产一区二区| 亚洲欧美电影院| 久久久久久久久久美女| 欧美日韩国产高清一区二区三区 | 中文乱码免费一区二区| 欧美精品乱码久久久久久| 成人性生交大合| 久久久精品国产免大香伊| 国产精品成人在线观看| 精品久久五月天| 欧美色精品天天在线观看视频| 国产精品羞羞答答xxdd| 日本午夜精品视频在线观看 | 欧美日韩在线播放| 国产91丝袜在线播放九色| 午夜精品久久久久久久| 亚洲欧洲精品天堂一级| 国产午夜精品福利| 日韩欧美中文一区| 欧美嫩在线观看| 欧美综合色免费| 91免费看`日韩一区二区| 粉嫩av一区二区三区粉嫩 | 日日噜噜夜夜狠狠视频欧美人| 国产精品美女久久久久aⅴ | 日韩一区二区三区视频在线 | 成人精品gif动图一区| 国模少妇一区二区三区| 久久精品99国产精品| 午夜一区二区三区视频| 亚洲综合一区在线| 亚洲黄色av一区| 亚洲无人区一区| 亚洲图片有声小说| 午夜精品久久一牛影视| 亚洲高清免费视频| 婷婷国产v国产偷v亚洲高清| 亚洲高清在线视频| 三级久久三级久久| 午夜精品123| 免费在线观看一区| 美女网站色91| 国内精品久久久久影院色| 国产在线精品视频| 国产精品一级在线| 91丨porny丨蝌蚪视频| 在线观看日韩高清av| 欧美精品一二三四| 精品国精品国产尤物美女| 久久久久久久综合日本| 国产精品久久久久aaaa樱花| 亚洲免费观看视频| 亚洲国产精品一区二区久久恐怖片 | 久久成人羞羞网站| 波多野结衣亚洲一区| 久久精品国产77777蜜臀| 极品少妇xxxx精品少妇偷拍| 国产酒店精品激情| 色综合天天综合网国产成人综合天| 色综合天天狠狠| 欧美疯狂性受xxxxx喷水图片| 精品国产三级电影在线观看| 日本一区二区三区久久久久久久久不| 中国av一区二区三区| 亚洲一区二区在线视频| 久久精品久久99精品久久| 国产精品资源在线观看| 91美女视频网站| 91麻豆精品国产无毒不卡在线观看| 精品国产伦一区二区三区观看方式| 国产精品久久久久三级| 日韩成人精品在线| 懂色av噜噜一区二区三区av| 精品视频一区三区九区| 精品国产一区久久| 夜夜亚洲天天久久| 国产一区欧美二区| 欧美在线一二三| 久久久国产午夜精品| 一区二区三区中文字幕在线观看| 精品一区二区在线视频| av激情亚洲男人天堂| 欧美一区二区三区成人| 亚洲三级视频在线观看| 激情国产一区二区| 欧美性videosxxxxx| 国产亚洲午夜高清国产拍精品| 亚洲综合色网站| 丰满白嫩尤物一区二区| 欧美一级片在线看| 亚洲黄色免费网站| 成人亚洲一区二区一| 日韩一区二区精品| 亚洲午夜电影在线观看| 99久久精品免费观看| 国产亚洲精品中文字幕| 天天亚洲美女在线视频| 97久久超碰精品国产| 国产欧美日韩另类视频免费观看| 偷拍日韩校园综合在线| 色综合久久综合网| 国产精品天干天干在线综合| 国产一区二区伦理片| 日韩一级欧美一级| 亚洲成av人片一区二区三区| 91亚洲男人天堂| 国产精品乱码一区二三区小蝌蚪| 激情五月播播久久久精品| 日韩你懂的在线播放| 视频一区二区三区入口| 欧美视频你懂的| 亚洲综合精品久久| 91污在线观看| 亚洲图片激情小说| www.亚洲色图| 国产精品入口麻豆原神| 国产福利精品一区| 久久久高清一区二区三区| 国内精品写真在线观看| 精品国产乱码久久久久久免费| 日本aⅴ免费视频一区二区三区| 欧美日韩午夜在线视频| 亚洲www啪成人一区二区麻豆| 欧美亚洲国产一区在线观看网站| 国产精品伦理一区二区| 欧美在线影院一区二区|