亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩av一级电影| 欧美视频完全免费看| 91精彩视频在线| 精品精品欲导航| 亚洲香肠在线观看| www.成人网.com| 日韩视频免费直播| 亚洲综合在线免费观看| 国产成a人亚洲精品| 88在线观看91蜜桃国自产| 国产精品无圣光一区二区| 久久成人av少妇免费| 69p69国产精品| 亚洲午夜久久久久久久久久久 | 国产欧美日韩另类一区| 亚洲成av人片在线观看无码| 色综合色狠狠综合色| 久久久久久久久久久电影| 日韩电影在线一区二区三区| 欧美日韩在线免费视频| 亚洲免费在线看| 色综合天天综合狠狠| 国产拍欧美日韩视频二区| 国内久久精品视频| 日韩精品一区二区在线| 午夜久久久影院| 欧美日韩国产一区| 亚洲色图清纯唯美| 99久久综合狠狠综合久久| 日本一区二区成人| 国产99一区视频免费| 精品欧美一区二区三区精品久久| 秋霞国产午夜精品免费视频| 欧美一区二区性放荡片| 丝袜美腿亚洲综合| 日韩视频一区在线观看| 久久精品国内一区二区三区| 欧美精品一区二区在线播放 | 亚洲成人一区二区| 欧美日韩精品高清| 免费一区二区视频| 久久婷婷成人综合色| 国产福利一区二区三区| 国产精品美女一区二区| 91在线视频播放| 一区二区三区欧美在线观看| 欧美日韩欧美一区二区| 日韩精品一区第一页| 日韩三级视频在线看| 国产在线播精品第三| 国产精品理伦片| 在线观看日韩精品| 麻豆精品在线观看| 国产精品短视频| 精品视频在线看| 精品在线亚洲视频| 国产欧美日韩在线观看| 91久久精品一区二区三区| 亚洲va欧美va人人爽午夜| 亚洲精品一区二区三区四区高清| www.在线成人| 天堂成人国产精品一区| 欧美成人国产一区二区| 99久久久免费精品国产一区二区| 一区二区三区不卡在线观看 | 欧美一级高清片| 国产电影精品久久禁18| 亚洲欧美另类在线| 欧美成人一区二区三区片免费| 成人一区二区视频| 香蕉成人伊视频在线观看| 久久婷婷久久一区二区三区| 色婷婷综合久久久久中文 | 欧美成人艳星乳罩| 成人app网站| 日韩专区欧美专区| 中文字幕成人在线观看| 欧美在线一区二区三区| 懂色av一区二区夜夜嗨| 日本少妇一区二区| 亚洲免费毛片网站| 久久精品在这里| 欧美久久高跟鞋激| 成人小视频免费观看| 青青草国产成人99久久| 亚洲另类色综合网站| 久久久一区二区三区| 欧美精品久久天天躁| 91麻豆免费观看| 国产盗摄女厕一区二区三区| 日韩成人免费电影| 亚洲免费观看高清| 国产女同性恋一区二区| 制服丝袜av成人在线看| 日本精品一级二级| 岛国精品在线观看| 久久国产尿小便嘘嘘尿| 秋霞午夜鲁丝一区二区老狼| 亚洲国产精品久久艾草纯爱 | 蜜桃视频在线一区| 亚洲一卡二卡三卡四卡| 中文字幕在线观看一区二区| 国产亲近乱来精品视频| 久久久电影一区二区三区| 日韩亚洲欧美一区二区三区| 欧美二区三区的天堂| 欧美色视频一区| 欧美亚日韩国产aⅴ精品中极品| 95精品视频在线| 99久久精品国产网站| av毛片久久久久**hd| 国产成人av电影在线| 粉嫩绯色av一区二区在线观看| 久久丁香综合五月国产三级网站| 美女任你摸久久 | 91麻豆国产自产在线观看| 成人午夜激情影院| 成人sese在线| eeuss鲁片一区二区三区| 波多野结衣一区二区三区| 成人aaaa免费全部观看| 99re这里只有精品首页| 色综合天天狠狠| 欧美日韩国产经典色站一区二区三区| 欧美日韩一级黄| 4438x成人网最大色成网站| 日韩一区二区三区四区五区六区 | 国产精品灌醉下药二区| 成人欧美一区二区三区白人| 亚洲色图在线视频| 亚洲国产精品久久一线不卡| 蜜臀久久99精品久久久久宅男| 日本91福利区| 国产成a人亚洲精品| 色综合天天性综合| 欧美人妇做爰xxxⅹ性高电影| 91精品国产福利在线观看| 日韩精品一区二区三区蜜臀| 国产欧美一区二区在线观看| 亚洲欧美一区二区久久| 奇米一区二区三区av| 国产宾馆实践打屁股91| 欧美在线观看一二区| 日韩精品中文字幕一区二区三区| 久久久久88色偷偷免费| 一区二区久久久| 六月丁香婷婷色狠狠久久| 成人国产精品免费观看动漫| 欧美影院一区二区| 久久影院午夜片一区| 日韩毛片视频在线看| 日本欧美一区二区三区乱码 | 欧美精品视频www在线观看| 欧美大尺度电影在线| 日韩毛片一二三区| 美女精品自拍一二三四| 91在线精品一区二区三区| 51精品视频一区二区三区| 国产精品女同互慰在线看| 视频一区二区中文字幕| 成人丝袜18视频在线观看| 欧美一区二区在线不卡| 亚洲视频在线一区二区| 久久99精品久久久久婷婷| 色欧美日韩亚洲| 国产日韩影视精品| 日韩二区三区在线观看| 色婷婷亚洲综合| 国产日韩精品一区二区三区在线| 亚洲成av人综合在线观看| 99免费精品在线| 亚洲精品一区二区三区精华液| 亚洲精品视频观看| 国产成人综合视频| 欧美一区二区三区免费大片| 一区二区欧美国产| 成人黄色小视频在线观看| 日韩一区二区在线播放| 亚洲精品视频在线| 成人av在线影院| 久久综合久久综合亚洲| 日本成人在线视频网站| 欧美色图天堂网| 亚洲综合在线五月| 91麻豆蜜桃一区二区三区| 国产精品的网站| 高清不卡一区二区| 久久影院视频免费| 黄色日韩三级电影| www成人在线观看| 韩国v欧美v日本v亚洲v| 欧美成人女星排行榜| 日韩中文字幕亚洲一区二区va在线 | 亚洲男人的天堂在线aⅴ视频| 国产精品123区| 国产午夜亚洲精品不卡| 国产成人av一区| 久久精品免视看| 丁香激情综合国产| 综合亚洲深深色噜噜狠狠网站|