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

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

?? stm32f10x_rtc.c

?? 英倍特公司的STM32V100開發板配套庫函數及例程源代碼
?? C
字號:
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name          : stm32f10x_rtc.c
* Author             : MCD Application Team
* Date First Issued  : 09/29/2006
* Description        : This file provides all the RTC firmware functions.
********************************************************************************
* History:
* 05/21/2007: V0.3
* 04/02/2007: V0.2
* 02/05/2007: V0.1
* 09/29/2006: V0.01
********************************************************************************
* THE PRESENT SOFTWARE 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 SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

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

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define CRL_CNF_Set      ((u16)0x0010)      /* Configuration Flag Enable Mask */
#define CRL_CNF_Reset    ((u16)0xFFEF)      /* Configuration Flag Disable Mask */
#define RTC_LSB_Mask     ((u32)0x0000FFFF)  /* RTC LSB Mask */
#define RTC_MSB_Mask     ((u32)0xFFFF0000)  /* RTC MSB Mask */
#define PRLH_MSB_Mask    ((u32)0x000F0000)  /* RTC Prescaler MSB Mask */

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

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

/*******************************************************************************
* Function Name  : RTC_EnterConfigMode
* Description    : Enters the RTC configuration mode.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_EnterConfigMode(void)
{
  /* Set the CNF flag to enter in the Configuration Mode */
  RTC->CRL |= CRL_CNF_Set;
}

/*******************************************************************************
* Function Name  : RTC_ExitConfigMode
* Description    : Exits from the RTC configuration mode.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_ExitConfigMode(void)
{
  /* Reset the CNF flag to exit from the Configuration Mode */
  RTC->CRL &= CRL_CNF_Reset;
}

/*******************************************************************************
* Function Name  : RTC_GetCounter
* Description    : Gets the RTC counter value.
* Input          : None
* Output         : None
* Return         : RTC counter value.
*******************************************************************************/
u32 RTC_GetCounter(void)
{
  u16 tmp = 0;
  tmp = RTC->CNTL;

  return (((u32)RTC->CNTH << 16 ) | tmp) ;
}

/*******************************************************************************
* Function Name  : RTC_SetCounter
* Description    : Sets the RTC counter value.
* Input          : - CounterValue: RTC counter new value.
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_SetCounter(u32 CounterValue)
{ 
  RTC_EnterConfigMode();

  /* Set RTC COUNTER MSB word */
  RTC->CNTH = (CounterValue & RTC_MSB_Mask) >> 16;
  /* Set RTC COUNTER LSB word */
  RTC->CNTL = (CounterValue & RTC_LSB_Mask);

  RTC_ExitConfigMode();
}

/*******************************************************************************
* Function Name  : RTC_GetPrescaler
* Description    : Gets the RTC prescaler value.
* Input          : None
* Output         : None
* Return         : RTC prescaler value.
*******************************************************************************/
u32 RTC_GetPrescaler(void)
{
  u32 tmp = 0x00;

  tmp = ((u32)RTC->PRLH & (u32)0x000F) << 0x10;
  tmp |= RTC->PRLL;

  return tmp;
}

/*******************************************************************************
* Function Name  : RTC_SetPrescaler
* Description    : Sets the RTC prescaler value.
* Input          : - PrescalerValue: RTC prescaler new value.
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_SetPrescaler(u32 PrescalerValue)
{
  /* Check the parameters */
  assert(IS_RTC_PRESCALER(PrescalerValue));
  
  RTC_EnterConfigMode();

  /* Set RTC PRESCALER MSB word */
  RTC->PRLH = (PrescalerValue & PRLH_MSB_Mask) >> 0x10;
  /* Set RTC PRESCALER LSB word */
  RTC->PRLL = (PrescalerValue & RTC_LSB_Mask);

  RTC_ExitConfigMode();
}

/*******************************************************************************
* Function Name  : RTC_SetAlarm
* Description    : Sets the RTC alarm value.
* Input          : - AlarmValue: RTC alarm new value.
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_SetAlarm(u32 AlarmValue)
{  
  RTC_EnterConfigMode();

  /* Set the ALARM MSB word */
  RTC->ALRH = (AlarmValue & RTC_MSB_Mask) >> 16;
  /* Set the ALARM LSB word */
  RTC->ALRL = (AlarmValue & RTC_LSB_Mask);

  RTC_ExitConfigMode();
}

/*******************************************************************************
* Function Name  : RTC_GetDivider
* Description    : Gets the RTC divider value.
* Input          : None
* Output         : None
* Return         : RTC Divider value.
*******************************************************************************/
u32 RTC_GetDivider(void)
{
  u32 tmp = 0x00;

  tmp = ((u32)RTC->DIVH & (u32)0x000F) << 0x10;
  tmp |= RTC->DIVL;

  return tmp;
}

/*******************************************************************************
* Function Name  : RTC_WaitForLastTask
* Description    : Waits until last write operation on RTC registers has finished.
*                  This function must be called before any write to RTC registers.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_WaitForLastTask(void)
{
  /* Loop until RTOFF flag is set */
  while ((RTC->CRL & RTC_FLAG_RTOFF) == (u16)RESET)
  {
  }
}

/*******************************************************************************
* Function Name  : RTC_WaitForSynchro
* Description    : Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL)
*                  are synchronized with RTC APB clock.
*                  This function must be called before any read operation after
*                  an APB reset or an APB clock stop.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_WaitForSynchro(void)
{
  /* Clear RSF flag */
  RTC->CRL &= (u16)~RTC_FLAG_RSF;

  /* Loop until RSF flag is set */
  while ((RTC->CRL & RTC_FLAG_RSF) == (u16)RESET)
  {
  }
}

/*******************************************************************************
* Function Name  : RTC_GetFlagStatus
* Description    : Checks whether the specified RTC flag is set or not.
* Input          : - RTC_FLAG: specifies the flag to check.
*                    This parameter can be one the following values:
*                       - RTC_FLAG_RTOFF: RTC Operation OFF flag
*                       - RTC_FLAG_RSF: Registers Synchronized flag
*                       - RTC_FLAG_OW: Overflow flag
*                       - RTC_FLAG_ALR: Alarm flag
*                       - RTC_FLAG_SEC: Second flag
* Output         : None
* Return         : The new state of RTC_FLAG (SET or RESET).
*******************************************************************************/
FlagStatus RTC_GetFlagStatus(u16 RTC_FLAG)
{
  FlagStatus bitstatus = RESET;
  
  /* Check the parameters */
  assert(IS_RTC_GET_FLAG(RTC_FLAG)); 
  
  if ((RTC->CRL & RTC_FLAG) != (u16)RESET)
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  return bitstatus;
}

/*******************************************************************************
* Function Name  : RTC_ClearFlag
* Description    : Clears the RTC抯 pending flags.
* Input          : - RTC_FLAG: specifies the flag to clear.
*                    This parameter can be any combination of the following values:
*                       - RTC_FLAG_RSF: Registers Synchronized flag. This flag
*                         is cleared only after an APB reset or an APB Clock stop.
*                       - RTC_FLAG_OW: Overflow flag
*                       - RTC_FLAG_ALR: Alarm flag
*                       - RTC_FLAG_SEC: Second flag
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_ClearFlag(u16 RTC_FLAG)
{
  /* Check the parameters */
  assert(IS_RTC_CLEAR_FLAG(RTC_FLAG)); 
    
  /* Clear the coressponding RTC flag */
  RTC->CRL &= (u16)~RTC_FLAG;
}

/*******************************************************************************
* Function Name  : RTC_GetITStatus
* Description    : Checks whether the specified RTC interrupt has occured or not.
* Input          : - RTC_IT: specifies the RTC interrupts sources to check.
*                    This parameter can be one of the following values:
*                       - RTC_IT_OW: Overflow interrupt
*                       - RTC_IT_ALR: Alarm interrupt
*                       - RTC_IT_SEC: Second interrupt
* Output         : None
* Return         : The new state of the RTC_IT (SET or RESET).
*******************************************************************************/
ITStatus RTC_GetITStatus(u16 RTC_IT)
{
  ITStatus bitstatus = RESET;

  /* Check the parameters */
  assert(IS_RTC_GET_IT(RTC_IT)); 
  
  bitstatus = (ITStatus)((RTC->CRL & RTC_IT) != (u16)RESET);

  if (((RTC->CRH & RTC_IT) != (u16)RESET) && bitstatus)
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  return bitstatus;
}

/*******************************************************************************
* Function Name  : RTC_ClearITPendingBit
* Description    : Clears the RTC抯 interrupt pending bits.
* Input          : - RTC_IT: specifies the interrupt pending bit to clear.
*                    This parameter can be any combination of the following values:
*                       - RTC_IT_OW: Overflow interrupt
*                       - RTC_IT_ALR: Alarm interrupt
*                       - RTC_IT_SEC: Second interrupt
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_ClearITPendingBit(u16 RTC_IT)
{
  /* Check the parameters */
  assert(IS_RTC_IT(RTC_IT));  
  
  /* Clear the coressponding RTC pending bit */
  RTC->CRL &= (u16)~RTC_IT;
}

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线视频一区二区| 欧美一级视频精品观看| 欧美日本在线播放| 久久久激情视频| 亚洲一区二区三区视频在线播放| 日韩电影在线观看一区| 91免费看视频| 国产午夜一区二区三区| 日韩一区精品视频| 色一情一乱一乱一91av| 欧美高清在线视频| 国产乱子伦视频一区二区三区| 日本精品一区二区三区高清| 久久久精品日韩欧美| 日韩制服丝袜av| 欧美色倩网站大全免费| 亚洲欧洲精品成人久久奇米网| 精品系列免费在线观看| 欧美日韩国产在线播放网站| 亚洲视频 欧洲视频| 国产不卡视频一区二区三区| 精品国产乱码久久久久久老虎| 日韩国产在线观看一区| 欧美在线999| 一区二区三区免费网站| 91网上在线视频| 国产精品久线在线观看| 99天天综合性| 亚洲欧洲综合另类| 色综合激情五月| 亚洲最新视频在线播放| 色8久久精品久久久久久蜜| 中文字幕一区在线观看视频| 成人免费看黄yyy456| 日本一区免费视频| 成人动漫一区二区在线| 国产精品久久午夜夜伦鲁鲁| a级精品国产片在线观看| 亚洲人成精品久久久久| 色综合咪咪久久| 亚洲一区二区三区免费视频| 欧美亚州韩日在线看免费版国语版| 1000精品久久久久久久久| 久久综合久久综合久久| 久久超碰97人人做人人爱| 欧美白人最猛性xxxxx69交| 久久99精品国产麻豆不卡| 日韩免费观看高清完整版在线观看| 日本不卡在线视频| 色域天天综合网| 男男成人高潮片免费网站| 成人妖精视频yjsp地址| 国产精品福利在线播放| 欧美艳星brazzers| 免费在线观看成人| 国产精品久久久久久久久久免费看| 99久久国产综合色|国产精品| 亚洲精品国久久99热| 欧美高清精品3d| 国内成人自拍视频| 亚洲毛片av在线| 欧美一个色资源| 成人性色生活片免费看爆迷你毛片| 综合激情网...| 欧美电影免费提供在线观看| 成人a区在线观看| 亚洲一区在线免费观看| 精品国产亚洲一区二区三区在线观看| 国产成人av电影在线| 亚洲成人在线观看视频| 久久免费视频色| 欧美日韩电影一区| 国产91高潮流白浆在线麻豆| 亚洲午夜精品网| 国产三级精品三级在线专区| 欧美性大战xxxxx久久久| 精品在线观看免费| 亚洲一区二区三区四区五区黄| 2017欧美狠狠色| 欧美精品久久久久久久多人混战| 成人美女视频在线观看18| 天天色天天爱天天射综合| 国产色婷婷亚洲99精品小说| 欧美日韩一区不卡| 91一区二区在线观看| 国内精品在线播放| 日韩不卡在线观看日韩不卡视频| 亚洲图片你懂的| 中文字幕av一区二区三区免费看| 欧美日本韩国一区| 色av成人天堂桃色av| 成人小视频免费在线观看| 久久97超碰国产精品超碰| 亚洲成av人片| 一区二区三区中文字幕| 国产精品视频一二三| 精品欧美一区二区久久| 欧美三级中文字幕| 国产成人精品在线看| 亚洲bt欧美bt精品777| 国产婷婷色一区二区三区| 欧美日本国产视频| 色婷婷久久一区二区三区麻豆| 国产尤物一区二区| 男人操女人的视频在线观看欧美| 中文字幕在线不卡一区二区三区| 精品美女一区二区| 欧美日韩不卡一区二区| 91网址在线看| 菠萝蜜视频在线观看一区| 久久国产精品免费| 免费成人美女在线观看.| 麻豆精品在线观看| 99国产麻豆精品| 美女任你摸久久| 美女久久久精品| 国产福利电影一区二区三区| 国产一区激情在线| 国产大片一区二区| 高清成人在线观看| 成人永久aaa| 91无套直看片红桃| 欧美视频精品在线观看| 欧美高清视频在线高清观看mv色露露十八| 欧美日韩综合在线| 日韩欧美一区中文| 久久综合色综合88| 国产精品午夜春色av| 国产精品毛片久久久久久久| 国产精品初高中害羞小美女文| 国产精品成人免费| 亚洲一区免费视频| 久久福利资源站| 国产精品一区专区| 99热在这里有精品免费| 欧美性猛交一区二区三区精品| 欧美日本一道本在线视频| 日韩三级免费观看| 日本一区二区免费在线观看视频 | 欧美三级中文字幕在线观看| 欧美精品久久99| 国产免费成人在线视频| 亚洲精品国产成人久久av盗摄| 五月天精品一区二区三区| 精品一区二区三区免费观看| 成人av免费在线| 69精品人人人人| 日本一区二区三区四区在线视频| 亚洲精品免费播放| 精品一区二区三区欧美| 99久久久国产精品免费蜜臀| 欧美日韩高清一区二区| 国产午夜亚洲精品理论片色戒| 亚洲欧美福利一区二区| 欧美a级一区二区| 91蜜桃在线免费视频| 欧美成人bangbros| 亚洲免费av观看| 国产成人高清在线| 欧美精品久久一区| 亚洲免费av在线| 高清视频一区二区| 日韩女优av电影| 夜夜嗨av一区二区三区网页 | 精品女同一区二区| 一区二区三区四区不卡视频| 免费看欧美女人艹b| 91成人网在线| 中文字幕一区在线| 国产一区二区在线免费观看| 在线观看日韩一区| 国产日韩三级在线| 亚洲精品乱码久久久久久日本蜜臀| 国产精品一色哟哟哟| 日韩欧美国产小视频| 亚洲综合色丁香婷婷六月图片| 国产精品亚洲视频| 欧美一级黄色片| 亚洲成人自拍网| 欧美午夜精品一区| 一区视频在线播放| 国产在线国偷精品免费看| 极品少妇一区二区| 欧美日韩一区二区在线观看视频| 国产色产综合产在线视频| 日韩精品乱码av一区二区| 96av麻豆蜜桃一区二区| 久久这里只有精品视频网| 亚洲国产成人高清精品| 成人午夜又粗又硬又大| 日韩精品专区在线影院观看 | 欧美三级日韩三级| 国产精品日产欧美久久久久| 精品一区二区在线看| 欧美一区二区三区白人| 日韩成人一级片| 欧美一二三四区在线| 蜜臀a∨国产成人精品| 欧美一区二区在线看| 亚洲第一激情av|