CARME-M4 BSP  V1.5
stm32f4xx_dbgmcu.c
Go to the documentation of this file.
1 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f4xx_dbgmcu.h"
30 
40 /* Private typedef -----------------------------------------------------------*/
41 /* Private define ------------------------------------------------------------*/
42 #define IDCODE_DEVID_MASK ((uint32_t)0x00000FFF)
43 
44 /* Private macro -------------------------------------------------------------*/
45 /* Private variables ---------------------------------------------------------*/
46 /* Private function prototypes -----------------------------------------------*/
47 /* Private functions ---------------------------------------------------------*/
48 
58 uint32_t DBGMCU_GetREVID(void)
59 {
60  return(DBGMCU->IDCODE >> 16);
61 }
62 
68 uint32_t DBGMCU_GetDEVID(void)
69 {
70  return(DBGMCU->IDCODE & IDCODE_DEVID_MASK);
71 }
72 
84 void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
85 {
86  /* Check the parameters */
87  assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph));
88  assert_param(IS_FUNCTIONAL_STATE(NewState));
89  if (NewState != DISABLE)
90  {
91  DBGMCU->CR |= DBGMCU_Periph;
92  }
93  else
94  {
95  DBGMCU->CR &= ~DBGMCU_Periph;
96  }
97 }
98 
123 void DBGMCU_APB1PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState)
124 {
125  /* Check the parameters */
126  assert_param(IS_DBGMCU_APB1PERIPH(DBGMCU_Periph));
127  assert_param(IS_FUNCTIONAL_STATE(NewState));
128 
129  if (NewState != DISABLE)
130  {
131  DBGMCU->APB1FZ |= DBGMCU_Periph;
132  }
133  else
134  {
135  DBGMCU->APB1FZ &= ~DBGMCU_Periph;
136  }
137 }
138 
152 void DBGMCU_APB2PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState)
153 {
154  /* Check the parameters */
155  assert_param(IS_DBGMCU_APB2PERIPH(DBGMCU_Periph));
156  assert_param(IS_FUNCTIONAL_STATE(NewState));
157 
158  if (NewState != DISABLE)
159  {
160  DBGMCU->APB2FZ |= DBGMCU_Periph;
161  }
162  else
163  {
164  DBGMCU->APB2FZ &= ~DBGMCU_Periph;
165  }
166 }
167 
180 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
uint32_t DBGMCU_GetREVID(void)
Returns the device revision identifier.
This file contains all the functions prototypes for the DBGMCU firmware library.
uint32_t DBGMCU_GetDEVID(void)
Returns the device identifier.
void DBGMCU_APB1PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState)
Configures APB1 peripheral behavior when the MCU is in Debug mode.
void DBGMCU_APB2PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState)
Configures APB2 peripheral behavior when the MCU is in Debug mode.
void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
Configures low power mode behavior when the MCU is in Debug mode.