mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_DISCO_F100RB/stm32f10x_rtc.h@126:549ba18ddd81, 2014-03-19 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Mar 19 16:00:09 2014 +0000
- Revision:
- 126:549ba18ddd81
Synchronized with git revision cf8fd1cf86b0cd85131dd24a6ded21cc6fe04827
Full URL: https://github.com/mbedmicro/mbed/commit/cf8fd1cf86b0cd85131dd24a6ded21cc6fe04827/
Conflicts:
workspace_tools/targets.py
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 126:549ba18ddd81 | 1 | /** |
mbed_official | 126:549ba18ddd81 | 2 | ****************************************************************************** |
mbed_official | 126:549ba18ddd81 | 3 | * @file stm32f10x_rtc.h |
mbed_official | 126:549ba18ddd81 | 4 | * @author MCD Application Team |
mbed_official | 126:549ba18ddd81 | 5 | * @version V3.6.1 |
mbed_official | 126:549ba18ddd81 | 6 | * @date 05-March-2012 |
mbed_official | 126:549ba18ddd81 | 7 | * @brief This file contains all the functions prototypes for the RTC firmware |
mbed_official | 126:549ba18ddd81 | 8 | * library. |
mbed_official | 126:549ba18ddd81 | 9 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 10 | * Copyright (c) 2014, STMicroelectronics |
mbed_official | 126:549ba18ddd81 | 11 | * All rights reserved. |
mbed_official | 126:549ba18ddd81 | 12 | * |
mbed_official | 126:549ba18ddd81 | 13 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 126:549ba18ddd81 | 14 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 126:549ba18ddd81 | 15 | * |
mbed_official | 126:549ba18ddd81 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 17 | * this list of conditions and the following disclaimer. |
mbed_official | 126:549ba18ddd81 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 19 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 126:549ba18ddd81 | 20 | * and/or other materials provided with the distribution. |
mbed_official | 126:549ba18ddd81 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 126:549ba18ddd81 | 22 | * may be used to endorse or promote products derived from this software |
mbed_official | 126:549ba18ddd81 | 23 | * without specific prior written permission. |
mbed_official | 126:549ba18ddd81 | 24 | * |
mbed_official | 126:549ba18ddd81 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 126:549ba18ddd81 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 126:549ba18ddd81 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 126:549ba18ddd81 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 126:549ba18ddd81 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 126:549ba18ddd81 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 126:549ba18ddd81 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 126:549ba18ddd81 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 126:549ba18ddd81 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 126:549ba18ddd81 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 126:549ba18ddd81 | 35 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 36 | */ |
mbed_official | 126:549ba18ddd81 | 37 | |
mbed_official | 126:549ba18ddd81 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 126:549ba18ddd81 | 39 | #ifndef __STM32F10x_RTC_H |
mbed_official | 126:549ba18ddd81 | 40 | #define __STM32F10x_RTC_H |
mbed_official | 126:549ba18ddd81 | 41 | |
mbed_official | 126:549ba18ddd81 | 42 | #ifdef __cplusplus |
mbed_official | 126:549ba18ddd81 | 43 | extern "C" { |
mbed_official | 126:549ba18ddd81 | 44 | #endif |
mbed_official | 126:549ba18ddd81 | 45 | |
mbed_official | 126:549ba18ddd81 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 126:549ba18ddd81 | 47 | #include "stm32f10x.h" |
mbed_official | 126:549ba18ddd81 | 48 | |
mbed_official | 126:549ba18ddd81 | 49 | /** @addtogroup STM32F10x_StdPeriph_Driver |
mbed_official | 126:549ba18ddd81 | 50 | * @{ |
mbed_official | 126:549ba18ddd81 | 51 | */ |
mbed_official | 126:549ba18ddd81 | 52 | |
mbed_official | 126:549ba18ddd81 | 53 | /** @addtogroup RTC |
mbed_official | 126:549ba18ddd81 | 54 | * @{ |
mbed_official | 126:549ba18ddd81 | 55 | */ |
mbed_official | 126:549ba18ddd81 | 56 | |
mbed_official | 126:549ba18ddd81 | 57 | /** @defgroup RTC_Exported_Types |
mbed_official | 126:549ba18ddd81 | 58 | * @{ |
mbed_official | 126:549ba18ddd81 | 59 | */ |
mbed_official | 126:549ba18ddd81 | 60 | |
mbed_official | 126:549ba18ddd81 | 61 | /** |
mbed_official | 126:549ba18ddd81 | 62 | * @} |
mbed_official | 126:549ba18ddd81 | 63 | */ |
mbed_official | 126:549ba18ddd81 | 64 | |
mbed_official | 126:549ba18ddd81 | 65 | /** @defgroup RTC_Exported_Constants |
mbed_official | 126:549ba18ddd81 | 66 | * @{ |
mbed_official | 126:549ba18ddd81 | 67 | */ |
mbed_official | 126:549ba18ddd81 | 68 | |
mbed_official | 126:549ba18ddd81 | 69 | /** @defgroup RTC_interrupts_define |
mbed_official | 126:549ba18ddd81 | 70 | * @{ |
mbed_official | 126:549ba18ddd81 | 71 | */ |
mbed_official | 126:549ba18ddd81 | 72 | |
mbed_official | 126:549ba18ddd81 | 73 | #define RTC_IT_OW ((uint16_t)0x0004) /*!< Overflow interrupt */ |
mbed_official | 126:549ba18ddd81 | 74 | #define RTC_IT_ALR ((uint16_t)0x0002) /*!< Alarm interrupt */ |
mbed_official | 126:549ba18ddd81 | 75 | #define RTC_IT_SEC ((uint16_t)0x0001) /*!< Second interrupt */ |
mbed_official | 126:549ba18ddd81 | 76 | #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00)) |
mbed_official | 126:549ba18ddd81 | 77 | #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \ |
mbed_official | 126:549ba18ddd81 | 78 | ((IT) == RTC_IT_SEC)) |
mbed_official | 126:549ba18ddd81 | 79 | /** |
mbed_official | 126:549ba18ddd81 | 80 | * @} |
mbed_official | 126:549ba18ddd81 | 81 | */ |
mbed_official | 126:549ba18ddd81 | 82 | |
mbed_official | 126:549ba18ddd81 | 83 | /** @defgroup RTC_interrupts_flags |
mbed_official | 126:549ba18ddd81 | 84 | * @{ |
mbed_official | 126:549ba18ddd81 | 85 | */ |
mbed_official | 126:549ba18ddd81 | 86 | |
mbed_official | 126:549ba18ddd81 | 87 | #define RTC_FLAG_RTOFF ((uint16_t)0x0020) /*!< RTC Operation OFF flag */ |
mbed_official | 126:549ba18ddd81 | 88 | #define RTC_FLAG_RSF ((uint16_t)0x0008) /*!< Registers Synchronized flag */ |
mbed_official | 126:549ba18ddd81 | 89 | #define RTC_FLAG_OW ((uint16_t)0x0004) /*!< Overflow flag */ |
mbed_official | 126:549ba18ddd81 | 90 | #define RTC_FLAG_ALR ((uint16_t)0x0002) /*!< Alarm flag */ |
mbed_official | 126:549ba18ddd81 | 91 | #define RTC_FLAG_SEC ((uint16_t)0x0001) /*!< Second flag */ |
mbed_official | 126:549ba18ddd81 | 92 | #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00)) |
mbed_official | 126:549ba18ddd81 | 93 | #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \ |
mbed_official | 126:549ba18ddd81 | 94 | ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \ |
mbed_official | 126:549ba18ddd81 | 95 | ((FLAG) == RTC_FLAG_SEC)) |
mbed_official | 126:549ba18ddd81 | 96 | #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF) |
mbed_official | 126:549ba18ddd81 | 97 | |
mbed_official | 126:549ba18ddd81 | 98 | /** |
mbed_official | 126:549ba18ddd81 | 99 | * @} |
mbed_official | 126:549ba18ddd81 | 100 | */ |
mbed_official | 126:549ba18ddd81 | 101 | |
mbed_official | 126:549ba18ddd81 | 102 | /** |
mbed_official | 126:549ba18ddd81 | 103 | * @} |
mbed_official | 126:549ba18ddd81 | 104 | */ |
mbed_official | 126:549ba18ddd81 | 105 | |
mbed_official | 126:549ba18ddd81 | 106 | /** @defgroup RTC_Exported_Macros |
mbed_official | 126:549ba18ddd81 | 107 | * @{ |
mbed_official | 126:549ba18ddd81 | 108 | */ |
mbed_official | 126:549ba18ddd81 | 109 | |
mbed_official | 126:549ba18ddd81 | 110 | /** |
mbed_official | 126:549ba18ddd81 | 111 | * @} |
mbed_official | 126:549ba18ddd81 | 112 | */ |
mbed_official | 126:549ba18ddd81 | 113 | |
mbed_official | 126:549ba18ddd81 | 114 | /** @defgroup RTC_Exported_Functions |
mbed_official | 126:549ba18ddd81 | 115 | * @{ |
mbed_official | 126:549ba18ddd81 | 116 | */ |
mbed_official | 126:549ba18ddd81 | 117 | |
mbed_official | 126:549ba18ddd81 | 118 | void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState); |
mbed_official | 126:549ba18ddd81 | 119 | void RTC_EnterConfigMode(void); |
mbed_official | 126:549ba18ddd81 | 120 | void RTC_ExitConfigMode(void); |
mbed_official | 126:549ba18ddd81 | 121 | uint32_t RTC_GetCounter(void); |
mbed_official | 126:549ba18ddd81 | 122 | void RTC_SetCounter(uint32_t CounterValue); |
mbed_official | 126:549ba18ddd81 | 123 | void RTC_SetPrescaler(uint32_t PrescalerValue); |
mbed_official | 126:549ba18ddd81 | 124 | void RTC_SetAlarm(uint32_t AlarmValue); |
mbed_official | 126:549ba18ddd81 | 125 | uint32_t RTC_GetDivider(void); |
mbed_official | 126:549ba18ddd81 | 126 | void RTC_WaitForLastTask(void); |
mbed_official | 126:549ba18ddd81 | 127 | void RTC_WaitForSynchro(void); |
mbed_official | 126:549ba18ddd81 | 128 | FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG); |
mbed_official | 126:549ba18ddd81 | 129 | void RTC_ClearFlag(uint16_t RTC_FLAG); |
mbed_official | 126:549ba18ddd81 | 130 | ITStatus RTC_GetITStatus(uint16_t RTC_IT); |
mbed_official | 126:549ba18ddd81 | 131 | void RTC_ClearITPendingBit(uint16_t RTC_IT); |
mbed_official | 126:549ba18ddd81 | 132 | |
mbed_official | 126:549ba18ddd81 | 133 | #ifdef __cplusplus |
mbed_official | 126:549ba18ddd81 | 134 | } |
mbed_official | 126:549ba18ddd81 | 135 | #endif |
mbed_official | 126:549ba18ddd81 | 136 | |
mbed_official | 126:549ba18ddd81 | 137 | #endif /* __STM32F10x_RTC_H */ |
mbed_official | 126:549ba18ddd81 | 138 | /** |
mbed_official | 126:549ba18ddd81 | 139 | * @} |
mbed_official | 126:549ba18ddd81 | 140 | */ |
mbed_official | 126:549ba18ddd81 | 141 | |
mbed_official | 126:549ba18ddd81 | 142 | /** |
mbed_official | 126:549ba18ddd81 | 143 | * @} |
mbed_official | 126:549ba18ddd81 | 144 | */ |
mbed_official | 126:549ba18ddd81 | 145 | |
mbed_official | 126:549ba18ddd81 | 146 | /** |
mbed_official | 126:549ba18ddd81 | 147 | * @} |
mbed_official | 126:549ba18ddd81 | 148 | */ |
mbed_official | 126:549ba18ddd81 | 149 | |
mbed_official | 126:549ba18ddd81 | 150 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |