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