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));
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));
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));
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****/
void DBGMCU_APB2PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState)
Configures APB2 peripheral behavior when the MCU is in Debug mode.
This file contains all the functions prototypes for the DBGMCU firmware library.
FunctionalState
Definition: stm32f4xx.h:708
void assert_param(int val)
#define IS_DBGMCU_PERIPH(PERIPH)
#define IS_FUNCTIONAL_STATE(STATE)
Definition: stm32f4xx.h:709
void DBGMCU_APB1PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState)
Configures APB1 peripheral behavior when the MCU is in Debug mode.
#define IS_DBGMCU_APB2PERIPH(PERIPH)
#define IDCODE_DEVID_MASK
uint32_t DBGMCU_GetREVID(void)
Returns the device revision identifier.
uint32_t DBGMCU_GetDEVID(void)
Returns the device identifier.
#define IS_DBGMCU_APB1PERIPH(PERIPH)
void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
Configures low power mode behavior when the MCU is in Debug mode.
#define DBGMCU
Definition: stm32f4xx.h:2167


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:19