stm32f10x_dbgmcu.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f10x_dbgmcu.c
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   This file provides all the DBGMCU firmware functions.
00008   ******************************************************************************
00009   * @copy
00010   *
00011   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00012   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00013   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00014   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00015   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00016   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00017   *
00018   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00019   */ 
00020 
00021 /* Includes ------------------------------------------------------------------*/
00022 #include "stm32f10x_dbgmcu.h"
00023 
00024 /** @addtogroup STM32F10x_StdPeriph_Driver
00025   * @{
00026   */
00027 
00028 /** @defgroup DBGMCU 
00029   * @brief DBGMCU driver modules
00030   * @{
00031   */ 
00032 
00033 /** @defgroup DBGMCU_Private_TypesDefinitions
00034   * @{
00035   */
00036 
00037 /**
00038   * @}
00039   */
00040 
00041 /** @defgroup DBGMCU_Private_Defines
00042   * @{
00043   */
00044 
00045 #define IDCODE_DEVID_MASK    ((uint32_t)0x00000FFF)
00046 /**
00047   * @}
00048   */
00049 
00050 /** @defgroup DBGMCU_Private_Macros
00051   * @{
00052   */
00053 
00054 /**
00055   * @}
00056   */
00057 
00058 /** @defgroup DBGMCU_Private_Variables
00059   * @{
00060   */
00061 
00062 /**
00063   * @}
00064   */
00065 
00066 /** @defgroup DBGMCU_Private_FunctionPrototypes
00067   * @{
00068   */
00069 
00070 /**
00071   * @}
00072   */
00073 
00074 /** @defgroup DBGMCU_Private_Functions
00075   * @{
00076   */
00077 
00078 /**
00079   * @brief  Returns the device revision identifier.
00080   * @param  None
00081   * @retval Device revision identifier
00082   */
00083 uint32_t DBGMCU_GetREVID(void)
00084 {
00085    return(DBGMCU->IDCODE >> 16);
00086 }
00087 
00088 /**
00089   * @brief  Returns the device identifier.
00090   * @param  None
00091   * @retval Device identifier
00092   */
00093 uint32_t DBGMCU_GetDEVID(void)
00094 {
00095    return(DBGMCU->IDCODE & IDCODE_DEVID_MASK);
00096 }
00097 
00098 /**
00099   * @brief  Configures the specified peripheral and low power mode behavior
00100   *   when the MCU under Debug mode.
00101   * @param  DBGMCU_Periph: specifies the peripheral and low power mode.
00102   *   This parameter can be any combination of the following values:
00103   *     @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode              
00104   *     @arg DBGMCU_STOP: Keep debugger connection during STOP mode               
00105   *     @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode            
00106   *     @arg DBGMCU_IWDG_STOP: Debug IWDG stopped when Core is halted          
00107   *     @arg DBGMCU_WWDG_STOP: Debug WWDG stopped when Core is halted          
00108   *     @arg DBGMCU_TIM1_STOP: TIM1 counter stopped when Core is halted          
00109   *     @arg DBGMCU_TIM2_STOP: TIM2 counter stopped when Core is halted          
00110   *     @arg DBGMCU_TIM3_STOP: TIM3 counter stopped when Core is halted          
00111   *     @arg DBGMCU_TIM4_STOP: TIM4 counter stopped when Core is halted          
00112   *     @arg DBGMCU_CAN1_STOP: Debug CAN2 stopped when Core is halted           
00113   *     @arg DBGMCU_I2C1_SMBUS_TIMEOUT: I2C1 SMBUS timeout mode stopped when Core is halted
00114   *     @arg DBGMCU_I2C2_SMBUS_TIMEOUT: I2C2 SMBUS timeout mode stopped when Core is halted
00115   *     @arg DBGMCU_TIM5_STOP: TIM5 counter stopped when Core is halted          
00116   *     @arg DBGMCU_TIM6_STOP: TIM6 counter stopped when Core is halted          
00117   *     @arg DBGMCU_TIM7_STOP: TIM7 counter stopped when Core is halted          
00118   *     @arg DBGMCU_TIM8_STOP: TIM8 counter stopped when Core is halted
00119   *     @arg DBGMCU_CAN2_STOP: Debug CAN2 stopped when Core is halted 
00120   *     @arg DBGMCU_TIM15_STOP: TIM15 counter stopped when Core is halted
00121   *     @arg DBGMCU_TIM16_STOP: TIM16 counter stopped when Core is halted
00122   *     @arg DBGMCU_TIM17_STOP: TIM17 counter stopped when Core is halted                
00123   *     @arg DBGMCU_TIM9_STOP: TIM9 counter stopped when Core is halted
00124   *     @arg DBGMCU_TIM10_STOP: TIM10 counter stopped when Core is halted
00125   *     @arg DBGMCU_TIM11_STOP: TIM11 counter stopped when Core is halted
00126   *     @arg DBGMCU_TIM12_STOP: TIM12 counter stopped when Core is halted
00127   *     @arg DBGMCU_TIM13_STOP: TIM13 counter stopped when Core is halted
00128   *     @arg DBGMCU_TIM14_STOP: TIM14 counter stopped when Core is halted
00129   * @param  NewState: new state of the specified peripheral in Debug mode.
00130   *   This parameter can be: ENABLE or DISABLE.
00131   * @retval None
00132   */
00133 void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
00134 {
00135   /* Check the parameters */
00136   assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph));
00137   assert_param(IS_FUNCTIONAL_STATE(NewState));
00138 
00139   if (NewState != DISABLE)
00140   {
00141     DBGMCU->CR |= DBGMCU_Periph;
00142   }
00143   else
00144   {
00145     DBGMCU->CR &= ~DBGMCU_Periph;
00146   }
00147 }
00148 
00149 /**
00150   * @}
00151   */
00152 
00153 /**
00154   * @}
00155   */
00156 
00157 /**
00158   * @}
00159   */
00160 
00161 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32