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

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

?? stm32f10x_rtc.c

?? 提供萬利的板子上能跑的在MDK下的UCOS源代碼
?? 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一免费| 在线成人小视频| 亚洲欧美另类图片小说| 国产精品小仙女| 亚洲欧美在线高清| 久久久久久99精品| 日韩电影在线看| 色综合婷婷久久| 国产精品资源站在线| 亚洲成人av免费| 最新中文字幕一区二区三区| 久久久噜噜噜久久中文字幕色伊伊| 欧美性猛交xxxx黑人交| 成人app下载| 国产精品乡下勾搭老头1| 美女久久久精品| 亚洲尤物在线视频观看| 亚洲三级理论片| 欧美激情自拍偷拍| 精品国产乱码久久久久久浪潮| 8x福利精品第一导航| 欧美在线免费观看视频| 色综合av在线| 在线观看国产一区二区| 色综合天天综合| av毛片久久久久**hd| 成人久久久精品乱码一区二区三区| 国产一区二区伦理片| 麻豆精品新av中文字幕| 麻豆精品新av中文字幕| 麻豆精品一区二区三区| 麻豆国产精品官网| 日本一道高清亚洲日美韩| 天堂久久一区二区三区| 婷婷丁香久久五月婷婷| 青青草国产精品亚洲专区无| 日日夜夜免费精品| 日韩成人免费电影| 五月婷婷综合在线| 久久久久久**毛片大全| 国产欧美一区二区三区网站 | 7777精品伊人久久久大香线蕉超级流畅| 久99久精品视频免费观看| 亚洲色图视频网站| 国产清纯美女被跳蛋高潮一区二区久久w | 麻豆成人免费电影| 欧美性生活影院| 成人av资源站| 色香蕉成人二区免费| 色噜噜久久综合| 欧美电影影音先锋| 日韩写真欧美这视频| 久久女同性恋中文字幕| 亚洲视频1区2区| 国产人妖乱国产精品人妖| 精品国内二区三区| 777午夜精品视频在线播放| 欧美优质美女网站| aaa国产一区| 大尺度一区二区| 91在线精品秘密一区二区| 国产精品一二三四| av网站一区二区三区| 99精品视频一区| 日本丶国产丶欧美色综合| av中文字幕在线不卡| 97久久超碰国产精品| 丁香天五香天堂综合| 成人高清视频在线| 91.com视频| 日韩一级在线观看| 亚洲欧美日韩在线不卡| 欧美一区二区性放荡片| 色狠狠色噜噜噜综合网| 精品久久人人做人人爱| 国产最新精品精品你懂的| 国产麻豆精品theporn| 日韩福利视频网| 成人黄色软件下载| 777午夜精品免费视频| 国产清纯在线一区二区www| 亚洲午夜成aⅴ人片| 国产一区二区三区| 欧美三级中文字幕在线观看| 久久香蕉国产线看观看99| 亚洲一区二区三区四区在线 | 亚洲妇女屁股眼交7| 精品一区二区三区久久久| 91无套直看片红桃| 日韩一区二区电影网| 久久精品亚洲精品国产欧美| 亚洲综合图片区| 国模冰冰炮一区二区| 一本到不卡精品视频在线观看 | 丝袜美腿亚洲色图| 成人av网站免费观看| 五月综合激情日本mⅴ| 国产欧美视频在线观看| 日韩欧美一级二级| 亚洲无人区一区| 成人免费电影视频| 精品国产乱码久久久久久夜甘婷婷| 亚洲图片激情小说| 国模大尺度一区二区三区| 欧美日韩在线免费视频| 国产精品免费视频观看| 精品在线免费视频| 欧美欧美午夜aⅴ在线观看| 中文字幕一区二区三区四区不卡 | 最新久久zyz资源站| 蜜臀av性久久久久蜜臀aⅴ流畅| 99久久99久久免费精品蜜臀| 国产亚洲欧美在线| 激情小说欧美图片| 欧美日本一区二区在线观看| 亚洲精品大片www| av电影一区二区| 国产欧美日韩不卡| 国产在线一区二区综合免费视频| 亚洲国产一区二区在线播放| 一本大道av伊人久久综合| 色综合久久综合中文综合网| 亚洲免费观看在线视频| 色天使久久综合网天天| 性久久久久久久久久久久| 欧美一区二区三区在线观看| 免费成人在线观看| 亚洲国产精品成人久久综合一区| 国产麻豆视频一区二区| 亚洲人成在线播放网站岛国| 日韩情涩欧美日韩视频| 在线观看视频一区二区| 4438x亚洲最大成人网| 亚洲1区2区3区视频| 欧美人妇做爰xxxⅹ性高电影| 亚洲成va人在线观看| 制服.丝袜.亚洲.另类.中文| 日本人妖一区二区| 欧美精品一区二区三区在线| 欧美精品一区二区三区蜜臀| 成人午夜在线免费| 天天av天天翘天天综合网| 精品国内二区三区| 欧美视频日韩视频| 成人福利视频在线看| 亚洲国产wwwccc36天堂| 国产欧美日韩在线视频| 欧美一区二区三区系列电影| 成人免费高清在线观看| 亚洲一区二区中文在线| 日本一区二区三区四区| 日韩一区二区三区av| 91成人看片片| 成人app在线观看| 久久草av在线| 婷婷综合久久一区二区三区| 亚洲精品美国一| 国产午夜亚洲精品理论片色戒| 国产精品久久影院| 欧美大肚乱孕交hd孕妇| 91精品久久久久久蜜臀| 国产精品中文有码| **网站欧美大片在线观看| 国产午夜精品在线观看| 91精品国产美女浴室洗澡无遮挡| 精品国产麻豆免费人成网站| 欧美a一区二区| 91精品欧美福利在线观看| 91精品视频网| 久久精品国产免费看久久精品| 国产日韩在线不卡| 在线一区二区视频| 午夜精品影院在线观看| 国产偷国产偷精品高清尤物| 91丝袜国产在线播放| 免费观看30秒视频久久| 国产精品天美传媒| 欧美日韩免费不卡视频一区二区三区| 久久精品国产99| 亚洲色图.com| 日韩一区在线播放| 亚洲bt欧美bt精品| 国产乱理伦片在线观看夜一区| 国产69精品一区二区亚洲孕妇| 欧美久久久久久久久中文字幕| va亚洲va日韩不卡在线观看| 欧美最猛黑人xxxxx猛交| 欧美日韩国产另类一区| 欧美国产日韩a欧美在线观看| 免费人成黄页网站在线一区二区 | aaa欧美日韩| 久久国产精品99精品国产| 亚洲精品中文字幕在线观看| www成人在线观看| 欧美视频一区二区|