mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Dec 02 11:30:05 2013 +0000
Revision:
52:a51c77007319
Child:
70:c1fbde68b492
Synchronized with git revision 49df530ae72ce97ccc773d1f2c13b38e868e6abd

Full URL: https://github.com/mbedmicro/mbed/commit/49df530ae72ce97ccc773d1f2c13b38e868e6abd/

Add STMicroelectronics NUCLEO_F103RB target

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 52:a51c77007319 1 /**
mbed_official 52:a51c77007319 2 ******************************************************************************
mbed_official 52:a51c77007319 3 * @file stm32f10x_dbgmcu.c
mbed_official 52:a51c77007319 4 * @author MCD Application Team
mbed_official 52:a51c77007319 5 * @version V3.5.0
mbed_official 52:a51c77007319 6 * @date 11-March-2011
mbed_official 52:a51c77007319 7 * @brief This file provides all the DBGMCU firmware functions.
mbed_official 52:a51c77007319 8 ******************************************************************************
mbed_official 52:a51c77007319 9 * @attention
mbed_official 52:a51c77007319 10 *
mbed_official 52:a51c77007319 11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
mbed_official 52:a51c77007319 12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
mbed_official 52:a51c77007319 13 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
mbed_official 52:a51c77007319 14 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
mbed_official 52:a51c77007319 15 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
mbed_official 52:a51c77007319 16 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
mbed_official 52:a51c77007319 17 *
mbed_official 52:a51c77007319 18 * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
mbed_official 52:a51c77007319 19 ******************************************************************************
mbed_official 52:a51c77007319 20 */
mbed_official 52:a51c77007319 21
mbed_official 52:a51c77007319 22 /* Includes ------------------------------------------------------------------*/
mbed_official 52:a51c77007319 23 #include "stm32f10x_dbgmcu.h"
mbed_official 52:a51c77007319 24
mbed_official 52:a51c77007319 25 /** @addtogroup STM32F10x_StdPeriph_Driver
mbed_official 52:a51c77007319 26 * @{
mbed_official 52:a51c77007319 27 */
mbed_official 52:a51c77007319 28
mbed_official 52:a51c77007319 29 /** @defgroup DBGMCU
mbed_official 52:a51c77007319 30 * @brief DBGMCU driver modules
mbed_official 52:a51c77007319 31 * @{
mbed_official 52:a51c77007319 32 */
mbed_official 52:a51c77007319 33
mbed_official 52:a51c77007319 34 /** @defgroup DBGMCU_Private_TypesDefinitions
mbed_official 52:a51c77007319 35 * @{
mbed_official 52:a51c77007319 36 */
mbed_official 52:a51c77007319 37
mbed_official 52:a51c77007319 38 /**
mbed_official 52:a51c77007319 39 * @}
mbed_official 52:a51c77007319 40 */
mbed_official 52:a51c77007319 41
mbed_official 52:a51c77007319 42 /** @defgroup DBGMCU_Private_Defines
mbed_official 52:a51c77007319 43 * @{
mbed_official 52:a51c77007319 44 */
mbed_official 52:a51c77007319 45
mbed_official 52:a51c77007319 46 #define IDCODE_DEVID_MASK ((uint32_t)0x00000FFF)
mbed_official 52:a51c77007319 47 /**
mbed_official 52:a51c77007319 48 * @}
mbed_official 52:a51c77007319 49 */
mbed_official 52:a51c77007319 50
mbed_official 52:a51c77007319 51 /** @defgroup DBGMCU_Private_Macros
mbed_official 52:a51c77007319 52 * @{
mbed_official 52:a51c77007319 53 */
mbed_official 52:a51c77007319 54
mbed_official 52:a51c77007319 55 /**
mbed_official 52:a51c77007319 56 * @}
mbed_official 52:a51c77007319 57 */
mbed_official 52:a51c77007319 58
mbed_official 52:a51c77007319 59 /** @defgroup DBGMCU_Private_Variables
mbed_official 52:a51c77007319 60 * @{
mbed_official 52:a51c77007319 61 */
mbed_official 52:a51c77007319 62
mbed_official 52:a51c77007319 63 /**
mbed_official 52:a51c77007319 64 * @}
mbed_official 52:a51c77007319 65 */
mbed_official 52:a51c77007319 66
mbed_official 52:a51c77007319 67 /** @defgroup DBGMCU_Private_FunctionPrototypes
mbed_official 52:a51c77007319 68 * @{
mbed_official 52:a51c77007319 69 */
mbed_official 52:a51c77007319 70
mbed_official 52:a51c77007319 71 /**
mbed_official 52:a51c77007319 72 * @}
mbed_official 52:a51c77007319 73 */
mbed_official 52:a51c77007319 74
mbed_official 52:a51c77007319 75 /** @defgroup DBGMCU_Private_Functions
mbed_official 52:a51c77007319 76 * @{
mbed_official 52:a51c77007319 77 */
mbed_official 52:a51c77007319 78
mbed_official 52:a51c77007319 79 /**
mbed_official 52:a51c77007319 80 * @brief Returns the device revision identifier.
mbed_official 52:a51c77007319 81 * @param None
mbed_official 52:a51c77007319 82 * @retval Device revision identifier
mbed_official 52:a51c77007319 83 */
mbed_official 52:a51c77007319 84 uint32_t DBGMCU_GetREVID(void)
mbed_official 52:a51c77007319 85 {
mbed_official 52:a51c77007319 86 return(DBGMCU->IDCODE >> 16);
mbed_official 52:a51c77007319 87 }
mbed_official 52:a51c77007319 88
mbed_official 52:a51c77007319 89 /**
mbed_official 52:a51c77007319 90 * @brief Returns the device identifier.
mbed_official 52:a51c77007319 91 * @param None
mbed_official 52:a51c77007319 92 * @retval Device identifier
mbed_official 52:a51c77007319 93 */
mbed_official 52:a51c77007319 94 uint32_t DBGMCU_GetDEVID(void)
mbed_official 52:a51c77007319 95 {
mbed_official 52:a51c77007319 96 return(DBGMCU->IDCODE & IDCODE_DEVID_MASK);
mbed_official 52:a51c77007319 97 }
mbed_official 52:a51c77007319 98
mbed_official 52:a51c77007319 99 /**
mbed_official 52:a51c77007319 100 * @brief Configures the specified peripheral and low power mode behavior
mbed_official 52:a51c77007319 101 * when the MCU under Debug mode.
mbed_official 52:a51c77007319 102 * @param DBGMCU_Periph: specifies the peripheral and low power mode.
mbed_official 52:a51c77007319 103 * This parameter can be any combination of the following values:
mbed_official 52:a51c77007319 104 * @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode
mbed_official 52:a51c77007319 105 * @arg DBGMCU_STOP: Keep debugger connection during STOP mode
mbed_official 52:a51c77007319 106 * @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode
mbed_official 52:a51c77007319 107 * @arg DBGMCU_IWDG_STOP: Debug IWDG stopped when Core is halted
mbed_official 52:a51c77007319 108 * @arg DBGMCU_WWDG_STOP: Debug WWDG stopped when Core is halted
mbed_official 52:a51c77007319 109 * @arg DBGMCU_TIM1_STOP: TIM1 counter stopped when Core is halted
mbed_official 52:a51c77007319 110 * @arg DBGMCU_TIM2_STOP: TIM2 counter stopped when Core is halted
mbed_official 52:a51c77007319 111 * @arg DBGMCU_TIM3_STOP: TIM3 counter stopped when Core is halted
mbed_official 52:a51c77007319 112 * @arg DBGMCU_TIM4_STOP: TIM4 counter stopped when Core is halted
mbed_official 52:a51c77007319 113 * @arg DBGMCU_CAN1_STOP: Debug CAN2 stopped when Core is halted
mbed_official 52:a51c77007319 114 * @arg DBGMCU_I2C1_SMBUS_TIMEOUT: I2C1 SMBUS timeout mode stopped when Core is halted
mbed_official 52:a51c77007319 115 * @arg DBGMCU_I2C2_SMBUS_TIMEOUT: I2C2 SMBUS timeout mode stopped when Core is halted
mbed_official 52:a51c77007319 116 * @arg DBGMCU_TIM5_STOP: TIM5 counter stopped when Core is halted
mbed_official 52:a51c77007319 117 * @arg DBGMCU_TIM6_STOP: TIM6 counter stopped when Core is halted
mbed_official 52:a51c77007319 118 * @arg DBGMCU_TIM7_STOP: TIM7 counter stopped when Core is halted
mbed_official 52:a51c77007319 119 * @arg DBGMCU_TIM8_STOP: TIM8 counter stopped when Core is halted
mbed_official 52:a51c77007319 120 * @arg DBGMCU_CAN2_STOP: Debug CAN2 stopped when Core is halted
mbed_official 52:a51c77007319 121 * @arg DBGMCU_TIM15_STOP: TIM15 counter stopped when Core is halted
mbed_official 52:a51c77007319 122 * @arg DBGMCU_TIM16_STOP: TIM16 counter stopped when Core is halted
mbed_official 52:a51c77007319 123 * @arg DBGMCU_TIM17_STOP: TIM17 counter stopped when Core is halted
mbed_official 52:a51c77007319 124 * @arg DBGMCU_TIM9_STOP: TIM9 counter stopped when Core is halted
mbed_official 52:a51c77007319 125 * @arg DBGMCU_TIM10_STOP: TIM10 counter stopped when Core is halted
mbed_official 52:a51c77007319 126 * @arg DBGMCU_TIM11_STOP: TIM11 counter stopped when Core is halted
mbed_official 52:a51c77007319 127 * @arg DBGMCU_TIM12_STOP: TIM12 counter stopped when Core is halted
mbed_official 52:a51c77007319 128 * @arg DBGMCU_TIM13_STOP: TIM13 counter stopped when Core is halted
mbed_official 52:a51c77007319 129 * @arg DBGMCU_TIM14_STOP: TIM14 counter stopped when Core is halted
mbed_official 52:a51c77007319 130 * @param NewState: new state of the specified peripheral in Debug mode.
mbed_official 52:a51c77007319 131 * This parameter can be: ENABLE or DISABLE.
mbed_official 52:a51c77007319 132 * @retval None
mbed_official 52:a51c77007319 133 */
mbed_official 52:a51c77007319 134 void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
mbed_official 52:a51c77007319 135 {
mbed_official 52:a51c77007319 136 /* Check the parameters */
mbed_official 52:a51c77007319 137 assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph));
mbed_official 52:a51c77007319 138 assert_param(IS_FUNCTIONAL_STATE(NewState));
mbed_official 52:a51c77007319 139
mbed_official 52:a51c77007319 140 if (NewState != DISABLE)
mbed_official 52:a51c77007319 141 {
mbed_official 52:a51c77007319 142 DBGMCU->CR |= DBGMCU_Periph;
mbed_official 52:a51c77007319 143 }
mbed_official 52:a51c77007319 144 else
mbed_official 52:a51c77007319 145 {
mbed_official 52:a51c77007319 146 DBGMCU->CR &= ~DBGMCU_Periph;
mbed_official 52:a51c77007319 147 }
mbed_official 52:a51c77007319 148 }
mbed_official 52:a51c77007319 149
mbed_official 52:a51c77007319 150 /**
mbed_official 52:a51c77007319 151 * @}
mbed_official 52:a51c77007319 152 */
mbed_official 52:a51c77007319 153
mbed_official 52:a51c77007319 154 /**
mbed_official 52:a51c77007319 155 * @}
mbed_official 52:a51c77007319 156 */
mbed_official 52:a51c77007319 157
mbed_official 52:a51c77007319 158 /**
mbed_official 52:a51c77007319 159 * @}
mbed_official 52:a51c77007319 160 */
mbed_official 52:a51c77007319 161
mbed_official 52:a51c77007319 162 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/