1 /*! 2 * @file apm324xx_dbgmcu.h 3 * 4 * @brief This file contains all the functions prototypes for the DBUGMCU firmware library 5 * 6 * @version V1.0.2 7 * 8 * @date 2022-06-23 9 * 10 * @attention 11 * 12 * Copyright (C) 2021-2022 Geehy Semiconductor 13 * 14 * You may not use this file except in compliance with the 15 * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE). 16 * 17 * The program is only for reference, which is distributed in the hope 18 * that it will be usefull and instructional for customers to develop 19 * their software. Unless required by applicable law or agreed to in 20 * writing, the program is distributed on an "AS IS" BASIS, WITHOUT 21 * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied. 22 * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions 23 * and limitations under the License. 24 */ 25 26 /* Define to prevent recursive inclusion */ 27 #ifndef __APM32F4XX_DBGMCU_H 28 #define __APM32F4XX_DBGMCU_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 /* Includes */ 35 #include "apm32f4xx.h" 36 37 /** @addtogroup APM32F4xx_StdPeriphDriver 38 @{ 39 */ 40 41 /** @addtogroup DBGMCU_Driver 42 @{ 43 */ 44 45 /** @defgroup DBGMCU_Enumerations 46 @{ 47 */ 48 49 /** 50 * @brief DBGMCU_STOP description 51 */ 52 typedef enum 53 { 54 DBGMCU_SLEEP = ((uint32_t)0x00000001), /*!< Keep debugger connection during SLEEP mode */ 55 DBGMCU_STOP = ((uint32_t)0x00000002), /*!< Keep debugger connection during STOP mode */ 56 DBGMCU_STANDBY = ((uint32_t)0x00000004), /*!< Keep debugger connection during STANDBY mode */ 57 /** APB1 Peripheral */ 58 DBGMCU_TMR2_STOP = ((uint32_t)0x00000001), /*!< TMR2 counter stopped when Core is halted */ 59 DBGMCU_TMR3_STOP = ((uint32_t)0x00000002), /*!< TMR3 counter stopped when Core is halted */ 60 DBGMCU_TMR4_STOP = ((uint32_t)0x00000004), /*!< TMR4 counter stopped when Core is halted */ 61 DBGMCU_TMR5_STOP = ((uint32_t)0x00000008), /*!< TMR5 counter stopped when Core is halted */ 62 DBGMCU_TMR6_STOP = ((uint32_t)0x00000010), /*!< TMR6 counter stopped when Core is halted */ 63 DBGMCU_TMR7_STOP = ((uint32_t)0x00000020), /*!< TMR7 counter stopped when Core is halted */ 64 DBGMCU_TMR12_STOP = ((uint32_t)0x00000040), /*!< TMR12 counter stopped when Core is halted */ 65 DBGMCU_TMR13_STOP = ((uint32_t)0x00000080), /*!< TMR13 counter stopped when Core is halted */ 66 DBGMCU_TMR14_STOP = ((uint32_t)0x00000100), /*!< TMR14 counter stopped when Core is halted */ 67 DBGMCU_RTC_STOP = ((uint32_t)0x00000400), /*!< RTC Calendar and Wakeup counter stopped when Core is halted */ 68 DBGMCU_WWDT_STOP = ((uint32_t)0x00000800), /*!< Debug WWDG stopped when Core is halted */ 69 DBGMCU_IWDT_STOP = ((uint32_t)0x00001000), /*!< Debug IWDG stopped when Core is halted */ 70 DBGMCU_I2C1_SMBUS_TIMEOUT = ((uint32_t)0x00200000), /*!< I2C1 SMBUS timeout mode stopped when Core is halted */ 71 DBGMCU_I2C2_SMBUS_TIMEOUT = ((uint32_t)0x00400000), /*!< I2C2 SMBUS timeout mode stopped when Core is halted */ 72 DBGMCU_I2C3_SMBUS_TIMEOUT = ((uint32_t)0x00800000), /*!< I2C3 SMBUS timeout mode stopped when Core is halted */ 73 DBGMCU_CAN1_STOP = ((uint32_t)0x02000000), /*!< Debug CAN1 stopped when Core is halted */ 74 DBGMCU_CAN2_STOP = ((uint32_t)0x04000000), /*!< Debug CAN2 stopped when Core is halted */ 75 /** APB2 Peripheral */ 76 DBGMCU_TMR1_STOP = ((uint32_t)0x00000001), /*!< TMR1 counter stopped when Core is halted */ 77 DBGMCU_TMR8_STOP = ((uint32_t)0x00000002), /*!< TMR8 counter stopped when Core is halted */ 78 DBGMCU_TMR9_STOP = ((uint32_t)0x00010000), /*!< TMR9 counter stopped when Core is halted */ 79 DBGMCU_TMR10_STOP = ((uint32_t)0x00020000), /*!< TMR10 counter stopped when Core is halted */ 80 DBGMCU_TMR11_STOP = ((uint32_t)0x00040000) /*!< TMR11 counter stopped when Core is halted */ 81 } DBGMCU_STOP_T; 82 83 /**@} end of group DBGMCU_Enumerations*/ 84 85 /** @defgroup DBGMCU_Functions 86 @{ 87 */ 88 89 uint32_t DBGMCU_ReadDEVID(void); 90 uint32_t DBGMCU_ReadREVID(void); 91 void DBGMCU_Enable(uint32_t periph); 92 void DBGMCU_Disable(uint32_t periph); 93 void DBGMCU_DisableAPB1Periph(uint32_t periph); 94 void DBGMCU_EnableAPB1Periph(uint32_t periph); 95 void DBGMCU_DisableAPB2Periph(uint32_t periph); 96 void DBGMCU_EnableAPB2Periph(uint32_t periph); 97 98 #ifdef __cplusplus 99 } 100 #endif 101 102 #endif /* __APM32F4XX_DBGMCU_H */ 103 104 /**@} end of group DBGMCU_Enumerations */ 105 /**@} end of group DBGMCU_Driver */ 106 /**@} end of group APM32F4xx_StdPeriphDriver */ 107