hc32f4a0_utility.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /**
  2. *******************************************************************************
  3. * @file hc32f4a0_utility.h
  4. * @brief This file contains all the functions prototypes of the DDL utility.
  5. @verbatim
  6. Change Logs:
  7. Date Author Notes
  8. 2020-06-12 Yangjp First version
  9. @endverbatim
  10. *******************************************************************************
  11. * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved.
  12. *
  13. * This software component is licensed by HDSC under BSD 3-Clause license
  14. * (the "License"); You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. *******************************************************************************
  19. */
  20. #ifndef __HC32F4A0_UTILITY_H__
  21. #define __HC32F4A0_UTILITY_H__
  22. /* C binding of definitions if building with C++ compiler */
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. /*******************************************************************************
  28. * Include files
  29. ******************************************************************************/
  30. #include "hc32_common.h"
  31. #include "ddl_config.h"
  32. /**
  33. * @addtogroup HC32F4A0_DDL_Driver
  34. * @{
  35. */
  36. /**
  37. * @addtogroup DDL_UTILITY
  38. * @{
  39. */
  40. #if (DDL_UTILITY_ENABLE == DDL_ON)
  41. /*******************************************************************************
  42. * Global type definitions ('typedef')
  43. ******************************************************************************/
  44. /*******************************************************************************
  45. * Global pre-processor symbols/macros ('#define')
  46. ******************************************************************************/
  47. /*******************************************************************************
  48. * Global variable definitions ('extern')
  49. ******************************************************************************/
  50. /*******************************************************************************
  51. * Global function prototypes (definition in C source)
  52. ******************************************************************************/
  53. /**
  54. * @addtogroup UTILITY_Global_Functions
  55. * @{
  56. */
  57. /* Imprecise delay */
  58. void DDL_DelayMS(uint32_t u32Cnt);
  59. void DDL_DelayUS(uint32_t u32Cnt);
  60. /* Systick functions */
  61. en_result_t SysTick_Init(uint32_t u32Freq);
  62. void SysTick_Delay(uint32_t u32Delay);
  63. void SysTick_IncTick(void);
  64. uint32_t SysTick_GetTick(void);
  65. void SysTick_Suspend(void);
  66. void SysTick_Resume(void);
  67. /* You can add your own assert functions by implement the function DDL_AssertHandler
  68. definition follow the function DDL_AssertHandler declaration */
  69. #ifdef __DEBUG
  70. #define DDL_ASSERT(x) \
  71. do{ \
  72. ((x) ? (void)0 : DDL_AssertHandler(__FILE__, __LINE__)); \
  73. }while(0)
  74. /* Exported function */
  75. void DDL_AssertHandler(const char *file, int line);
  76. #else
  77. #define DDL_ASSERT(x) ((void)0U)
  78. #endif /* __DEBUG */
  79. #if (DDL_PRINT_ENABLE == DDL_ON)
  80. #include <stdio.h>
  81. en_result_t DDL_PrintfInit(void);
  82. #endif
  83. /**
  84. * @}
  85. */
  86. #endif /* DDL_UTILITY_ENABLE */
  87. /**
  88. * @}
  89. */
  90. /**
  91. * @}
  92. */
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif /* __HC32F4A0_UTILITY_H__ */
  97. /*******************************************************************************
  98. * EOF (not truncated)
  99. ******************************************************************************/