summaryrefslogtreecommitdiff
path: root/bsp/CME_M7/StdPeriph_Driver/inc/cmem7_rtc.h
blob: 885d704ceb75a6edc74481d12c7b76882649be3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
	*****************************************************************************
	* @file     cmem7_rtc.h
	*
	* @brief    CMEM7 RTC header file
	*
	*
	* @version  V1.0
	* @date     3. September 2013
	*
	* @note               
	*           
	*****************************************************************************
	* @attention
	*
	* 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, CAPITAL-MICRO 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.
	*
	* <h2><center>&copy; COPYRIGHT 2013 Capital-micro </center></h2>
	*****************************************************************************
	*/
	
#ifndef __CMEM7_RTC_H
#define __CMEM7_RTC_H

#ifdef __cplusplus
 extern "C" {
#endif

#include "cmem7.h"
#include "cmem7_conf.h"

/** @defgroup RTC_Int
  * @{
  */
#define RTC_Int_Second                     ((uint32_t)0x00000001)
#define RTC_Int_Millsecond                 ((uint32_t)0x00000002)
#define RTC_Int_All                        ((uint32_t)0x00000003)
#define IS_RTC_INT(INT)                    (((INT) != 0) && (((INT) & ~RTC_Int_All) == 0))
/**
  * @}
  */
   
/**
  * @brief  Enable or disable RTC interrupt. 
	* @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
	* @param[in] Enable The bit indicates if specific interrupts are enable or not
  * @retval None
	*/ 
void RTC_ITConfig(uint32_t Int, BOOL Enable);

/**
  * @brief  Check specific interrupts are set or not 
	* @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
  * @retval BOOL The bit indicates if specific interrupts are set or not
	*/
BOOL RTC_GetITStatus(uint32_t Int);

/**
  * @brief  Clear specific interrupts
	* @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
  * @retval None
	*/
void RTC_ClearITPendingBit(uint32_t Int);

/**
  * @brief  Get seconds since power up
	* @param	None
  * @retval uint32_t Seconds since power up
	*/
uint32_t RTC_GetSecond(void);

/**
  * @brief  Get current millseconds
	* @param	None
  * @retval uint32_t Current millseconds
	*/
uint16_t RTC_GetMillSecond(void);

#ifdef __cplusplus
}
#endif

#endif /* __CMEM7_RTC_H */