fm33lc0xx_fl.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /**
  2. *******************************************************************************************************
  3. * @file fm33lc0xx_fl.h
  4. * @author FMSH Application Team
  5. * @brief Header file of FL Driver Library
  6. *******************************************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) [2019] [Fudan Microelectronics]
  10. * THIS SOFTWARE is licensed under the Mulan PSL v1.
  11. * can use this software according to the terms and conditions of the Mulan PSL v1.
  12. * You may obtain a copy of Mulan PSL v1 at:
  13. * http://license.coscl.org.cn/MulanPSL
  14. * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
  16. * PURPOSE.
  17. * See the Mulan PSL v1 for more details.
  18. *
  19. *******************************************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------------------------------*/
  22. #ifndef __FM33LC0XX_FL_H
  23. #define __FM33LC0XX_FL_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /**
  28. * @brief Select FM33LC0XX Device
  29. */
  30. #if !defined (FM33LC0XX)
  31. #define FM33LC0XX
  32. #endif /* FM33LC0XX */
  33. /* Defines -------------------------------------------------------------------------------------------*/
  34. /**
  35. * @brief List of drivers to be used.
  36. *
  37. * @note Uncomment following lines to disable specified driver.
  38. */
  39. #ifndef MFANG
  40. #define FL_ADC_DRIVER_ENABLED
  41. #define FL_AES_DRIVER_ENABLED
  42. #define FL_ATIM_DRIVER_ENABLED
  43. #define FL_BSTIM32_DRIVER_ENABLED
  44. #define FL_COMP_DRIVER_ENABLED
  45. #define FL_CRC_DRIVER_ENABLED
  46. #define FL_DIVAS_DRIVER_ENABLED
  47. #define FL_DMA_DRIVER_ENABLED
  48. #define FL_EXTI_DRIVER_ENABLED
  49. #define FL_FLASH_DRIVER_ENABLED
  50. #define FL_GPIO_DRIVER_ENABLED
  51. #define FL_GPTIM_DRIVER_ENABLED
  52. #define FL_I2C_DRIVER_ENABLED
  53. #define FL_IWDT_DRIVER_ENABLED
  54. #define FL_LCD_DRIVER_ENABLED
  55. #define FL_LPTIM32_DRIVER_ENABLED
  56. #define FL_LPUART_DRIVER_ENABLED
  57. #define FL_OPA_DRIVER_ENABLED
  58. #define FL_PMU_DRIVER_ENABLED
  59. #define FL_RCC_DRIVER_ENABLED
  60. #define FL_RMU_DRIVER_ENABLED
  61. #define FL_RNG_DRIVER_ENABLED
  62. #define FL_RTC_DRIVER_ENABLED
  63. #define FL_SPI_DRIVER_ENABLED
  64. #define FL_SVD_DRIVER_ENABLED
  65. #define FL_U7816_DRIVER_ENABLED
  66. #define FL_UART_DRIVER_ENABLED
  67. #define FL_VREF_DRIVER_ENABLED
  68. #define FL_WWDT_DRIVER_ENABLED
  69. #endif
  70. /* Includes -------------------------------------------------------------------------------------------*/
  71. #include "fm33xx.h"
  72. #include "fm33_assert.h"
  73. #include <stdbool.h>
  74. #include <stddef.h>
  75. #include <stdint.h>
  76. /* Macros ---------------------------------------------------------------------------------------------*/
  77. /** @defgroup FL_Private_Macros FL Driver Library Private Macros
  78. * @{
  79. */
  80. /**
  81. * @brief FM33LC0xx FL Driver Library version number
  82. */
  83. #define __FM33LC0xx_FL_VERSION_MAIN (0x02) /*!< [31:24] main version */
  84. #define __FM33LC0xx_FL_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
  85. #define __FM33LC0xx_FL_VERSION_SUB2 (0x01) /*!< [15:0] sub2 version */
  86. #define __FM33LC0xx_FL_VERSION ((__FM33LC0xx_FL_VERSION_MAIN << 24)\
  87. |(__FM33LC0xx_FL_VERSION_SUB1 << 16)\
  88. |(__FM33LC0xx_FL_VERSION_SUB2))
  89. /**
  90. * @brief Macros used by delay support functions
  91. */
  92. #define FL_DELAY_US (SystemCoreClock/1000000)
  93. #define FL_DELAY_MS (SystemCoreClock/1000)
  94. /**
  95. * @}
  96. */
  97. /* Types ----------------------------------------------------------------------------------------------*/
  98. /** @defgroup FL_ET_Return FL Exported Return Type Defines
  99. * @{
  100. */
  101. typedef enum
  102. {
  103. FL_RESET = 0U,
  104. FL_SET = !FL_RESET
  105. } FL_FlagStatus, FL_ITStatus;
  106. typedef enum
  107. {
  108. FL_DISABLE = 0U,
  109. FL_ENABLE = !FL_DISABLE
  110. } FL_FunState;
  111. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == FL_DISABLE) || ((STATE) == FL_ENABLE))
  112. typedef enum
  113. {
  114. FL_FAIL = 0U,
  115. FL_PASS = !FL_FAIL
  116. } FL_ErrorStatus;
  117. /**
  118. * @}
  119. */
  120. /* Exported Functions ---------------------------------------------------------------------------------*/
  121. /** @defgroup FL_EF_DELAY Exported FL Driver Library Delay Support Functions
  122. * @{
  123. */
  124. /**
  125. * @}
  126. */
  127. /** @defgroup FL_EF_INIT Exported FL Driver Library Init Functions
  128. * @{
  129. */
  130. void FL_Init(void);
  131. /**
  132. * @}
  133. */
  134. /* Post Includes --------------------------------------------------------------------------------------*/
  135. /**
  136. * @brief Include peripheral's header file
  137. */
  138. #if defined(USE_FULL_ASSERT)
  139. #include "fm33_assert.h"
  140. #endif /* USE_FULL_ASSERT */
  141. #if defined(FL_ADC_DRIVER_ENABLED)
  142. #include "fm33lc0xx_fl_adc.h"
  143. #endif /* FL_ADC_DRIVER_ENABLED */
  144. #if defined(FL_AES_DRIVER_ENABLED)
  145. #include "fm33lc0xx_fl_aes.h"
  146. #endif /* FL_AES_DRIVER_ENABLED */
  147. #if defined(FL_ATIM_DRIVER_ENABLED)
  148. #include "fm33lc0xx_fl_atim.h"
  149. #endif /* FL_ATIM_DRIVER_ENABLED */
  150. #if defined(FL_BSTIM32_DRIVER_ENABLED)
  151. #include "fm33lc0xx_fl_bstim32.h"
  152. #endif /* FL_BSTIM32_DRIVER_ENABLED */
  153. #if defined(FL_COMP_DRIVER_ENABLED)
  154. #include "fm33lc0xx_fl_comp.h"
  155. #endif /* FL_COMP_DRIVER_ENABLED */
  156. #if defined(FL_CRC_DRIVER_ENABLED)
  157. #include "fm33lc0xx_fl_crc.h"
  158. #endif /* FL_CRC_DRIVER_ENABLED */
  159. #if defined(FL_DIVAS_DRIVER_ENABLED)
  160. #include "fm33lc0xx_fl_divas.h"
  161. #endif /* FL_DIVAS_DRIVER_ENABLED */
  162. #if defined(FL_DMA_DRIVER_ENABLED)
  163. #include "fm33lc0xx_fl_dma.h"
  164. #endif /* FL_DMA_DRIVER_ENABLED */
  165. #if defined(FL_EXTI_DRIVER_ENABLED)
  166. #include "fm33lc0xx_fl_exti.h"
  167. #endif /* FL_EXTI_DRIVER_ENABLED */
  168. #if defined(FL_FLASH_DRIVER_ENABLED)
  169. #include "fm33lc0xx_fl_flash.h"
  170. #endif /* FL_FLASH_DRIVER_ENABLED */
  171. #if defined(FL_GPIO_DRIVER_ENABLED)
  172. #include "fm33lc0xx_fl_gpio.h"
  173. #endif /* FL_GPIO_DRIVER_ENABLED */
  174. #if defined(FL_GPTIM_DRIVER_ENABLED)
  175. #include "fm33lc0xx_fl_gptim.h"
  176. #endif /* FL_GPTIM_DRIVER_ENABLED */
  177. #if defined(FL_I2C_DRIVER_ENABLED)
  178. #include "fm33lc0xx_fl_i2c.h"
  179. #endif /* FL_I2C_DRIVER_ENABLED */
  180. #if defined(FL_IWDT_DRIVER_ENABLED)
  181. #include "fm33lc0xx_fl_iwdt.h"
  182. #endif /* FL_IWDT_DRIVER_ENABLED */
  183. #if defined(FL_LCD_DRIVER_ENABLED)
  184. #include "fm33lc0xx_fl_lcd.h"
  185. #endif /* FL_LCD_DRIVER_ENABLED */
  186. #if defined(FL_LPTIM32_DRIVER_ENABLED)
  187. #include "fm33lc0xx_fl_lptim32.h"
  188. #endif /* FL_LPTIM32_DRIVER_ENABLED */
  189. #if defined(FL_LPUART_DRIVER_ENABLED)
  190. #include "fm33lc0xx_fl_lpuart.h"
  191. #endif /* FL_LPUART_DRIVER_ENABLED */
  192. #if defined(FL_OPA_DRIVER_ENABLED)
  193. #include "fm33lc0xx_fl_opa.h"
  194. #endif /* FL_OPA_DRIVER_ENABLED */
  195. #if defined(FL_PMU_DRIVER_ENABLED)
  196. #include "fm33lc0xx_fl_pmu.h"
  197. #endif /* FL_PMU_DRIVER_ENABLED */
  198. #if defined(FL_RCC_DRIVER_ENABLED)
  199. #include "fm33lc0xx_fl_rcc.h"
  200. #endif /* FL_RCC_DRIVER_ENABLED */
  201. #if defined(FL_RMU_DRIVER_ENABLED)
  202. #include "fm33lc0xx_fl_rmu.h"
  203. #endif /* FL_RMU_DRIVER_ENABLED */
  204. #if defined(FL_RNG_DRIVER_ENABLED)
  205. #include "fm33lc0xx_fl_rng.h"
  206. #endif /* FL_RNG_DRIVER_ENABLED */
  207. #if defined(FL_RTC_DRIVER_ENABLED)
  208. #include "fm33lc0xx_fl_rtc.h"
  209. #endif /* FL_RTC_DRIVER_ENABLED */
  210. #if defined(FL_SPI_DRIVER_ENABLED)
  211. #include "fm33lc0xx_fl_spi.h"
  212. #endif /* FL_SPI_DRIVER_ENABLED */
  213. #if defined(FL_SVD_DRIVER_ENABLED)
  214. #include "fm33lc0xx_fl_svd.h"
  215. #endif /* FL_SVD_DRIVER_ENABLED */
  216. #if defined(FL_U7816_DRIVER_ENABLED)
  217. #include "fm33lc0xx_fl_u7816.h"
  218. #endif /* FL_U7816_DRIVER_ENABLED */
  219. #if defined(FL_UART_DRIVER_ENABLED)
  220. #include "fm33lc0xx_fl_uart.h"
  221. #endif /* FL_UART_DRIVER_ENABLED */
  222. #if defined(FL_VREF_DRIVER_ENABLED)
  223. #include "fm33lc0xx_fl_vref.h"
  224. #endif /* FL_VREF_DRIVER_ENABLED */
  225. #if defined(FL_WWDT_DRIVER_ENABLED)
  226. #include "fm33lc0xx_fl_wwdt.h"
  227. #endif /* FL_WWDT_DRIVER_ENABLED */
  228. #ifdef __cplusplus
  229. }
  230. #endif
  231. #endif /* __FM33LC0XX_FL_H */
  232. /*************************(C) COPYRIGHT Fudan Microelectronics **** END OF FILE*************************/