driver_rtc.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * @File name : driver_rtc.h
  3. * @Author : Bluetrum IOT Team
  4. * @Date : 2023-02-15
  5. * @Description : This file contains all the functions prototypes for the RTC Base library.
  6. *
  7. * Copyright (c) by Bluetrum, All Rights Reserved.
  8. */
  9. #ifndef _DRIVER_RTC_H
  10. #define _DRIVER_RTC_H
  11. #include "driver_com.h"
  12. /**
  13. * @brief RTC IT and Flag Definition
  14. */
  15. typedef enum {
  16. RTC_IT_ALM = 0x01,
  17. RTC_IT_1S = 0x02,
  18. } RTC_IT_TYPEDEF;
  19. //--------------- Function used to configure or get get time ---------------//
  20. void rtc_set_counter(uint32_t cnt);
  21. uint32_t rtc_get_counter(void);
  22. void rtc_set_alarm(uint32_t alarm);
  23. uint32_t rtc_get_alarm(void);
  24. //------------- Function used to configure clock or interrupt --------------//
  25. void rtc_prescale_set(uint32_t psc);
  26. uint32_t rtc_prescale_get(void);
  27. void rtc_pic_config(isr_t isr, int pr, RTC_IT_TYPEDEF interrupt_type, FUNCTIONAL_STATE state);
  28. FLAG_STATE rtc_get_flag(RTC_IT_TYPEDEF interrupt_type);
  29. void rtc_clear_flag(RTC_IT_TYPEDEF interrupt_type);
  30. FLAG_STATE rtc_get_overflow_flag(RTC_IT_TYPEDEF interrupt_type);
  31. #endif // _DRIVER_RTC_H