585 lines
22 KiB
C
585 lines
22 KiB
C
|
|
/*******************************************************************************
|
|||
|
|
*
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
|
* <EFBFBD>人<EFBFBD><EFBFBD>Դ<EFBFBD>뵼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD>̴<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>ר<EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɴ<EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD><EFBFBD>ܡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD>κη<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>人<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD>Ӧ<EFBFBD>̶Գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩ<EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>;<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>ı<EFBFBD>֤
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD>ۺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Σ<EFBFBD><EFBFBD>人<EFBFBD><EFBFBD>Դ<EFBFBD>뵼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪<EFBFBD>䷢<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĶ<EFBFBD>ʧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӵġ<EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κκ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ծ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>ڿɽ<EFBFBD>ʡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
|||
|
|
* ijЩ˾<EFBFBD><EFBFBD>Ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӵġ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κε<EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijЩ<EFBFBD><EFBFBD>
|
|||
|
|
* ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD>ܲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
*
|
|||
|
|
*******************************************************************************/
|
|||
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|||
|
|
#ifndef __CW32F030_RTC_H
|
|||
|
|
#define __CW32F030_RTC_H
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
extern "C"
|
|||
|
|
{
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
/* Includes ------------------------------------------------------------------*/
|
|||
|
|
#include "base_types.h"
|
|||
|
|
#include "cw32f030.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint8_t Day;
|
|||
|
|
uint8_t Month;
|
|||
|
|
uint8_t Year;
|
|||
|
|
uint8_t Week;
|
|||
|
|
} RTC_DateTypeDef;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint8_t Second;
|
|||
|
|
uint8_t Minute;
|
|||
|
|
uint8_t Hour;
|
|||
|
|
uint8_t AMPM;
|
|||
|
|
uint8_t H24; //RTC_HOUR24(1),RTC_HOUR12(0)
|
|||
|
|
} RTC_TimeTypeDef;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint32_t RTC_ClockSource;
|
|||
|
|
RTC_TimeTypeDef TimeStruct;
|
|||
|
|
RTC_DateTypeDef DateStruct;
|
|||
|
|
|
|||
|
|
} RTC_InitTypeDef;
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
RTC_TimeTypeDef RTC_AlarmTime;
|
|||
|
|
uint32_t RTC_AlarmMask; /*!< @ref RTC_AlarmMask_Definitions */
|
|||
|
|
}RTC_AlarmTypeDef;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint8_t AWT_ClockSource;
|
|||
|
|
uint16_t AWT_ARRValue;
|
|||
|
|
} RTC_AWTTypeDef;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint32_t Freq;
|
|||
|
|
uint32_t Sign;
|
|||
|
|
uint32_t Step;
|
|||
|
|
uint32_t CompensationValue;
|
|||
|
|
}RTC_CalibTypeDef;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define RTC_Alarm_A ((uint32_t)0x00000200)
|
|||
|
|
#define RTC_Alarm_B ((uint32_t)0x00000400)
|
|||
|
|
#define IS_RTC_ALARM(ALARM) (((ALARM) == RTC_Alarm_A) || ((ALARM) == RTC_Alarm_B))
|
|||
|
|
#define IS_RTC_CMD_ALARM(ALARM) (((ALARM) & (RTC_Alarm_A | RTC_Alarm_B)) != (uint32_t)RESET)
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_ACCESS_TIMEOUT
|
|||
|
|
* @{
|
|||
|
|
* RTC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RTC_CR1->WINDOWλδ<EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RTC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_ACCESS_MAXTIMES ((uint32_t)200U)
|
|||
|
|
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_RTC1HZ_source
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_RTC1HZ_NONE (0UL)
|
|||
|
|
#define RTC_RTC1HZ_FROM_LSE (1UL << 5)
|
|||
|
|
#define RTC_RTC1HZ_FROM_PCLK (3UL << 5)
|
|||
|
|
|
|||
|
|
#define IS_RTC_RTC1HZ_SOURCE(src) (((src) == RTC_RTC1HZ_NONE) || \
|
|||
|
|
((src) == RTC_RTC1HZ_FROM_PCLK) || \
|
|||
|
|
((src) == RTC_RTC1HZ_FROM_LSE))
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define RTC_HOUR24 (1UL << 3)
|
|||
|
|
#define RTC_HOUR12 (0UL)
|
|||
|
|
#define IS_RTC_HOUR_FORMAT(fmt) (((fmt) == RTC_HOUR24) || ((fmt) == RTC_HOUR12))
|
|||
|
|
#define IS_RTC_HOUR12_FORMAT(fmt) ((fmt) == RTC_HOUR12)
|
|||
|
|
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Interval_Value
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_INTERVAL_NONE (0X00)
|
|||
|
|
#define RTC_INTERVAL_EVERY_0_5S (0x01)
|
|||
|
|
#define RTC_INTERVAL_EVERY_1S (0x02)
|
|||
|
|
#define RTC_INTERVAL_EVERY_1M (0x03)
|
|||
|
|
#define RTC_INTERVAL_EVERY_1H (0x04)
|
|||
|
|
#define RTC_INTERVAL_EVERY_1D (0x05)
|
|||
|
|
#define RTC_INTERVAL_EVERY_1MO (0x06)
|
|||
|
|
|
|||
|
|
#define IS_RTC_INTERVAL_PERIOD(per) (per < 7)
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Clock_source
|
|||
|
|
* 000<EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>LSE
|
|||
|
|
* 010<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>Ƶʱ<EFBFBD><EFBFBD>LSI
|
|||
|
|
* 100<EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>HSE / 128
|
|||
|
|
* 101<EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>HSE / 256
|
|||
|
|
* 110<EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>HSE / 512
|
|||
|
|
* 111<EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>HSE / 1024
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_RTCCLK_FROM_LSE (0UL)
|
|||
|
|
#define RTC_RTCCLK_FROM_LSI (2UL << 8)
|
|||
|
|
#define RTC_RTCCLK_FROM_HSE_128 (4UL << 8)
|
|||
|
|
#define RTC_RTCCLK_FROM_HSE_256 (5UL << 8)
|
|||
|
|
#define RTC_RTCCLK_FROM_HSE_512 (6UL << 8)
|
|||
|
|
#define RTC_RTCCLK_FROM_HSE_1024 (7UL << 8)
|
|||
|
|
|
|||
|
|
#define IS_RTC_RTCCLK_SOURCE(src) (((src) == RTC_RTCCLK_FROM_LSE) || \
|
|||
|
|
((src) == RTC_RTCCLK_FROM_LSI) || \
|
|||
|
|
((src) == RTC_RTCCLK_FROM_HSE_128) || \
|
|||
|
|
((src) == RTC_RTCCLK_FROM_HSE_256) || \
|
|||
|
|
((src) == RTC_RTCCLK_FROM_HSE_512) || \
|
|||
|
|
((src) == RTC_RTCCLK_FROM_HSE_1024))
|
|||
|
|
|
|||
|
|
#define RTC_IT_INTERVAL (1UL << 6)
|
|||
|
|
#define RTC_IT_TAMPOV (1UL << 4)
|
|||
|
|
#define RTC_IT_TAMP (1UL << 3)
|
|||
|
|
#define RTC_IT_AWTIMER (1UL << 2)
|
|||
|
|
#define RTC_IT_ALARMB (1UL << 1)
|
|||
|
|
#define RTC_IT_ALARMA (1UL)
|
|||
|
|
#define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_INTERVAL) || \
|
|||
|
|
((IT) == RTC_IT_TAMPOV) || \
|
|||
|
|
((IT) == RTC_IT_TAMP) || \
|
|||
|
|
((IT) == RTC_IT_AWTIMER) || \
|
|||
|
|
((IT) == RTC_IT_ALARMB) || \
|
|||
|
|
((IT) == RTC_IT_ALARMA))
|
|||
|
|
#define IS_RTC_CONFIG_IT(IT) ((((uint8_t)(IT) & 0x20) == 0) && \
|
|||
|
|
((uint8_t)(IT) < 0x40))
|
|||
|
|
#define IS_RTC_CLAER_IT(IT) ((((uint8_t)(IT) & 0x20) == 0) && \
|
|||
|
|
((uint8_t)(IT) < 0x40))
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_AlarmMask_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_AlarmMask_None ((uint32_t)0x00000000)
|
|||
|
|
#define RTC_AlarmMask_WeekSAT ((uint32_t)0x40000000)
|
|||
|
|
#define RTC_AlarmMask_WeekFRI ((uint32_t)0x20000000)
|
|||
|
|
#define RTC_AlarmMask_WeekTHU ((uint32_t)0x10000000)
|
|||
|
|
#define RTC_AlarmMask_WeekWED ((uint32_t)0x08000000)
|
|||
|
|
#define RTC_AlarmMask_WeekTUE ((uint32_t)0x04000000)
|
|||
|
|
#define RTC_AlarmMask_WeekMON ((uint32_t)0x02000000)
|
|||
|
|
#define RTC_AlarmMask_WeekSun ((uint32_t)0x01000000)
|
|||
|
|
#define RTC_AlarmMask_Hours ((uint32_t)0x00800000)
|
|||
|
|
#define RTC_AlarmMask_Minutes ((uint32_t)0x00008000)
|
|||
|
|
#define RTC_AlarmMask_Seconds ((uint32_t)0x00000080)
|
|||
|
|
#define RTC_AlarmMask_All ((uint32_t)0x7F808080)
|
|||
|
|
#define IS_ALARM_MASK(MASK) (((MASK) & 0x807F7F7F) == (uint32_t)RESET)
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define RTC_TamperTrigger_RisingEdge (0UL)
|
|||
|
|
#define RTC_TamperTrigger_FallingEdge (1UL)
|
|||
|
|
#define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TamperTrigger_RisingEdge) || \
|
|||
|
|
((TRIGGER) == RTC_TamperTrigger_FallingEdge))
|
|||
|
|
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Compen_step
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_RTCOUT_AS_LOW (0x0)
|
|||
|
|
#define RTC_RTCOUT_AS_ALARM_A (0x1)
|
|||
|
|
#define RTC_RTCOUT_AS_ALARM_B (0x2)
|
|||
|
|
#define RTC_RTCOUT_AS_AWT (0x3)
|
|||
|
|
|
|||
|
|
#define IS_RTC_RTCOUT_SOURCE(src) (src < 4)
|
|||
|
|
/*
|
|||
|
|
#define IS_RTC_RTCOUT_SOURCE(src) (((src) == RTC_RTCOUT_AS_LOW) || \
|
|||
|
|
((src) == RTC_RTCOUT_AS_ALARM_A) || \
|
|||
|
|
((src) == RTC_RTCOUT_AS_ALARM_B) || \
|
|||
|
|
((src) == RTC_RTCOUT_AS_AWT)) )
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_TimerSrc_Value
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTCCLK_2 (0x0)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTCCLK_4 (0x1)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTCCLK_8 (0x2)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTCCLK_16 (0x3)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTC1HZ_1 (0x4)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTC1HZ_2 (0x5)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTC1HZ_4 (0x6)
|
|||
|
|
#define RTC_AWTSOURCE_FROM_RTC1HZ_8 (0x7)
|
|||
|
|
|
|||
|
|
#define IS_RTC_AWTTIMER_SOURCE(clk) (clk < 8)
|
|||
|
|
/*
|
|||
|
|
#define IS_RTC_AWTTIMER_SOURCE(clk) (((clk) == RTC_AWTSOURCE_FROM_RTCCLK_2) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTCCLK_4) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTCCLK_8) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTCCLK_16) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTC1HZ_1) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTC1HZ_2) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTC1HZ_4) || \
|
|||
|
|
((clk) == RTC_AWTSOURCE_FROM_RTC1HZ_8))
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Compen_Freq
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_COMPENFREQ_AS_4MHZ (0x0UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_6MHZ (0x1UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_8MHZ (0x2UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_12MHZ (0x3UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_16MHZ (0x4UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_20MHZ (0x5UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_24MHZ (0x6UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_30MHZ (0x7UL)
|
|||
|
|
#define RTC_COMPENFREQ_AS_48MHZ (0x8UL)
|
|||
|
|
|
|||
|
|
#define IS_RTC_COMPEN_FREQ(clk) (clk < 9)
|
|||
|
|
/*
|
|||
|
|
#define IS_RTC_COMPEN_FREQ(clk) (((clk) == RTC_COMPENFREQ_AS_4MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_6MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_8MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_12MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_16MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_20MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_24MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_30MHZ) || \
|
|||
|
|
((clk) == RTC_COMPENFREQ_AS_48MHZ))
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Compen_step
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_COMPENSTEP_0_950PPM (0x0UL)
|
|||
|
|
#define RTC_COMPENSTEP_0_238PPM (0x1UL)
|
|||
|
|
#define RTC_COMPENSTEP_0_119PPM (0x2UL)
|
|||
|
|
|
|||
|
|
#define IS_RTC_COMPEN_STEP(stp) ((stp) < 3)
|
|||
|
|
/*
|
|||
|
|
#define IS_RTC_COMPEN_STEP(stp) (((stp) == RTC_COMPENSTEP_0_950PPM) || \
|
|||
|
|
((stp) == RTC_COMPENSTEP_0_238PPM) || \
|
|||
|
|
((stp) == RTC_COMPENSTEP_0_119PPM)) )
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_COMPEN_SIGN_UP (0UL)
|
|||
|
|
#define RTC_COMPEN_SIGN_DOWN (1UL)
|
|||
|
|
#define IS_RTC_COMPEN_SIGN(SIGN) ((SIGN) < 2)
|
|||
|
|
|
|||
|
|
#define IS_RTC_COMPEN_VALUE(VAL) ((VAL) & 0xFFFFF000 == RESET)
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Month_Day_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_Month_January ((uint8_t)0x01)
|
|||
|
|
#define RTC_Month_February ((uint8_t)0x02)
|
|||
|
|
#define RTC_Month_March ((uint8_t)0x03)
|
|||
|
|
#define RTC_Month_April ((uint8_t)0x04)
|
|||
|
|
#define RTC_Month_May ((uint8_t)0x05)
|
|||
|
|
#define RTC_Month_June ((uint8_t)0x06)
|
|||
|
|
#define RTC_Month_July ((uint8_t)0x07)
|
|||
|
|
#define RTC_Month_August ((uint8_t)0x08)
|
|||
|
|
#define RTC_Month_September ((uint8_t)0x09)
|
|||
|
|
#define RTC_Month_October ((uint8_t)0x10)
|
|||
|
|
#define RTC_Month_November ((uint8_t)0x11)
|
|||
|
|
#define RTC_Month_December ((uint8_t)0x12)
|
|||
|
|
#define IS_RTC_MONTH(MON) (((MON) >= 1) && ((MON) <= 12))
|
|||
|
|
#define IS_RTC_DAY(DAY) (((DAY) >= 1) && ((DAY) <= 31))
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_WeekDay_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define RTC_Weekday_Sunday ((uint8_t)0x00)
|
|||
|
|
#define RTC_Weekday_Monday ((uint8_t)0x01)
|
|||
|
|
#define RTC_Weekday_Tuesday ((uint8_t)0x02)
|
|||
|
|
#define RTC_Weekday_Wednesday ((uint8_t)0x03)
|
|||
|
|
#define RTC_Weekday_Thursday ((uint8_t)0x04)
|
|||
|
|
#define RTC_Weekday_Friday ((uint8_t)0x05)
|
|||
|
|
#define RTC_Weekday_Saturday ((uint8_t)0x06)
|
|||
|
|
|
|||
|
|
#define IS_RTC_WEEKDAY(wek) (wek < 7)
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
#define IS_RTC_WEEKDAY(wek) (((wek) == RTC_Weekday_Monday) || \
|
|||
|
|
((wek) == RTC_Weekday_Tuesday) || \
|
|||
|
|
((wek) == RTC_Weekday_Wednesday) || \
|
|||
|
|
((wek) == RTC_Weekday_Thursday) || \
|
|||
|
|
((wek) == RTC_Weekday_Friday) || \
|
|||
|
|
((wek) == RTC_Weekday_Saturday) || \
|
|||
|
|
((wek) == RTC_Weekday_Sunday))
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Alarm_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(dat) (((dat) > 0) && ((dat) <= 31))
|
|||
|
|
#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(wek) (((wek) == RTC_Weekday_Monday) || \
|
|||
|
|
((wek) == RTC_Weekday_Tuesday) || \
|
|||
|
|
((wek) == RTC_Weekday_Wednesday) || \
|
|||
|
|
((wek) == RTC_Weekday_Thursday) || \
|
|||
|
|
((wek) == RTC_Weekday_Friday) || \
|
|||
|
|
((wek) == RTC_Weekday_Saturday) || \
|
|||
|
|
((wek) == RTC_Weekday_Sunday))
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Time_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define IS_RTC_HOUR12(hor) (((hor) >= 1) && ((hor) <= 12))
|
|||
|
|
#define IS_RTC_HOUR24(hor) ((hor) <= 23)
|
|||
|
|
#define IS_RTC_MINUTES(min) ((min) <= 59)
|
|||
|
|
#define IS_RTC_SECONDS(sec) ((sec) <= 59)
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_AM_PM_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_H12_AM (0UL)
|
|||
|
|
#define RTC_H12_PM (1UL)
|
|||
|
|
#define IS_RTC_H12_AMPM(apm) (((apm) == RTC_H12_AM) || ((apm) == RTC_H12_PM))
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_Year_Date_Definitions
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define IS_RTC_YEAR(yer) ((yer) <= 99)
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** @defgroup RTC_KEY_WORD
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define RTC_KEY_WORD1 ((uint8_t)0xCA)
|
|||
|
|
#define RTC_KEY_WORD2 ((uint8_t)0x53)
|
|||
|
|
|
|||
|
|
#define RTC_KEY_LOCKW ((uint8_t)0x55)
|
|||
|
|
|
|||
|
|
#define IS_RTC_KEYWORD(kwd) (((kwd) == RTC_KEY_WORD1) || ((kwd) == RTC_KEY_WORD2))
|
|||
|
|
|
|||
|
|
#define RTC_UNLOCK() do{ CW_RTC->KEY_f.KEY = RTC_KEY_WORD1;\
|
|||
|
|
CW_RTC->KEY_f.KEY = RTC_KEY_WORD2; }while (0)
|
|||
|
|
#define RTC_LOCK() do{ CW_RTC->KEY_f.KEY = RTC_KEY_WORD1; \
|
|||
|
|
CW_RTC->KEY_f.KEY = RTC_KEY_WORD1;}while (0)
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
#define RTC_DATE_RESET_VALUE ((uint32_t) 0x00000000)
|
|||
|
|
#define RTC_TIME_RESET_VALUE ((uint32_t) 0x12000000)
|
|||
|
|
#define RTC_ALARMA_RESET_VALUE ((uint32_t) 0x12000000)
|
|||
|
|
#define RTC_ALARMB_RESET_VALUE ((uint32_t) 0x12000000)
|
|||
|
|
#define RTC_TAMPDATA_RESET_VALUE ((uint32_t) 0x00000000)
|
|||
|
|
#define RTC_TAMPTIME_RESET_VALUE ((uint32_t) 0x00000000)
|
|||
|
|
#define RTC_AWTARR_RESET_VALUE ((uint32_t) 0x0000FFFF)
|
|||
|
|
#define RTC_IER_RESET_VALUE ((uint32_t) 0x00000000)
|
|||
|
|
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
|
|||
|
|
//RTC CONTROLLER REGSITER0
|
|||
|
|
#define RTC_START_ENABLE() (CW_RTC->CR0_f.START = 1)
|
|||
|
|
#define RTC_START_DISABLE() (CW_RTC->CR0_f.START = 0)
|
|||
|
|
|
|||
|
|
#define RTC_RTC1HZ_PCLK() (CW_RTC->CR0_f.RTC1HZ = RTC_RTC1HZ_FROM_PCLK)
|
|||
|
|
#define RTC_RTC1HZ_LSE() (CW_RTC->CR0_f.RTC1HZ = RTC_RTC1HZ_FROM_LSE)
|
|||
|
|
|
|||
|
|
#define RTC_AMPM_12HOUR() (CW_RTC->CR0_f.AMPM = 0)
|
|||
|
|
#define RTC_AMPM_24HOUR() (CW_RTC->CR0_f.AMPM = 1)
|
|||
|
|
|
|||
|
|
#define RTC_INTERVAL_0_5S() (CW_RTC->CR0_f.INTERVAL = RTC_INTERVAL_EVERY_0_5S)
|
|||
|
|
#define RTC_INTERVAL_1S() (CW_RTC->CR0_f.INTERVAL = RTC_INTERVAL_EVERY_1S)
|
|||
|
|
#define RTC_INTERVAL_1M() (CW_RTC->CR0_f.INTERVAL = RTC_INTERVAL_EVERY_1M)
|
|||
|
|
#define RTC_INTERVAL_1H() (CW_RTC->CR0_f.INTERVAL = RTC_INTERVAL_EVERY_1H)
|
|||
|
|
#define RTC_INTERVAL_1D() (CW_RTC->CR0_f.INTERVAL = RTC_INTERVAL_EVERY_1D)
|
|||
|
|
#define RTC_INTERVAL_1MO() (CW_RTC->CR0_f.INTERVAL = RTC_INTERVAL_EVERY_1MO)
|
|||
|
|
|
|||
|
|
#define IS_RTC_START() (CW_RTC->CR0 & bv7)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC CONTROLLER REGSITER1
|
|||
|
|
#define RTC_RTCCLK_LSE() (CW_RTC->CR1_f.SOURCE = RTC_RTCCLK_FROM_LSE)
|
|||
|
|
#define RTC_RTCCLK_LSI() (CW_RTC->CR1_f.SOURCE = RTC_RTCCLK_FROM_LIE)
|
|||
|
|
#define RTC_RTCCLK_HSE128() (CW_RTC->CR1_f.SOURCE = RTC_RTCCLK_FROM_HSE_128)
|
|||
|
|
#define RTC_RTCCLK_HSE256() (CW_RTC->CR1_f.SOURCE = RTC_RTCCLK_FROM_HSE_256)
|
|||
|
|
#define RTC_RTCCLK_HSE512() (CW_RTC->CR1_f.SOURCE = RTC_RTCCLK_FROM_HSE_512)
|
|||
|
|
#define RTC_RTCCLK_HSE1024() (CW_RTC->CR1_f.SOURCE = RTC_RTCCLK_FROM_HSE_1024)
|
|||
|
|
|
|||
|
|
#define RTC_WINDOW_GETVALUE() (CW_RTC->CR1_f.WINDOW)
|
|||
|
|
#define RTC_ACCESS_GETVALUE() (CW_RTC->CR1_f.ACCESS)
|
|||
|
|
#define RTC_ACCESS_SET() (CW_RTC->CR1_f.ACCESS = 1)
|
|||
|
|
#define RTC_ACCESS_RESET() (CW_RTC->CR1_f.ACCESS = 0)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC CONTROLLER REGSITER2
|
|||
|
|
#define RTC_ALARM_A_ENABLE() (CW_RTC->CR2_f.ALARMAEN = 1)
|
|||
|
|
#define RTC_ALARM_A_DISABLE() (CW_RTC->CR2_f.ALARMAEN = 0)
|
|||
|
|
|
|||
|
|
#define RTC_ALARM_B_ENABLE() (CW_RTC->CR2_f.ALARMBEN = 1)
|
|||
|
|
#define RTC_ALARM_B_DISABLE() (CW_RTC->CR2_f.ALARMBEN = 0)
|
|||
|
|
|
|||
|
|
#define RTC_AWT_ENABLE() (CW_RTC->CR2_f.AWTEN = 1)
|
|||
|
|
#define RTC_AWT_DISABLE() (CW_RTC->CR2_f.AWTEN = 0)
|
|||
|
|
|
|||
|
|
#define RTC_TAMP_ENABLE() (CW_RTC->CR2_f.TAMPEN = 1)
|
|||
|
|
#define RTC_TAMP_DISABLE() (CW_RTC->CR2_f.TAMPEN = 0)
|
|||
|
|
|
|||
|
|
#define RTC_RTCOUT_LOW() (CW_RTC->CR2_f.RTCOUT = RTC_RTCOUT_AS_LOW)
|
|||
|
|
#define RTC_RTCOUT_ALARM_A() (CW_RTC->CR2_f.RTCOUT = RTC_RTCOUT_AS_ALARM_A)
|
|||
|
|
#define RTC_RTCOUT_ALARM_B() (CW_RTC->CR2_f.RTCOUT = RTC_RTCOUT_AS_ALARM_B)
|
|||
|
|
#define RTC_RTCOUT_AWT() (CW_RTC->CR2_f.RTCOUT = RTC_RTCOUT_AS_AWT)
|
|||
|
|
|
|||
|
|
#define RTC_TAMPEDGE_FALL() (CW_RTC->CR2_f.TAMPEDGE = 1)
|
|||
|
|
#define RTC_TAMPEDGE_RISE() (CW_RTC->CR2_f.TAMPEDGE = 0)
|
|||
|
|
|
|||
|
|
#define RTC_AWTSOURCE_RTCLK_2() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTCCLK_2)
|
|||
|
|
#define RTC_AWTSOURCE_RTCLK_4() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTCCLK_4)
|
|||
|
|
#define RTC_AWTSOURCE_RTCLK_8() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTCCLK_8)
|
|||
|
|
#define RTC_AWTSOURCE_RTCLK_16() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTCCLK_16)
|
|||
|
|
#define RTC_AWTSOURCE_RTC1HZ_1() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTC1HZ_1)
|
|||
|
|
#define RTC_AWTSOURCE_RTC1HZ_2() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTC1HZ_2)
|
|||
|
|
#define RTC_AWTSOURCE_RTC1HZ_4() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTC1HZ_4)
|
|||
|
|
#define RTC_AWTSOURCE_RTC1HZ_8() (CW_RTC->CR2_f.TIMERSRC = RTC_AWTSOURCE_FROM_RTC1HZ_8)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC COMPEN REGSITER
|
|||
|
|
#define RTC_COMPEN_ENABLE() (CW_RTC->COMPEN_f.EN = 1)
|
|||
|
|
#define RTC_COMPEN_DISABLE() (CW_RTC->COMPEN_f.EN = 0)
|
|||
|
|
|
|||
|
|
#define RTC_COMPEN_STEP_0_950PPM() (CW_RTC->COMPEN_f.STEP = RTC_COMPENSTEP_0_950PPM)
|
|||
|
|
#define RTC_COMPEN_STEP_0_238PPM() (CW_RTC->COMPEN_f.STEP = RTC_COMPENSTEP_0_238PPM)
|
|||
|
|
#define RTC_COMPEN_STEP_0_119PPM() (CW_RTC->COMPEN_f.STEP = RTC_COMPENSTEP_0_119PPM)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC ALARM A CONTROLLER REGSITER
|
|||
|
|
#define RTC_ALARMA_HOURMASK_ENABLE() (CW_RTC->ALARMA_f.HOURMASK = 1)
|
|||
|
|
#define RTC_ALARMA_HOURMASK_DISABLE() (CW_RTC->ALARMA_f.HOURMASK = 0)
|
|||
|
|
|
|||
|
|
#define RTC_ALARMA_MINUTEMASK_ENABLE() (CW_RTC->ALARMA_f.MINUTEMASK = 1)
|
|||
|
|
#define RTC_ALARMA_MINUTEMASK_DISABLE() (CW_RTC->ALARMA_f.MINUTEMASK = 0)
|
|||
|
|
|
|||
|
|
#define RTC_ALARMA_SECONDMASK_ENABLE() (CW_RTC->ALARMA_f.SECONDMASK = 1)
|
|||
|
|
#define RTC_ALARMA_SECONDMASK_DISABLE() (CW_RTC->ALARMA_f.SECONDMASK = 0)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC ALARM B CONTROLLER REGSITER
|
|||
|
|
#define RTC_ALARMB_HOURMASK_ENABLE() (CW_RTC->ALARMB_f.HOURMASK = 1)
|
|||
|
|
#define RTC_ALARMB_HOURMASK_DISABLE() (CW_RTC->ALARMB_f.HOURMASK = 0)
|
|||
|
|
|
|||
|
|
#define RTC_ALARMB_MINUTEMASK_ENABLE() (CW_RTC->ALARMB_f.MINUTEMASK = 1)
|
|||
|
|
#define RTC_ALARMB_MINUTEMASK_DISABLE() (CW_RTC->ALARMB_f.MINUTEMASK = 0)
|
|||
|
|
|
|||
|
|
#define RTC_ALARMB_SECONDMASK_ENABLE() (CW_RTC->ALARMB_f.SECONDMASK = 1)
|
|||
|
|
#define RTC_ALARMB_SECONDMASK_DISABLE() (CW_RTC->ALARMB_f.SECONDMASK = 0)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC INTERRUPT ENABLE REGSITER
|
|||
|
|
#define RTC_IE_INTERVAL_ENABLE() (CW_RTC->IER_f.INTERVAL = 1)
|
|||
|
|
#define RTC_IE_INTERVAL_DISABLE() (CW_RTC->IER_f.INTERVAL = 0)
|
|||
|
|
|
|||
|
|
#define RTC_IE_TAMPOV_ENABLE() (CW_RTC->IER_f.TAMPOV = 1)
|
|||
|
|
#define RTC_IE_TAMPOV_DISABLE() (CW_RTC->IER_f.TAMPOV = 0)
|
|||
|
|
|
|||
|
|
#define RTC_IE_TAMP_ENABLE() (CW_RTC->IER_f.TAMP = 1)
|
|||
|
|
#define RTC_IE_TAMP_DISABLE() (CW_RTC->IER_f.TAMP = 0)
|
|||
|
|
|
|||
|
|
#define RTC_IE_AWTIMER_ENABLE() (CW_RTC->IER_f.AWTIMER = 1)
|
|||
|
|
#define RTC_IE_AWTIMER_DISABLE() (CW_RTC->IER_f.AWTIMER = 0)
|
|||
|
|
|
|||
|
|
#define RTC_IE_ALARMA_ENABLE() (CW_RTC->IER_f.ALARMA = 1)
|
|||
|
|
#define RTC_IE_ALARMA_DISABLE() (CW_RTC->IER_f.ALARMA = 0)
|
|||
|
|
|
|||
|
|
#define RTC_IE_ALARMB_ENABLE() (CW_RTC->IER_f.ALARMB = 1)
|
|||
|
|
#define RTC_IE_ALARMB_DISABLE() (CW_RTC->IER_f.ALARMB = 0)
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
//RTC INTERRUPT CLEAR REGSITER
|
|||
|
|
#define RTC_IE_INTERVAL_CLEAR() (CW_RTC->ICR_f.INTERVAL = 0)
|
|||
|
|
#define RTC_IE_TAMPOV_CLEAR() (CW_RTC->ICR_f.TAMPOV = 0)
|
|||
|
|
#define RTC_IE_TAMP_CLEAR() (CW_RTC->ICR_f.TAMP = 0)
|
|||
|
|
#define RTC_IE_AWTIMER_CLEAR() (CW_RTC->ICR_f.AWTIMER = 0)
|
|||
|
|
#define RTC_IE_ALARMA_CLEAR() (CW_RTC->ICR_f.ALARMA = 0)
|
|||
|
|
#define RTC_IE_ALARMB_CLEAR() (CW_RTC->ICR_f.ALARMB = 0)
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//============================================================
|
|||
|
|
// CW32F030 RTC HAL API Function<6F><6E>Total<61><6C> 14<31><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//============================================================
|
|||
|
|
void RTC_DeInit(void);
|
|||
|
|
ErrorStatus RTC_Init(RTC_InitTypeDef *RTC_InitStruct);
|
|||
|
|
void RTC_Cmd(FunctionalState NewState);
|
|||
|
|
ITStatus RTC_GetITState(uint32_t RTC_ITState);
|
|||
|
|
void RTC_ITConfig(uint32_t RTC_IT, FunctionalState NewState);
|
|||
|
|
void RTC_ClearITPendingBit(uint32_t RTC_IT);
|
|||
|
|
void RTC_SetTime(RTC_TimeTypeDef* RTC_TimeStruct);
|
|||
|
|
void RTC_SetDate(RTC_DateTypeDef *RTC_Date);
|
|||
|
|
void RTC_GetTime(RTC_TimeTypeDef* RTC_TimeStruct);
|
|||
|
|
void RTC_GetDate(RTC_DateTypeDef *RTC_Date);
|
|||
|
|
void RTC_SetAlarm(uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
|
|||
|
|
void RTC_GetAlarm(uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
|
|||
|
|
void RTC_AlarmCmd(uint32_t RTC_Alarm, FunctionalState NewState);
|
|||
|
|
void RTC_TamperTriggerConfig(uint32_t RTC_TamperTrigger);
|
|||
|
|
void RTC_TamperCmd(FunctionalState NewState);
|
|||
|
|
void RTC_GetTamperDate(RTC_DateTypeDef *RTC_Date);
|
|||
|
|
void RTC_GetTamperTime(RTC_TimeTypeDef* RTC_TimeStruct);
|
|||
|
|
void RTC_OutputConfig(uint8_t RTC_Output);
|
|||
|
|
void RTC_AWTConfig(RTC_AWTTypeDef *RCT_AWTStruct);
|
|||
|
|
void RTC_AWTCmd(FunctionalState NewState);
|
|||
|
|
void RTC_SetInterval(uint8_t Period);
|
|||
|
|
void RTC_SetClockSource(uint32_t RTC_ClockSource);
|
|||
|
|
void RTC_CalibrationConfig(RTC_CalibTypeDef *RTC_CalibStruct);
|
|||
|
|
void RTC_CalibrationCmd(FunctionalState NewState);
|
|||
|
|
uint8_t RTC_BinToBCD(uint8_t Value);
|
|||
|
|
uint8_t RTC_BCDToBin(uint8_t Value);
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#endif /*__CW32F030_RTC_H */
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|