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

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

?? stm32f10x_rtc.c

?? STM32_TIM1_Example
?? C
字號:
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name          : stm32f10x_rtc.c
* Author             : MCD Application Team
* Version            : V1.0
* Date               : 10/08/2007
* Description        : This file provides all the RTC firmware functions.
********************************************************************************
* 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_param(IS_RTC_IT(RTC_IT));  
  assert_param(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_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_param(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_param(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_param(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_param(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_param(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| 视频一区欧美日韩| 成人毛片视频在线观看| 成人免费av资源| 日韩欧美中文字幕公布| 中文字幕一区二区三区在线不卡| 午夜精品视频一区| 成人av资源网站| 久久综合资源网| 日韩专区欧美专区| 欧美丝袜自拍制服另类| 国产精品久久久久久久久久免费看 | 久久精品国产网站| 在线观看91视频| 亚洲色图制服丝袜| 成人网在线免费视频| 日韩欧美国产三级| 午夜在线电影亚洲一区| 色先锋资源久久综合| 日本一二三不卡| 国产精品99久久久久久似苏梦涵| 欧美福利视频一区| 亚洲午夜三级在线| 在线观看网站黄不卡| 日韩毛片一二三区| jizzjizzjizz欧美| 国产精品久久二区二区| 成人三级在线视频| 国产视频911| 国内精品免费**视频| 精品久久久久久久久久久久包黑料 | 《视频一区视频二区| 高清av一区二区| 国产精品视频免费看| 丁香婷婷深情五月亚洲| 国产蜜臀av在线一区二区三区| 国产在线精品一区二区夜色| 欧美一区二区日韩| 日本亚洲电影天堂| 精品日韩一区二区三区 | 天天射综合影视| 精品视频资源站| 日韩精品欧美成人高清一区二区| 在线91免费看| 美日韩一区二区| 精品sm在线观看| 成人视屏免费看| 亚洲综合在线免费观看| 欧美视频一区二| 久久精品99国产国产精| 久久久精品免费免费| 9i看片成人免费高清| 亚洲夂夂婷婷色拍ww47| 91精品国产综合久久久久久久| 裸体歌舞表演一区二区| 国产视频一区二区在线| 色哟哟亚洲精品| 奇米影视一区二区三区| 欧美高清在线一区| 欧美影院午夜播放| 美女在线观看视频一区二区| 久久精品无码一区二区三区| 91在线观看污| 日韩二区三区四区| 国产欧美日韩综合| 欧美午夜在线一二页| 国模冰冰炮一区二区| 一区二区三区四区乱视频| 717成人午夜免费福利电影| 国产一区二区三区黄视频 | 欧美日韩一区二区在线视频| 免费在线观看一区| 国产精品国产三级国产aⅴ中文| 欧美在线播放高清精品| 久久av中文字幕片| 亚洲免费三区一区二区| 精品国产91乱码一区二区三区 | 91精品国产手机| 国产精品一级在线| 日韩精品欧美精品| 亚洲日本在线天堂| 精品久久人人做人人爱| 日本丰满少妇一区二区三区| 精品在线你懂的| 亚洲一区二区欧美激情| 国产网站一区二区| 欧美精品三级日韩久久| 97国产精品videossex| 加勒比av一区二区| 天天做天天摸天天爽国产一区 | 亚洲18女电影在线观看| 国产精品入口麻豆原神| 亚洲精品一区二区三区精华液| 精品系列免费在线观看| 日日夜夜免费精品视频| 亚洲无人区一区| 亚洲人成在线播放网站岛国| 久久久777精品电影网影网| 欧美一区二区三区公司| 欧美中文一区二区三区| 不卡的av电影| 成人av在线观| 国产精品白丝av| 老司机一区二区| 天堂成人国产精品一区| 夜夜嗨av一区二区三区四季av| 国产精品污www在线观看| 久久婷婷国产综合精品青草| 精品久久久影院| 欧美一二三区精品| 欧美一区二区三区白人| 欧美一级搡bbbb搡bbbb| 欧美精品123区| 欧美日韩的一区二区| 91极品美女在线| 色婷婷综合久久久久中文一区二区 | 欧美精品久久一区二区三区| 欧美三级韩国三级日本一级| 欧美日韩一区在线观看| 欧美中文字幕一二三区视频| 欧美日韩黄色影视| 欧美电影影音先锋| 欧美一区二区在线免费观看| 91精品国产综合久久精品性色| 欧美一区二区三区婷婷月色| 日韩欧美区一区二| 久久久精品一品道一区| 国产精品女主播av| 亚洲欧美日韩一区二区| 亚洲一区二区三区四区五区中文| 午夜精品在线看| 久久99精品久久只有精品| 国产激情视频一区二区在线观看| 成人小视频在线观看| 91麻豆免费看片| 欧美午夜精品免费| 精品国产自在久精品国产| 国产精品三级在线观看| 一区二区三区四区不卡在线| 秋霞电影一区二区| 成人午夜激情视频| 欧美调教femdomvk| 精品国产露脸精彩对白| 国产精品福利一区二区| 婷婷成人综合网| 国产伦精品一区二区三区视频青涩 | 午夜激情久久久| 国内不卡的二区三区中文字幕 | 一个色在线综合| 日韩经典中文字幕一区| 国产精品一区二区久久不卡| 91视频精品在这里| 欧美成人精品3d动漫h| 国产精品护士白丝一区av| 亚洲v日本v欧美v久久精品| 国产一区二区成人久久免费影院| 在线视频一区二区三| 久久影院视频免费| 亚洲成人免费在线观看| 成人毛片老司机大片| 欧美一级片在线看| 亚洲黄色片在线观看| 国产精品影视天天线| 欧美日韩国产另类不卡| 中文av一区二区| 激情综合色综合久久| 91九色最新地址| 国产精品毛片久久久久久久| 欧美aaaaaa午夜精品| 欧美影院午夜播放| 亚洲视频一区二区在线| 国产麻豆9l精品三级站| 欧美精品在线观看播放| 一区二区在线观看视频在线观看| 国产自产2019最新不卡| 日韩一区二区免费高清| 亚洲精品视频观看| 成人黄色小视频| 久久精品人人做| 久久电影国产免费久久电影| 欧美日韩电影一区| 一区二区三区四区蜜桃| 91在线观看地址| 中文字幕一区二区不卡| 成人综合日日夜夜| 国产午夜精品福利| 国产伦精一区二区三区| 精品噜噜噜噜久久久久久久久试看| 视频在线观看一区二区三区| 欧美性大战久久| 亚洲一区免费观看| 欧美在线观看你懂的| 怡红院av一区二区三区| 97se亚洲国产综合自在线不卡| 日本一区二区免费在线| 韩国v欧美v亚洲v日本v| 337p粉嫩大胆色噜噜噜噜亚洲| 久久91精品久久久久久秒播| 日韩精品最新网址| 精品一区二区三区免费毛片爱|