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

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

?? stm32f10x_rtc.c

?? 學習stm32定時器
?? C
字號:
/**
  ******************************************************************************
  * @file    stm32f10x_rtc.c
  * @author  MCD Application Team
  * @version V3.5.0
  * @date    11-March-2011
  * @brief   This file provides all the RTC firmware functions.
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_rtc.h"

/** @addtogroup STM32F10x_StdPeriph_Driver
  * @{
  */

/** @defgroup RTC 
  * @brief RTC driver modules
  * @{
  */

/** @defgroup RTC_Private_TypesDefinitions
  * @{
  */ 
/**
  * @}
  */

/** @defgroup RTC_Private_Defines
  * @{
  */
#define RTC_LSB_MASK     ((uint32_t)0x0000FFFF)  /*!< RTC LSB Mask */
#define PRLH_MSB_MASK    ((uint32_t)0x000F0000)  /*!< RTC Prescaler MSB Mask */

/**
  * @}
  */

/** @defgroup RTC_Private_Macros
  * @{
  */

/**
  * @}
  */

/** @defgroup RTC_Private_Variables
  * @{
  */

/**
  * @}
  */

/** @defgroup RTC_Private_FunctionPrototypes
  * @{
  */

/**
  * @}
  */

/** @defgroup RTC_Private_Functions
  * @{
  */

/**
  * @brief  Enables or disables the specified RTC interrupts.
  * @param  RTC_IT: specifies the RTC interrupts sources to be enabled or disabled.
  *   This parameter can be any combination of the following values:
  *     @arg RTC_IT_OW: Overflow interrupt
  *     @arg RTC_IT_ALR: Alarm interrupt
  *     @arg RTC_IT_SEC: Second interrupt
  * @param  NewState: new state of the specified RTC interrupts.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_RTC_IT(RTC_IT));  
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    RTC->CRH |= RTC_IT;
  }
  else
  {
    RTC->CRH &= (uint16_t)~RTC_IT;
  }
}

/**
  * @brief  Enters the RTC configuration mode.
  * @param  None
  * @retval None
  */
void RTC_EnterConfigMode(void)
{
  /* Set the CNF flag to enter in the Configuration Mode */
  RTC->CRL |= RTC_CRL_CNF;
}

/**
  * @brief  Exits from the RTC configuration mode.
  * @param  None
  * @retval None
  */
void RTC_ExitConfigMode(void)
{
  /* Reset the CNF flag to exit from the Configuration Mode */
  RTC->CRL &= (uint16_t)~((uint16_t)RTC_CRL_CNF); 
}

/**
  * @brief  Gets the RTC counter value.
  * @param  None
  * @retval RTC counter value.
  */
uint32_t RTC_GetCounter(void)
{
  uint16_t tmp = 0;
  tmp = RTC->CNTL;
  return (((uint32_t)RTC->CNTH << 16 ) | tmp) ;
}

/**
  * @brief  Sets the RTC counter value.
  * @param  CounterValue: RTC counter new value.
  * @retval None
  */
void RTC_SetCounter(uint32_t CounterValue)
{ 
  RTC_EnterConfigMode();
  /* Set RTC COUNTER MSB word */
  RTC->CNTH = CounterValue >> 16;
  /* Set RTC COUNTER LSB word */
  RTC->CNTL = (CounterValue & RTC_LSB_MASK);
  RTC_ExitConfigMode();
}

/**
  * @brief  Sets the RTC prescaler value.
  * @param  PrescalerValue: RTC prescaler new value.
  * @retval None
  */
void RTC_SetPrescaler(uint32_t PrescalerValue)
{
  /* Check the parameters */
  assert_param(IS_RTC_PRESCALER(PrescalerValue));
  
  RTC_EnterConfigMode();
  /* Set RTC PRESCALER MSB word */
  RTC->PRLH = (PrescalerValue & PRLH_MSB_MASK) >> 16;
  /* Set RTC PRESCALER LSB word */
  RTC->PRLL = (PrescalerValue & RTC_LSB_MASK);
  RTC_ExitConfigMode();
}

/**
  * @brief  Sets the RTC alarm value.
  * @param  AlarmValue: RTC alarm new value.
  * @retval None
  */
void RTC_SetAlarm(uint32_t AlarmValue)
{  
  RTC_EnterConfigMode();
  /* Set the ALARM MSB word */
  RTC->ALRH = AlarmValue >> 16;
  /* Set the ALARM LSB word */
  RTC->ALRL = (AlarmValue & RTC_LSB_MASK);
  RTC_ExitConfigMode();
}

/**
  * @brief  Gets the RTC divider value.
  * @param  None
  * @retval RTC Divider value.
  */
uint32_t RTC_GetDivider(void)
{
  uint32_t tmp = 0x00;
  tmp = ((uint32_t)RTC->DIVH & (uint32_t)0x000F) << 16;
  tmp |= RTC->DIVL;
  return tmp;
}

/**
  * @brief  Waits until last write operation on RTC registers has finished.
  * @note   This function must be called before any write to RTC registers.
  * @param  None
  * @retval None
  */
void RTC_WaitForLastTask(void)
{
  /* Loop until RTOFF flag is set */
  while ((RTC->CRL & RTC_FLAG_RTOFF) == (uint16_t)RESET)
  {
  }
}

/**
  * @brief  Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL)
  *   are synchronized with RTC APB clock.
  * @note   This function must be called before any read operation after an APB reset
  *   or an APB clock stop.
  * @param  None
  * @retval None
  */
void RTC_WaitForSynchro(void)
{
  /* Clear RSF flag */
  RTC->CRL &= (uint16_t)~RTC_FLAG_RSF;
  /* Loop until RSF flag is set */
  while ((RTC->CRL & RTC_FLAG_RSF) == (uint16_t)RESET)
  {
  }
}

/**
  * @brief  Checks whether the specified RTC flag is set or not.
  * @param  RTC_FLAG: specifies the flag to check.
  *   This parameter can be one the following values:
  *     @arg RTC_FLAG_RTOFF: RTC Operation OFF flag
  *     @arg RTC_FLAG_RSF: Registers Synchronized flag
  *     @arg RTC_FLAG_OW: Overflow flag
  *     @arg RTC_FLAG_ALR: Alarm flag
  *     @arg RTC_FLAG_SEC: Second flag
  * @retval The new state of RTC_FLAG (SET or RESET).
  */
FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG)
{
  FlagStatus bitstatus = RESET;
  
  /* Check the parameters */
  assert_param(IS_RTC_GET_FLAG(RTC_FLAG)); 
  
  if ((RTC->CRL & RTC_FLAG) != (uint16_t)RESET)
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  return bitstatus;
}

/**
  * @brief  Clears the RTC's pending flags.
  * @param  RTC_FLAG: specifies the flag to clear.
  *   This parameter can be any combination of the following values:
  *     @arg RTC_FLAG_RSF: Registers Synchronized flag. This flag is cleared only after
  *                        an APB reset or an APB Clock stop.
  *     @arg RTC_FLAG_OW: Overflow flag
  *     @arg RTC_FLAG_ALR: Alarm flag
  *     @arg RTC_FLAG_SEC: Second flag
  * @retval None
  */
void RTC_ClearFlag(uint16_t RTC_FLAG)
{
  /* Check the parameters */
  assert_param(IS_RTC_CLEAR_FLAG(RTC_FLAG)); 
    
  /* Clear the corresponding RTC flag */
  RTC->CRL &= (uint16_t)~RTC_FLAG;
}

/**
  * @brief  Checks whether the specified RTC interrupt has occurred or not.
  * @param  RTC_IT: specifies the RTC interrupts sources to check.
  *   This parameter can be one of the following values:
  *     @arg RTC_IT_OW: Overflow interrupt
  *     @arg RTC_IT_ALR: Alarm interrupt
  *     @arg RTC_IT_SEC: Second interrupt
  * @retval The new state of the RTC_IT (SET or RESET).
  */
ITStatus RTC_GetITStatus(uint16_t RTC_IT)
{
  ITStatus bitstatus = RESET;
  /* Check the parameters */
  assert_param(IS_RTC_GET_IT(RTC_IT)); 
  
  bitstatus = (ITStatus)(RTC->CRL & RTC_IT);
  if (((RTC->CRH & RTC_IT) != (uint16_t)RESET) && (bitstatus != (uint16_t)RESET))
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  return bitstatus;
}

/**
  * @brief  Clears the RTC's interrupt pending bits.
  * @param  RTC_IT: specifies the interrupt pending bit to clear.
  *   This parameter can be any combination of the following values:
  *     @arg RTC_IT_OW: Overflow interrupt
  *     @arg RTC_IT_ALR: Alarm interrupt
  *     @arg RTC_IT_SEC: Second interrupt
  * @retval None
  */
void RTC_ClearITPendingBit(uint16_t RTC_IT)
{
  /* Check the parameters */
  assert_param(IS_RTC_IT(RTC_IT));  
  
  /* Clear the corresponding RTC pending bit */
  RTC->CRL &= (uint16_t)~RTC_IT;
}

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜亚洲精品理论片色戒| 国产欧美日韩在线视频| 国产成人av电影免费在线观看| 一区二区视频在线| 久久网站最新地址| 欧美肥妇free| 日本高清不卡在线观看| 国产白丝精品91爽爽久久 | 亚洲国产精品激情在线观看| 欧美日韩精品一区视频| 99re这里只有精品视频首页| 国产精品资源在线观看| 蜜桃视频一区二区| 亚洲制服丝袜一区| 亚洲婷婷综合久久一本伊一区| 久久影院午夜论| 欧美一区二区三区爱爱| 欧美性大战久久久| 欧美综合天天夜夜久久| 色综合天天天天做夜夜夜夜做| 国产成人aaaa| 国产成a人亚洲精| 国产在线视视频有精品| 蜜桃视频免费观看一区| 青青国产91久久久久久| 视频一区视频二区中文| 亚洲国产精品一区二区尤物区| 亚洲精品视频自拍| 综合分类小说区另类春色亚洲小说欧美| 久久亚区不卡日本| 久久久国产午夜精品| 26uuu色噜噜精品一区| 精品成人在线观看| 欧美xxx久久| 26uuu另类欧美亚洲曰本| 精品久久久久久综合日本欧美| 日韩午夜在线观看视频| 日韩你懂的电影在线观看| 日韩欧美成人午夜| 日韩三级.com| 久久综合九色综合欧美就去吻| 久久嫩草精品久久久久| www国产成人| 亚洲国产精品黑人久久久| 国产精品视频一二三| 亚洲欧美偷拍三级| 亚洲一区二区四区蜜桃| 日韩综合一区二区| 久久91精品国产91久久小草| 国产精品1区2区3区在线观看| 成人激情校园春色| 91看片淫黄大片一级在线观看| 色8久久精品久久久久久蜜| 一本大道久久a久久综合| 精品视频一区三区九区| 日韩精品最新网址| 国产亚洲视频系列| 亚洲欧洲精品一区二区三区不卡| 夜夜嗨av一区二区三区网页| 日本在线不卡一区| 欧美日韩的一区二区| 日韩一区二区在线免费观看| 欧美精品一区二区不卡| 国产精品久久久99| 亚洲国产日韩a在线播放性色| 麻豆精品一区二区| 成人av在线播放网址| 色狠狠色噜噜噜综合网| 日韩一区二区三区电影在线观看| 国产亚洲综合在线| 亚洲一区二区在线免费观看视频| 老鸭窝一区二区久久精品| 成人美女视频在线观看18| 精品视频一区二区三区免费| 26uuu色噜噜精品一区二区| 亚洲免费在线视频一区 二区| 丝袜美腿高跟呻吟高潮一区| 国产成人福利片| 欧美亚洲日本一区| 久久蜜臀中文字幕| 亚洲最大成人网4388xx| 精品亚洲国内自在自线福利| 一本色道久久综合亚洲91 | 精品91自产拍在线观看一区| 中文字幕综合网| 美女在线视频一区| 色综合天天在线| 久久久久久日产精品| 亚洲午夜激情网页| 成人精品免费看| 制服丝袜日韩国产| 亚洲欧美国产三级| 国产成人综合在线观看| 欧美一区二区在线免费观看| 一区视频在线播放| 国产麻豆精品视频| 欧美精品99久久久**| 最新国产成人在线观看| 国产精品综合网| 日韩欧美第一区| 亚洲成a人在线观看| 99久久精品费精品国产一区二区| 精品国产亚洲在线| 日韩精品福利网| 在线精品视频一区二区| 中文字幕一区二区三区四区不卡| 国产尤物一区二区在线| 91精品国产综合久久福利软件| 亚洲男同1069视频| 成人黄色777网| 久久久久久久久久久久久夜| 卡一卡二国产精品 | 亚洲人午夜精品天堂一二香蕉| 国产一区二区网址| 日韩视频一区在线观看| 日韩电影免费一区| 欧美日韩国产高清一区二区三区 | 欧美一级在线观看| 亚洲一区二区美女| 欧美在线观看视频在线| 一区二区三区成人在线视频| 色久优优欧美色久优优| 亚洲天堂久久久久久久| 成人福利视频在线| 国产精品系列在线| 国产91在线观看| 国产精品美女www爽爽爽| 国产sm精品调教视频网站| 精品国产一区二区三区久久久蜜月| 免费观看在线综合色| 日韩一区二区在线看| 麻豆91免费观看| 精品av综合导航| 国产精品白丝jk白祙喷水网站| 久久人人爽人人爽| 成人一级片网址| 中文字幕永久在线不卡| 91久久精品网| 婷婷久久综合九色综合伊人色| 91精品国产综合久久精品app| 蜜桃视频一区二区| 精品国产乱码久久久久久闺蜜 | 欧美午夜精品久久久久久超碰 | 99久久99久久精品免费看蜜桃 | 青青草精品视频| 精品国产乱码久久久久久久久| 国产精品一二一区| 国产精品欧美一区喷水| 一本色道a无线码一区v| 亚洲大片在线观看| 日韩欧美你懂的| 国产精品影视天天线| 中文字幕一区二区三区av| 色www精品视频在线观看| 亚洲成人免费视| 日韩免费视频一区二区| 国产成人综合亚洲网站| 国产精品视频在线看| 欧美午夜片在线看| 精品一区二区成人精品| 中文字幕中文字幕一区| 欧美日韩国产综合一区二区三区| 美女精品自拍一二三四| 国产精品欧美精品| 精品视频在线视频| 激情深爱一区二区| 中文字幕一区二区三区在线播放 | 99综合电影在线视频| 亚洲一区二区不卡免费| 2023国产精品| 色婷婷久久综合| 久久99九九99精品| 亚洲欧洲国产专区| 欧美一区二区观看视频| 成人免费三级在线| 日韩va欧美va亚洲va久久| 中文一区在线播放| 88在线观看91蜜桃国自产| 成人动漫一区二区| 日日摸夜夜添夜夜添精品视频| 国产视频在线观看一区二区三区 | 欧美国产日韩在线观看| 欧美日韩在线播放三区四区| 国产精品系列在线播放| 亚洲国产视频在线| 久久精品夜色噜噜亚洲a∨| 欧美日韩aaaaaa| 97久久人人超碰| 国产综合久久久久影院| 无吗不卡中文字幕| 亚洲视频免费在线观看| 精品国产乱码久久久久久牛牛 | 调教+趴+乳夹+国产+精品| 欧美经典三级视频一区二区三区| 欧美日韩亚洲另类| 99国产精品久久久久| 国产精品亚洲一区二区三区妖精| 午夜久久电影网| 亚洲欧美二区三区| 欧美激情一区二区三区蜜桃视频|