Nut/OS  5.0.5
API Reference
stm32f10x_rtc.h
Go to the documentation of this file.
00001 
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM32F10x_RTC_H
00024 #define __STM32F10x_RTC_H
00025 
00026 /* Includes ------------------------------------------------------------------*/
00027 #include "stm32f10x.h"
00028 #include <dev/rtc.h>
00029 
00030 #ifdef DELETE
00031 typedef struct
00032 {
00033   __IO uint16_t CRH;
00034   uint16_t  RESERVED0;
00035   __IO uint16_t CRL;
00036   uint16_t  RESERVED1;
00037   __IO uint16_t PRLH;
00038   uint16_t  RESERVED2;
00039   __IO uint16_t PRLL;
00040   uint16_t  RESERVED3;
00041   __IO uint16_t DIVH;
00042   uint16_t  RESERVED4;
00043   __IO uint16_t DIVL;
00044   uint16_t  RESERVED5;
00045   __IO uint16_t CNTH;
00046   uint16_t  RESERVED6;
00047   __IO uint16_t CNTL;
00048   uint16_t  RESERVED7;
00049   __IO uint16_t ALRH;
00050   uint16_t  RESERVED8;
00051   __IO uint16_t ALRL;
00052   uint16_t  RESERVED9;
00053 } RTC_TypeDef;
00054 
00055 
00056 #define RTC_BASE             (STM32_APB1PERIPH_BASE + 0x2800)
00057 #define RTC                 ((RTC_TypeDef *) RTC_BASE)
00058 #endif
00059 
00060 #define RTC_IT_OW            ((uint16_t)0x0004)  
00061 #define RTC_IT_ALR           ((uint16_t)0x0002)  
00062 #define RTC_IT_SEC           ((uint16_t)0x0001)  
00063 #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00))
00064 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \
00065                            ((IT) == RTC_IT_SEC))
00066 #define RTC_FLAG_RTOFF       ((uint16_t)0x0020)  
00067 #define RTC_FLAG_RSF         ((uint16_t)0x0008)  
00068 #define RTC_FLAG_OW          ((uint16_t)0x0004)  
00069 #define RTC_FLAG_ALR         ((uint16_t)0x0002)  
00070 #define RTC_FLAG_SEC         ((uint16_t)0x0001)  
00071 #define RTC_FLAG_CNF         ((uint16_t)0x0010)  
00073 #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00))
00074 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \
00075                                ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \
00076                                ((FLAG) == RTC_FLAG_SEC))
00077 #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF)
00078 
00079 extern NUTRTC rtcStm32;
00080 
00081 #endif /* __STM32F10x_RTC_H */
00082 
00094 /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/