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

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

?? stm32f10x_rtc.c

?? LCD液晶顯示驅動,芯片為ST7565,
?? C
字號:
/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
* File Name          : stm32f10x_rtc.c
* Author             : MCD Application Team
* Version            : V2.0.2
* Date               : 07/11/2008
* Description        : This file provides all the RTC firmware functions.
********************************************************************************
* THE PRESENT FIRMWARE 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 FIRMWARE 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 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 >> 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) >> 16;
  /* 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 >> 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) << 16;
  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);

  if (((RTC->CRH & RTC_IT) != (u16)RESET) && (bitstatus != (u16)RESET))
  {
    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 2008 STMicroelectronics *****END OF FILE****/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产精品一区二区三区| 91精品福利视频| 日韩电影在线观看网站| 国产精品久久久久桃色tv| 久久天堂av综合合色蜜桃网| 日韩欧美一级二级三级| 欧美猛男gaygay网站| 欧美精品三级日韩久久| 欧美二区乱c少妇| 欧美日韩精品一区二区三区蜜桃| 欧美亚洲国产一卡| 欧美日韩色综合| 777精品伊人久久久久大香线蕉| 欧美色区777第一页| 欧美日韩综合一区| 欧美一区二区在线不卡| 久久人人爽爽爽人久久久| 久久亚洲一级片| 国产精品理论在线观看| 亚洲精品中文在线影院| 天堂久久一区二区三区| 久久99九九99精品| 大桥未久av一区二区三区中文| 成人午夜激情片| 欧美日韩亚洲综合在线| 日韩欧美一区二区久久婷婷| 国产欧美一区二区精品婷婷| 亚洲欧美偷拍卡通变态| 午夜精品久久久久久久久久| 精品一区二区三区影院在线午夜| 国产精品一色哟哟哟| 色吧成人激情小说| 日韩丝袜情趣美女图片| 亚洲欧洲日韩av| 五月天丁香久久| 风间由美一区二区av101| 91久久免费观看| 欧美不卡视频一区| 亚洲三级小视频| 美女网站色91| 91在线你懂得| 精品国产亚洲在线| 亚洲电影第三页| 麻豆91在线观看| 色天天综合久久久久综合片| 日韩一卡二卡三卡| 国产欧美一区视频| 三级欧美在线一区| 成人丝袜18视频在线观看| 3751色影院一区二区三区| 国产精品天干天干在线综合| 日韩电影一区二区三区| 91在线一区二区| 26uuu国产在线精品一区二区| 亚洲亚洲精品在线观看| 国产成人av福利| 日韩精品中文字幕在线不卡尤物| 亚洲欧美在线视频观看| 国产麻豆日韩欧美久久| 欧美二区三区91| 午夜av一区二区三区| 一本大道综合伊人精品热热| 欧美成人性战久久| 一区二区三区在线免费视频| 成人精品一区二区三区四区| 欧美刺激午夜性久久久久久久| 亚洲一区在线播放| 91麻豆免费观看| 国产欧美日韩视频一区二区| 美腿丝袜在线亚洲一区| 欧美肥妇bbw| 三级亚洲高清视频| 91精品国产全国免费观看| 亚洲制服丝袜av| 日本高清视频一区二区| 综合久久给合久久狠狠狠97色| 国产精品一二三区在线| 久久综合色之久久综合| 久久97超碰色| 精品国产一区二区三区久久影院| 蜜桃视频在线观看一区二区| 欧美一区二区三区精品| 青青草国产精品97视觉盛宴 | 亚洲综合一区二区精品导航| 成人免费视频app| 国产精品私人影院| eeuss鲁片一区二区三区在线观看| 国产日韩成人精品| 成人99免费视频| 亚洲日本va午夜在线电影| 色婷婷av一区二区三区大白胸| 国产精品久久二区二区| 在线中文字幕一区二区| 亚洲精品日韩综合观看成人91| 精品一区二区免费| 欧美精品在线观看一区二区| 亚洲国产日韩a在线播放| 欧美日韩一卡二卡三卡| 日韩av电影免费观看高清完整版 | 91超碰这里只有精品国产| 天天av天天翘天天综合网| 91精品福利在线一区二区三区 | 在线视频欧美精品| 亚洲超丰满肉感bbw| 欧美不卡视频一区| 99精品国产一区二区三区不卡| 亚洲激情av在线| 日韩亚洲欧美在线| 成人免费av资源| 在线亚洲+欧美+日本专区| 中文字幕综合网| 欧美日韩成人一区二区| 久久99热狠狠色一区二区| 国产精品你懂的在线欣赏| 欧美在线三级电影| 激情五月激情综合网| 一区二区中文视频| 国产日韩视频一区二区三区| 99re成人在线| 九九在线精品视频| 一区二区三区四区蜜桃| 日韩精品一区二区在线| 91麻豆自制传媒国产之光| 精品在线免费视频| 亚洲综合在线电影| 久久五月婷婷丁香社区| 欧美精品在线一区二区| 99精品1区2区| 精久久久久久久久久久| 亚洲一区二区视频在线| 亚洲国产精品t66y| 日韩一级完整毛片| 一本大道久久精品懂色aⅴ| 亚洲视频小说图片| 91精品久久久久久久久99蜜臂| 国产999精品久久久久久| 午夜伦欧美伦电影理论片| 中文字幕一区在线观看| 精品国产百合女同互慰| 91精品中文字幕一区二区三区| 91丨porny丨最新| 国产一区二区不卡在线| 精品亚洲porn| 精品一区二区三区在线播放 | 欧美成va人片在线观看| 欧美午夜在线观看| 日本道色综合久久| av激情综合网| 91视频一区二区| 成人不卡免费av| 成人福利视频网站| 国产精品一二三四| 床上的激情91.| 福利一区二区在线| 国产精品综合一区二区| 国产成人精品亚洲日本在线桃色| 国内外精品视频| 国产一区二区三区在线观看免费 | 欧美大白屁股肥臀xxxxxx| 欧美精品xxxxbbbb| 欧美日韩免费一区二区三区| 在线观看日韩电影| 在线精品视频免费观看| 欧美日韩精品三区| 欧美精品视频www在线观看| 欧美精品一区二区三区蜜桃视频| 91精品国产福利| 欧美一卡二卡三卡| 26uuu国产电影一区二区| 久久九九影视网| 国产精品私房写真福利视频| 有坂深雪av一区二区精品| 亚洲二区在线视频| 日本欧美肥老太交大片| 国产精品一区专区| 91色在线porny| 欧美久久久久久久久中文字幕| 欧美高清一级片在线| 精品国产免费一区二区三区四区| 精品久久免费看| 国产精品久线观看视频| 亚洲一区在线免费观看| 麻豆91在线播放免费| 成人小视频在线观看| 日本大香伊一区二区三区| 日韩天堂在线观看| 中文字幕在线观看一区| 婷婷开心久久网| 成人免费看的视频| 欧美日韩国产精选| 国产亚洲欧洲一区高清在线观看| 综合久久国产九一剧情麻豆| 热久久一区二区| 9i在线看片成人免费| 欧美一区二区三区视频在线| 国产精品美女久久久久av爽李琼 | 91欧美激情一区二区三区成人| 欧美猛男超大videosgay| 中文字幕不卡一区| 秋霞午夜av一区二区三区|