Support for MSP430 launchpad.

Fork of mbed by mbed official

Committer:
atamariya
Date:
Sat Jun 21 09:54:56 2014 +0000
Revision:
86:c662433839e3
Parent:
82:6473597d706e
Support for MSP430

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 82:6473597d706e 1 /**
bogdanm 82:6473597d706e 2 ******************************************************************************
bogdanm 82:6473597d706e 3 * @file stm32f30x_iwdg.h
bogdanm 82:6473597d706e 4 * @author MCD Application Team
bogdanm 82:6473597d706e 5 * @version V1.1.0
bogdanm 82:6473597d706e 6 * @date 27-February-2014
bogdanm 82:6473597d706e 7 * @brief This file contains all the functions prototypes for the IWDG
bogdanm 82:6473597d706e 8 * firmware library.
bogdanm 82:6473597d706e 9 ******************************************************************************
bogdanm 82:6473597d706e 10 * @attention
bogdanm 82:6473597d706e 11 *
bogdanm 82:6473597d706e 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 82:6473597d706e 13 *
bogdanm 82:6473597d706e 14 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 82:6473597d706e 15 * are permitted provided that the following conditions are met:
bogdanm 82:6473597d706e 16 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 82:6473597d706e 17 * this list of conditions and the following disclaimer.
bogdanm 82:6473597d706e 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 82:6473597d706e 19 * this list of conditions and the following disclaimer in the documentation
bogdanm 82:6473597d706e 20 * and/or other materials provided with the distribution.
bogdanm 82:6473597d706e 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 82:6473597d706e 22 * may be used to endorse or promote products derived from this software
bogdanm 82:6473597d706e 23 * without specific prior written permission.
bogdanm 82:6473597d706e 24 *
bogdanm 82:6473597d706e 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 82:6473597d706e 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 82:6473597d706e 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 82:6473597d706e 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 82:6473597d706e 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 82:6473597d706e 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 82:6473597d706e 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 82:6473597d706e 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 82:6473597d706e 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 82:6473597d706e 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 82:6473597d706e 35 *
bogdanm 82:6473597d706e 36 ******************************************************************************
bogdanm 82:6473597d706e 37 */
bogdanm 82:6473597d706e 38
bogdanm 82:6473597d706e 39 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 82:6473597d706e 40 #ifndef __STM32F30x_IWDG_H
bogdanm 82:6473597d706e 41 #define __STM32F30x_IWDG_H
bogdanm 82:6473597d706e 42
bogdanm 82:6473597d706e 43 #ifdef __cplusplus
bogdanm 82:6473597d706e 44 extern "C" {
bogdanm 82:6473597d706e 45 #endif
bogdanm 82:6473597d706e 46
bogdanm 82:6473597d706e 47 /* Includes ------------------------------------------------------------------*/
bogdanm 82:6473597d706e 48 #include "stm32f30x.h"
bogdanm 82:6473597d706e 49
bogdanm 82:6473597d706e 50 /** @addtogroup STM32F30x_StdPeriph_Driver
bogdanm 82:6473597d706e 51 * @{
bogdanm 82:6473597d706e 52 */
bogdanm 82:6473597d706e 53
bogdanm 82:6473597d706e 54 /** @addtogroup IWDG
bogdanm 82:6473597d706e 55 * @{
bogdanm 82:6473597d706e 56 */
bogdanm 82:6473597d706e 57
bogdanm 82:6473597d706e 58 /* Exported types ------------------------------------------------------------*/
bogdanm 82:6473597d706e 59 /* Exported constants --------------------------------------------------------*/
bogdanm 82:6473597d706e 60
bogdanm 82:6473597d706e 61 /** @defgroup IWDG_Exported_Constants
bogdanm 82:6473597d706e 62 * @{
bogdanm 82:6473597d706e 63 */
bogdanm 82:6473597d706e 64
bogdanm 82:6473597d706e 65 /** @defgroup IWDG_WriteAccess
bogdanm 82:6473597d706e 66 * @{
bogdanm 82:6473597d706e 67 */
bogdanm 82:6473597d706e 68
bogdanm 82:6473597d706e 69 #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
bogdanm 82:6473597d706e 70 #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
bogdanm 82:6473597d706e 71 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
bogdanm 82:6473597d706e 72 ((ACCESS) == IWDG_WriteAccess_Disable))
bogdanm 82:6473597d706e 73 /**
bogdanm 82:6473597d706e 74 * @}
bogdanm 82:6473597d706e 75 */
bogdanm 82:6473597d706e 76
bogdanm 82:6473597d706e 77 /** @defgroup IWDG_prescaler
bogdanm 82:6473597d706e 78 * @{
bogdanm 82:6473597d706e 79 */
bogdanm 82:6473597d706e 80
bogdanm 82:6473597d706e 81 #define IWDG_Prescaler_4 ((uint8_t)0x00)
bogdanm 82:6473597d706e 82 #define IWDG_Prescaler_8 ((uint8_t)0x01)
bogdanm 82:6473597d706e 83 #define IWDG_Prescaler_16 ((uint8_t)0x02)
bogdanm 82:6473597d706e 84 #define IWDG_Prescaler_32 ((uint8_t)0x03)
bogdanm 82:6473597d706e 85 #define IWDG_Prescaler_64 ((uint8_t)0x04)
bogdanm 82:6473597d706e 86 #define IWDG_Prescaler_128 ((uint8_t)0x05)
bogdanm 82:6473597d706e 87 #define IWDG_Prescaler_256 ((uint8_t)0x06)
bogdanm 82:6473597d706e 88 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
bogdanm 82:6473597d706e 89 ((PRESCALER) == IWDG_Prescaler_8) || \
bogdanm 82:6473597d706e 90 ((PRESCALER) == IWDG_Prescaler_16) || \
bogdanm 82:6473597d706e 91 ((PRESCALER) == IWDG_Prescaler_32) || \
bogdanm 82:6473597d706e 92 ((PRESCALER) == IWDG_Prescaler_64) || \
bogdanm 82:6473597d706e 93 ((PRESCALER) == IWDG_Prescaler_128)|| \
bogdanm 82:6473597d706e 94 ((PRESCALER) == IWDG_Prescaler_256))
bogdanm 82:6473597d706e 95 /**
bogdanm 82:6473597d706e 96 * @}
bogdanm 82:6473597d706e 97 */
bogdanm 82:6473597d706e 98
bogdanm 82:6473597d706e 99 /** @defgroup IWDG_Flag
bogdanm 82:6473597d706e 100 * @{
bogdanm 82:6473597d706e 101 */
bogdanm 82:6473597d706e 102
bogdanm 82:6473597d706e 103 #define IWDG_FLAG_PVU ((uint16_t)0x0001)
bogdanm 82:6473597d706e 104 #define IWDG_FLAG_RVU ((uint16_t)0x0002)
bogdanm 82:6473597d706e 105 #define IWDG_FLAG_WVU ((uint16_t)0x0002)
bogdanm 82:6473597d706e 106 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU) || \
bogdanm 82:6473597d706e 107 ((FLAG) == IWDG_FLAG_WVU))
bogdanm 82:6473597d706e 108 /**
bogdanm 82:6473597d706e 109 * @}
bogdanm 82:6473597d706e 110 */
bogdanm 82:6473597d706e 111
bogdanm 82:6473597d706e 112 /** @defgroup IWDG_Reload_Value
bogdanm 82:6473597d706e 113 * @{
bogdanm 82:6473597d706e 114 */
bogdanm 82:6473597d706e 115 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
bogdanm 82:6473597d706e 116
bogdanm 82:6473597d706e 117 /**
bogdanm 82:6473597d706e 118 * @}
bogdanm 82:6473597d706e 119 */
bogdanm 82:6473597d706e 120
bogdanm 82:6473597d706e 121 /** @defgroup IWDG_CounterWindow_Value
bogdanm 82:6473597d706e 122 * @{
bogdanm 82:6473597d706e 123 */
bogdanm 82:6473597d706e 124 #define IS_IWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0xFFF)
bogdanm 82:6473597d706e 125 /**
bogdanm 82:6473597d706e 126 * @}
bogdanm 82:6473597d706e 127 */
bogdanm 82:6473597d706e 128
bogdanm 82:6473597d706e 129 /**
bogdanm 82:6473597d706e 130 * @}
bogdanm 82:6473597d706e 131 */
bogdanm 82:6473597d706e 132
bogdanm 82:6473597d706e 133 /* Exported macro ------------------------------------------------------------*/
bogdanm 82:6473597d706e 134 /* Exported functions --------------------------------------------------------*/
bogdanm 82:6473597d706e 135
bogdanm 82:6473597d706e 136 /* Prescaler and Counter configuration functions ******************************/
bogdanm 82:6473597d706e 137 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
bogdanm 82:6473597d706e 138 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
bogdanm 82:6473597d706e 139 void IWDG_SetReload(uint16_t Reload);
bogdanm 82:6473597d706e 140 void IWDG_ReloadCounter(void);
bogdanm 82:6473597d706e 141 void IWDG_SetWindowValue(uint16_t WindowValue);
bogdanm 82:6473597d706e 142
bogdanm 82:6473597d706e 143 /* IWDG activation function ***************************************************/
bogdanm 82:6473597d706e 144 void IWDG_Enable(void);
bogdanm 82:6473597d706e 145
bogdanm 82:6473597d706e 146 /* Flag management function ***************************************************/
bogdanm 82:6473597d706e 147 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
bogdanm 82:6473597d706e 148
bogdanm 82:6473597d706e 149 #ifdef __cplusplus
bogdanm 82:6473597d706e 150 }
bogdanm 82:6473597d706e 151 #endif
bogdanm 82:6473597d706e 152
bogdanm 82:6473597d706e 153 #endif /* __STM32F30x_IWDG_H */
bogdanm 82:6473597d706e 154
bogdanm 82:6473597d706e 155 /**
bogdanm 82:6473597d706e 156 * @}
bogdanm 82:6473597d706e 157 */
bogdanm 82:6473597d706e 158
bogdanm 82:6473597d706e 159 /**
bogdanm 82:6473597d706e 160 * @}
bogdanm 82:6473597d706e 161 */
bogdanm 82:6473597d706e 162
bogdanm 82:6473597d706e 163 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/