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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stm32f10x_rtc.c

?? ucos2.86版本結(jié)合STM板極支持包
?? 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****/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩综合精品一区二区| 日韩高清欧美激情| 国产欧美一区二区精品秋霞影院| 欧美一卡二卡在线观看| 欧美美女一区二区| 欧美日韩极品在线观看一区| 欧美性色aⅴ视频一区日韩精品| 99久久99久久精品免费看蜜桃| 丁香婷婷综合五月| 成人免费高清视频| 成人污视频在线观看| 成人午夜电影久久影院| a亚洲天堂av| 色成人在线视频| 欧美午夜宅男影院| 7777精品伊人久久久大香线蕉经典版下载 | 欧美韩国一区二区| 欧美激情在线一区二区| 国产欧美视频一区二区三区| 国产欧美一区二区精品秋霞影院| 日本一区二区动态图| 中文字幕在线视频一区| 亚洲天堂福利av| 亚洲电影一区二区三区| 视频一区视频二区中文| 日韩av中文字幕一区二区三区 | 在线观看91视频| 欧美日韩一区二区三区四区 | 亚洲成人综合在线| 青青草原综合久久大伊人精品优势| 捆绑紧缚一区二区三区视频| 国产真实乱偷精品视频免| 成人激情动漫在线观看| 91麻豆精品秘密| 欧美乱妇一区二区三区不卡视频| 日韩免费看的电影| 国产精品国产三级国产普通话蜜臀 | 欧美日韩一区二区三区四区 | 精品国产污网站| 欧美激情在线免费观看| 亚洲高清免费观看高清完整版在线观看 | 亚洲欧洲日韩一区二区三区| 夜夜夜精品看看| 麻豆精品视频在线观看免费| 成人做爰69片免费看网站| 欧美性一区二区| 久久免费视频一区| 亚洲一区视频在线| 国产在线视视频有精品| 日本电影欧美片| 欧美精品一区二区精品网| 亚洲欧洲日本在线| 久久99最新地址| 91色视频在线| 日韩午夜激情av| 亚洲精品乱码久久久久久日本蜜臀| 美女免费视频一区| 91丨porny丨中文| 精品美女一区二区| 亚洲精品视频观看| 国产夫妻精品视频| 欧美日韩视频专区在线播放| 国产农村妇女精品| 青青草国产成人99久久| 色域天天综合网| 久久网站最新地址| 天天综合网天天综合色| 成人午夜看片网址| 精品久久国产字幕高潮| 亚洲综合一区在线| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 日韩美女啊v在线免费观看| 免费不卡在线视频| 欧美在线一区二区| 成人免费在线播放视频| 韩国一区二区在线观看| 在线综合亚洲欧美在线视频| 亚洲欧美日韩在线不卡| 国产69精品久久99不卡| 欧美变态口味重另类| 婷婷亚洲久悠悠色悠在线播放 | 国产精品久久久久一区二区三区 | 极品美女销魂一区二区三区免费 | 亚洲伦理在线精品| 成人听书哪个软件好| 日韩精品一区二区三区视频在线观看| 亚洲在线中文字幕| 色呦呦国产精品| 综合久久久久久| 成人蜜臀av电影| 国产欧美在线观看一区| 国产一区二区视频在线播放| 精品日韩在线观看| 久久疯狂做爰流白浆xx| 欧美高清视频在线高清观看mv色露露十八| 综合中文字幕亚洲| av电影在线观看不卡| 日本一二三不卡| 国产麻豆视频精品| 久久综合av免费| 精品一区二区精品| 久久众筹精品私拍模特| 国内精品国产三级国产a久久| 日韩一本二本av| 久久精品国内一区二区三区| 欧美一区午夜视频在线观看| 日韩激情av在线| 日韩亚洲欧美一区| 九一九一国产精品| 久久久精品影视| 国产91在线|亚洲| 中文一区一区三区高中清不卡| 国产精品1区2区| 国产精品视频免费看| gogogo免费视频观看亚洲一| 国产精品美女久久久久久2018| 成人午夜电影小说| 亚洲精品免费电影| 欧美日韩一区在线| 日本伊人午夜精品| 精品卡一卡二卡三卡四在线| 国产精品一区二区久激情瑜伽| 国产亚洲短视频| eeuss国产一区二区三区| 亚洲欧美日本在线| 欧美日韩1234| 精品在线一区二区三区| 国产亚洲美州欧州综合国| 成人激情免费网站| 一区二区三区在线免费观看| 在线不卡欧美精品一区二区三区| 美女久久久精品| 国产欧美一区在线| 欧美在线观看禁18| 老司机午夜精品99久久| 美国一区二区三区在线播放| 久久久久国产成人精品亚洲午夜| 成人国产视频在线观看| 亚洲综合图片区| 精品少妇一区二区三区在线视频| 成人性视频网站| 亚洲一区二区三区四区五区黄| 日韩亚洲国产中文字幕欧美| 粉嫩高潮美女一区二区三区| 有码一区二区三区| 日韩一区二区在线观看视频| 风间由美性色一区二区三区| 亚洲第一综合色| 久久久久九九视频| 91福利视频在线| 韩国女主播一区| 亚洲码国产岛国毛片在线| 日韩午夜av一区| 97久久超碰精品国产| 麻豆国产91在线播放| 国产精品成人在线观看| 91精品国产品国语在线不卡| 国产成人精品综合在线观看 | 处破女av一区二区| 午夜精品福利一区二区蜜股av| 久久久久一区二区三区四区| 色乱码一区二区三区88| 经典一区二区三区| 亚洲高清免费一级二级三级| 国产欧美日韩在线观看| 欧美一区二区视频在线观看| 91欧美一区二区| 另类调教123区| 亚洲自拍欧美精品| 欧美激情艳妇裸体舞| 日韩欧美国产一区二区在线播放 | 日韩欧美中文字幕一区| 成人动漫一区二区在线| 毛片av一区二区三区| 亚洲另类在线制服丝袜| 久久久久久毛片| 欧美二区三区91| 91香蕉国产在线观看软件| 国产精品中文欧美| 丝袜国产日韩另类美女| 亚洲蜜桃精久久久久久久| 国产欧美日韩麻豆91| 精品88久久久久88久久久| 欧美久久久久久久久久| 色综合色综合色综合色综合色综合| 久久99国内精品| 丝袜美腿亚洲综合| 亚洲国产一区在线观看| 亚洲男同性恋视频| 国产精品国产a| 国产精品日产欧美久久久久| 亚洲精品一区二区三区四区高清| 欧美日韩国产另类不卡| 欧美性三三影院| 色婷婷精品大在线视频| 色综合网色综合| 色综合久久66| 91在线观看成人| 99精品国产视频| 成人激情动漫在线观看|