rt-thread-official/bsp/CME_M7/StdPeriph_Driver/inc/cmem7_rtc.h

90 lines
2.5 KiB
C
Raw Normal View History

/**
2023-04-05 11:26:18 +08:00
*****************************************************************************
* @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))
/**
* @}
*/
2023-04-05 11:26:18 +08:00
/**
2023-04-05 11:26:18 +08:00
* @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
2023-04-05 11:26:18 +08:00
*/
void RTC_ITConfig(uint32_t Int, BOOL Enable);
/**
2023-04-05 11:26:18 +08:00
* @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
2023-04-05 11:26:18 +08:00
*/
BOOL RTC_GetITStatus(uint32_t Int);
/**
* @brief Clear specific interrupts
2023-04-05 11:26:18 +08:00
* @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
* @retval None
2023-04-05 11:26:18 +08:00
*/
void RTC_ClearITPendingBit(uint32_t Int);
/**
* @brief Get seconds since power up
2023-04-05 11:26:18 +08:00
* @param None
* @retval uint32_t Seconds since power up
2023-04-05 11:26:18 +08:00
*/
uint32_t RTC_GetSecond(void);
/**
* @brief Get current millseconds
2023-04-05 11:26:18 +08:00
* @param None
* @retval uint32_t Current millseconds
2023-04-05 11:26:18 +08:00
*/
uint16_t RTC_GetMillSecond(void);
#ifdef __cplusplus
}
#endif
#endif /* __CMEM7_RTC_H */