cmem7_rtc.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. *****************************************************************************
  3. * @file cmem7_rtc.h
  4. *
  5. * @brief CMEM7 RTC header file
  6. *
  7. *
  8. * @version V1.0
  9. * @date 3. September 2013
  10. *
  11. * @note
  12. *
  13. *****************************************************************************
  14. * @attention
  15. *
  16. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  17. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  18. * TIME. AS A RESULT, CAPITAL-MICRO SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  19. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  20. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  21. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  22. *
  23. * <h2><center>&copy; COPYRIGHT 2013 Capital-micro </center></h2>
  24. *****************************************************************************
  25. */
  26. #ifndef __CMEM7_RTC_H
  27. #define __CMEM7_RTC_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #include "cmem7.h"
  32. #include "cmem7_conf.h"
  33. /** @defgroup RTC_Int
  34. * @{
  35. */
  36. #define RTC_Int_Second ((uint32_t)0x00000001)
  37. #define RTC_Int_Millsecond ((uint32_t)0x00000002)
  38. #define RTC_Int_All ((uint32_t)0x00000003)
  39. #define IS_RTC_INT(INT) (((INT) != 0) && (((INT) & ~RTC_Int_All) == 0))
  40. /**
  41. * @}
  42. */
  43. /**
  44. * @brief Enable or disable RTC interrupt.
  45. * @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
  46. * @param[in] Enable The bit indicates if specific interrupts are enable or not
  47. * @retval None
  48. */
  49. void RTC_ITConfig(uint32_t Int, BOOL Enable);
  50. /**
  51. * @brief Check specific interrupts are set or not
  52. * @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
  53. * @retval BOOL The bit indicates if specific interrupts are set or not
  54. */
  55. BOOL RTC_GetITStatus(uint32_t Int);
  56. /**
  57. * @brief Clear specific interrupts
  58. * @param[in] Int interrupt mask bits, which can be the combination of @ref RTC_Int
  59. * @retval None
  60. */
  61. void RTC_ClearITPendingBit(uint32_t Int);
  62. /**
  63. * @brief Get seconds since power up
  64. * @param None
  65. * @retval uint32_t Seconds since power up
  66. */
  67. uint32_t RTC_GetSecond(void);
  68. /**
  69. * @brief Get current millseconds
  70. * @param None
  71. * @retval uint32_t Current millseconds
  72. */
  73. uint16_t RTC_GetMillSecond(void);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* __CMEM7_RTC_H */