rtc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. ******************************************************************************
  3. * @file rtc.h
  4. * @brief This file contains all the function prototypes for
  5. * the rtc.c file
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef __RTC_H__
  21. #define __RTC_H__
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "main.h"
  27. /* USER CODE BEGIN Includes */
  28. struct rtc_time1 {
  29. int tm_sec;
  30. int tm_min;
  31. int tm_hour;
  32. int tm_mday;
  33. int tm_mon;
  34. int tm_year;
  35. int tm_wday;
  36. };
  37. void MX_RTC_Init(void);
  38. uint8_t RTC_SetTime(uint8_t hour, uint8_t minute, uint8_t second);
  39. uint32_t Get_Time_Stampe(void);
  40. void Prase_Time_Stampe(RTC_DateTypeDef *date, RTC_TimeTypeDef *time , uint32_t tm);
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif /* __RTC_H__ */
  45. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/