apm32f0xx_dbg.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*!
  2. * @file apm32f0xx_dbg.h
  3. *
  4. * @brief This file contains all the functions prototypes for the DBG firmware library
  5. *
  6. * @version V1.0.3
  7. *
  8. * @date 2022-09-20
  9. *
  10. * @attention
  11. *
  12. * Copyright (C) 2020-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 useful 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. /* Define to prevent recursive inclusion */
  26. #ifndef __APM32F0XX_DBG_H
  27. #define __APM32F0XX_DBG_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* Includes */
  32. #include "apm32f0xx.h"
  33. /** @addtogroup APM32F0xx_StdPeriphDriver
  34. @{
  35. */
  36. /** @addtogroup DBG_Driver
  37. @{
  38. */
  39. /** @defgroup DBG_Macros Macros
  40. @{
  41. */
  42. /**@} end of group DBG_Macros*/
  43. /** @defgroup DBG_Enumerations Enumerations
  44. @{
  45. */
  46. /**
  47. * @brief MCU Debug mode in the low power mode behavior
  48. */
  49. typedef enum
  50. {
  51. DBG_MODE_STOP = ((uint32_t)0x02), /*!< Keep debugger connection during STOP mode */
  52. DBG_MODE_STANDBY = ((uint32_t)0x04), /*!< Keep debugger connection during STANDBY mode */
  53. } DBG_MODE_T;
  54. /**
  55. * @brief MCU Debug mode in the APB1 peripheral behavior
  56. */
  57. typedef enum
  58. {
  59. DBG_APB1_PER_TMR2_STOP = ((uint32_t)0x01), /*!< TMR2 counter stopped when Core is halted (Only for APM32F072 and APM32F091 devices) */
  60. DBG_APB1_PER_TMR3_STOP = ((uint32_t)0x02), /*!< TMR3 counter stopped when Core is halted */
  61. DBG_APB1_PER_TMR6_STOP = ((uint32_t)0x10), /*!< TMR6 counter stopped when Core is halted */
  62. DBG_APB1_PER_TMR7_STOP = ((uint32_t)0x20), /*!< TMR7 counter stopped when Core is halted (Only for APM32F072 and APM32F091 devices) */
  63. DBG_APB1_PER_TMR14_STOP = ((uint32_t)0x100), /*!< TMR14 counter stopped when Core is halted */
  64. DBG_APB1_PER_RTC_STOP = ((uint32_t)0x400), /*!< RTC counter stopped when Core is halted */
  65. DBG_APB1_PER_WWDT_STOP = ((uint32_t)0x800), /*!< Debug WWDT stopped when Core is halted */
  66. DBG_APB1_PER_IWDT_STOP = ((uint32_t)0x1000), /*!< Debug IWDT stopped when Core is halted */
  67. DBG_APB1_PER_CAN_STOP = ((uint32_t)0x2000000), /*!< Debug CAN stopped when Core is halted (Only for APM32F072 and APM32F091 devices) */
  68. DBG_APB1_PER_I2C1_SMBUS_TIMEOUT = ((uint32_t)0x200000), /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
  69. } DBG_APB1_PER_T;
  70. /**
  71. * @brief MCU Debug mode in the APB2 peripheral behavior
  72. */
  73. typedef enum
  74. {
  75. DBG_APB2_PER_TMR1_STOP = ((uint32_t)0x00800), /*!< TMR1 counter stopped when Core is halted */
  76. DBG_APB2_PER_TMR15_STOP = ((uint32_t)0x10000), /*!< TMR15 counter stopped when Core is halted */
  77. DBG_APB2_PER_TMR16_STOP = ((uint32_t)0x20000), /*!< TMR16 counter stopped when Core is halted */
  78. DBG_APB2_PER_TMR17_STOP = ((uint32_t)0x40000), /*!< TMR17 counter stopped when Core is halted */
  79. } DBG_APB2_PER_T;
  80. /**@} end of group DBG_Enumerations */
  81. /** @defgroup DBG_Structures Structures
  82. @{
  83. */
  84. /**@} end of group DBG_Structures */
  85. /** @defgroup DBG_Variables Variables
  86. @{
  87. */
  88. /**@} end of group DBG_Variables */
  89. /** @defgroup DBG_Functions Functions
  90. @{
  91. */
  92. /* Read MCU ID Code */
  93. uint32_t DBG_ReadDevId(void);
  94. uint32_t DBG_ReadRevId(void);
  95. /* Debug Mode */
  96. void DBG_EnableDebugMode(uint32_t mode);
  97. void DBG_DisableDebugMode(uint32_t mode);
  98. /* APB1 peripheral */
  99. void DBG_EnableAPB1Periph(uint32_t peripheral);
  100. void DBG_DisableAPB1Periph(uint32_t peripheral);
  101. /* APB2 peripheral */
  102. void DBG_EnableAPB2Periph(uint32_t peripheral);
  103. void DBG_DisableAPB2Periph(uint32_t peripheral);
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #endif /* __APM32F0XX_DBG_H */
  108. /**@} end of group DBG_Functions */
  109. /**@} end of group DBG_Driver */
  110. /**@} end of group APM32F0xx_StdPeriphDriver */