亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区| 精品卡一卡二卡三卡四在线| 日韩一区二区不卡| 久久色在线观看| 久久精品欧美日韩精品| 成人性色生活片| 在线视频国内自拍亚洲视频| 欧美xfplay| 欧美婷婷六月丁香综合色| 国产午夜久久久久| 亚洲第一会所有码转帖| 麻豆国产一区二区| 欧美亚洲图片小说| 国产欧美一区二区精品秋霞影院 | 午夜精品福利久久久| 久久不见久久见免费视频7| 色噜噜狠狠色综合欧洲selulu| 欧美日韩国产首页| 国产亚洲欧美一级| 免费看日韩a级影片| 色综合天天天天做夜夜夜夜做| 日韩欧美一级精品久久| 中文字幕欧美日本乱码一线二线| 视频一区欧美精品| 91丨porny丨户外露出| 51午夜精品国产| 一区二区三国产精华液| 国产精品996| 国产日韩视频一区二区三区| 琪琪一区二区三区| 在线观看国产一区二区| 亚洲夂夂婷婷色拍ww47| 99久久综合精品| 国产精品天美传媒沈樵| 国产亚洲视频系列| 裸体歌舞表演一区二区| 欧美日韩视频一区二区| 婷婷一区二区三区| 欧洲亚洲精品在线| 亚洲另类一区二区| 欧美在线观看视频一区二区 | 精品国产髙清在线看国产毛片| 亚洲免费观看高清完整| 91免费国产视频网站| 国产欧美一区二区三区鸳鸯浴| 久久精品国产精品青草| 欧美精品一区在线观看| 国内外成人在线视频| 日韩免费高清视频| 国产91丝袜在线播放0| 久久精品亚洲精品国产欧美kt∨| 久久精品二区亚洲w码| 欧美v国产在线一区二区三区| 热久久免费视频| 欧美一区二区三区四区在线观看 | 色婷婷精品久久二区二区蜜臂av| 国产精品无人区| proumb性欧美在线观看| 日韩欧美一级二级| 国产九色sp调教91| 精品国产乱码91久久久久久网站| 国产精品丝袜一区| 99视频国产精品| 亚洲日本欧美天堂| 欧美日韩高清不卡| 精品在线播放免费| 2023国产一二三区日本精品2022| 国产在线视频精品一区| 国产人成一区二区三区影院| 在线欧美一区二区| 日韩**一区毛片| 久久一留热品黄| 欧美系列在线观看| 久久黄色级2电影| 欧美激情资源网| 欧美日韩国产精品自在自线| 久久精品国产成人一区二区三区| 国产亚洲制服色| 欧美美女黄视频| 国产成人久久精品77777最新版本| 中文字幕免费不卡在线| 3atv在线一区二区三区| 国产一区三区三区| 亚洲综合成人网| 精品国产一区二区亚洲人成毛片 | 亚洲精品成人在线| 久久综合国产精品| 色琪琪一区二区三区亚洲区| 丝袜诱惑制服诱惑色一区在线观看| 欧美国产成人精品| 91精品国产综合久久精品| 极品少妇一区二区| 午夜精品视频一区| 国产免费久久精品| 国产在线国偷精品产拍免费yy| 亚洲自拍与偷拍| 久久婷婷国产综合精品青草| 不卡一区中文字幕| 国产乱码一区二区三区| 亚洲午夜羞羞片| 日韩精品在线一区二区| 色综合天天综合| 国产一区二区三区香蕉 | 欧美aaaaa成人免费观看视频| 欧美国产综合色视频| 8x福利精品第一导航| 在线观看不卡视频| 成人性生交大片免费看中文网站| 亚洲大片在线观看| 一区二区三区国产豹纹内裤在线 | 麻豆91精品视频| 亚洲精品欧美二区三区中文字幕| 欧美激情一区二区三区四区| 日韩美女天天操| 欧美色图一区二区三区| 国产中文一区二区三区| 日韩成人一级大片| 亚洲图片欧美视频| 亚洲图片欧美色图| 亚洲宅男天堂在线观看无病毒| 国产精品成人免费精品自在线观看 | 视频一区二区三区入口| 亚洲精品日韩一| 一区精品在线播放| 亚洲国产精品v| 亚洲精品中文在线观看| 久久人人爽爽爽人久久久| 成人激情图片网| 成人aa视频在线观看| 国产成人综合在线观看| 日本一不卡视频| 国产专区欧美精品| 精品一区二区三区免费视频| 日韩综合小视频| 久久精品国产亚洲5555| 精品一区二区三区蜜桃| 国产福利精品一区| 成人中文字幕合集| 99re成人精品视频| 欧美色欧美亚洲另类二区| 日本高清不卡在线观看| 欧美三级中文字| 日韩精品一区二区三区视频| 26uuu亚洲| 国产精品三级av在线播放| 一区2区3区在线看| 香蕉av福利精品导航| 日本午夜精品一区二区三区电影| 国产综合色视频| 成人激情免费网站| 99九九99九九九视频精品| 欧美人妇做爰xxxⅹ性高电影| 欧美日韩视频一区二区| 在线不卡的av| 国产精品色噜噜| 亚洲国产精品麻豆| 亚洲视频免费看| 日韩经典中文字幕一区| 久久99精品国产.久久久久久| 久久91精品久久久久久秒播| 99在线热播精品免费| 在线精品国精品国产尤物884a| 在线观看视频一区二区| 国产亚洲短视频| 亚洲精品久久久蜜桃| 亚洲欧美日韩国产综合在线| 亚洲精品久久久久久国产精华液| 亚洲女与黑人做爰| 国产一区欧美一区| 欧美在线free| 久久人人超碰精品| 日韩影院在线观看| 成人高清免费观看| 91精品欧美一区二区三区综合在| 国产精品久久久久影院亚瑟| 亚洲成人av中文| 成人手机在线视频| 2021中文字幕一区亚洲| 亚洲黄色片在线观看| 一个色综合av| 91视频国产观看| 精品国产污污免费网站入口| 精品日韩成人av| 久久久噜噜噜久久人人看| 亚洲成人激情av| 色婷婷一区二区三区四区| 国产精品私房写真福利视频| 国产美女主播视频一区| 日韩欧美国产高清| 日产欧产美韩系列久久99| 欧美日免费三级在线| 亚洲精品国产精品乱码不99| 成人app软件下载大全免费| 欧美激情一区二区三区| 国产乱一区二区| 国产亚洲精品久| 国产sm精品调教视频网站| 国产日本欧美一区二区| 成人福利电影精品一区二区在线观看| 久久综合九色综合97婷婷女人|