gd32f10x_can.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. /**
  2. ******************************************************************************
  3. * @brief CAN header file of the firmware library.
  4. ******************************************************************************
  5. */
  6. /* Define to prevent recursive inclusion -------------------------------------*/
  7. #ifndef __GD32F10X_CAN_H
  8. #define __GD32F10X_CAN_H
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /* Includes ------------------------------------------------------------------*/
  13. #include "gd32f10x.h"
  14. /** @addtogroup GD32F10x_Firmware
  15. * @{
  16. */
  17. /** @addtogroup CAN
  18. * @{
  19. */
  20. /** @defgroup CAN_Exported_Types
  21. * @{
  22. */
  23. /**
  24. * @brief CAN Initial Parameters
  25. */
  26. typedef struct {
  27. uint16_t CAN_Prescaler; /*!< Baud rate prescaler.It can be 1 to 1024. */
  28. uint8_t CAN_Mode; /*!< Set the CAN operating mode. */
  29. uint8_t CAN_SJW; /*!< Set Resynchronization jump width */
  30. uint8_t CAN_BS1; /*!< Set time segment 1. */
  31. uint8_t CAN_BS2; /*!< Set time segment 2. */
  32. TypeState CAN_TTC; /*!< Set time triggered communication mode. */
  33. TypeState CAN_ABOR; /*!< Set automatic bus-off recovery. */
  34. TypeState CAN_AWK; /*!< Set the automatic wake-up mode. */
  35. TypeState CAN_ARD; /*!< Set the automatic retransmission mode. */
  36. TypeState CAN_RFOD; /*!< Receive FIFO overwrite mode. */
  37. TypeState CAN_TFO; /*!< Set the Transmit FIFO order. */
  38. } CAN_InitPara;
  39. /**
  40. * @brief CAN filter Initial Parameters
  41. */
  42. typedef struct {
  43. uint16_t CAN_FilterListHigh; /*!< the filter List number.
  44. If the filter scale is 32-bit,the filter list number is MSBs.
  45. If the filter scale is 16-bit,the filter list number is first one.
  46. This value can take from 0x0000 to 0xFFFF */
  47. uint16_t CAN_FilterListLow; /*!< the filter List number.
  48. If the filter scale is 32-bit,the filter list number is LSBs.
  49. If the filter scale is 16-bit,the filter list number is second one.
  50. This value can take from 0x0000 to 0xFFFF */
  51. uint16_t CAN_FilterMaskListHigh; /*!< the filter mask number or list number,according to the filter mode.
  52. If the filter scale is 32-bit,the filter mask number or list number is MSBs.
  53. If the filter scale is 16-bit,the filter mask number or list number is first one.
  54. This value can take from 0x0000 to 0xFFFF */
  55. uint16_t CAN_FilterMaskListLow; /*!< the filter mask number or list number,according to the filter mode.
  56. If the filter scale is 32-bit,the filter mask number or list number is LSBs.
  57. If the filter scale is 16-bit,the filter mask number or list number is second one.
  58. This value can take from 0x0000 to 0xFFFF */
  59. uint16_t CAN_FilterFIFOAssociation; /*!< Set the FIFO (0 or 1) which will be associated with the filter. */
  60. uint8_t CAN_FilterNumber; /*!< Set the which filter to be initialized. It ranges from 0 to 13 or 0 to 27(in GD32F10X_CL). */
  61. uint8_t CAN_FilterMode; /*!< Set the filter mode to be identifier mask or identifier list. */
  62. uint8_t CAN_FilterScale; /*!< Set the filter scale. */
  63. TypeState CAN_FilterWork; /*!< Set the filter to work or not. */
  64. } CAN_FilterInitPara;
  65. /**
  66. * @brief CAN Tx message structure definition
  67. */
  68. typedef struct {
  69. uint32_t StdId; /*!< Set the standard format frame identifier.
  70. This value can take from 0 to 0x7FF. */
  71. uint32_t ExtId; /*!< Set the extended format frame identifier.
  72. This value can take from 0 to 0x1FFFFFFF. */
  73. uint8_t FF; /*!< Set the format of Frame , Standard or extended Frame
  74. for the message that will be transmitted. */
  75. uint8_t FT; /*!< Set the type of frame, Data or remote
  76. for the message that will be transmitted. */
  77. uint8_t DLC; /*!< Set the length of the frame that will be transmitted.
  78. This value can take from 0 to 8 */
  79. uint8_t Data[8]; /*!< store the data that will be transmitted.
  80. This value can take from 0 to 0xFF. */
  81. } CanTxMessage;
  82. /**
  83. * @brief CAN Rx message structure definition
  84. */
  85. typedef struct {
  86. uint32_t StdId; /*!< Set the standard format frame identifier.
  87. This value can take from 0 to 0x7FF. */
  88. uint32_t ExtId; /*!< Set the extended format frame identifier.
  89. This value can take from 0 to 0x1FFFFFFF. */
  90. uint8_t FF; /*!< Set the format of Frame , Standard or extended Frame
  91. for the message that will be received. */
  92. uint8_t FT; /*!< Set the type of frame, Data or remote
  93. for the message that will be received. */
  94. uint8_t DLC; /*!< Set the length of the frame that will be received.
  95. This value can take from 0 to 8 */
  96. uint8_t Data[8]; /*!< store the data that will be received.
  97. This value can take from 0 to 0xFF. */
  98. uint8_t FI; /*!< The index of the filter by which the frame is passed..
  99. This value can take from 0 to 0xFF */
  100. } CanRxMessage;
  101. /**
  102. * @}
  103. */
  104. /** @defgroup CAN_Exported_Constants
  105. * @{
  106. */
  107. /** @defgroup CAN_sleep_constants
  108. * @{
  109. */
  110. #define CAN_INITSTATE_FAILED ((uint8_t)0x00) /*!< CAN initialization failed */
  111. #define CAN_INITSTATE_SUCCESS ((uint8_t)0x01) /*!< CAN initialization OK */
  112. /**
  113. * @}
  114. */
  115. /** @defgroup CAN_Communication_Mode
  116. * @{
  117. */
  118. #define CAN_MODE_NORMAL ((uint8_t)0x00) /*!< Normal communication mode */
  119. #define CAN_MODE_LOOPBACK ((uint8_t)0x01) /*!< Loopback communication mode */
  120. #define CAN_MODE_SILENT ((uint8_t)0x02) /*!< Silent communication mode */
  121. #define CAN_MODE_SILENT_LOOPBACK ((uint8_t)0x03) /*!< Loopback and silent communication mode */
  122. /**
  123. * @}
  124. */
  125. /**
  126. * @defgroup CAN_Working_Mode
  127. * @{
  128. */
  129. #define CAN_WORKINGMODE_INITIAL ((uint8_t)0x00) /*!< Initial working mode */
  130. #define CAN_WORKINGMODE_NORMAL ((uint8_t)0x01) /*!< Normal working mode */
  131. #define CAN_WORKINGMODE_SLEEP ((uint8_t)0x02) /*!< Sleep working mode */
  132. /**
  133. * @}
  134. */
  135. /**
  136. * @defgroup CAN_Mode_State
  137. * @{
  138. */
  139. #define CAN_MODESTATE_FAILED ((uint8_t)0x00) /*!< CAN entering the specified mode failed */
  140. #define CAN_MODESTATE_SUCCESS ((uint8_t)!CAN_MODESTATE_FAILED) /*!< CAN entering the specified mode Succeed */
  141. /**
  142. * @}
  143. */
  144. /** @defgroup CAN_Synchronisation_Jump_Width
  145. * @{
  146. */
  147. #define CAN_SJW_1TQ ((uint8_t)0x00) /*!< 1 time quanta */
  148. #define CAN_SJW_2TQ ((uint8_t)0x01) /*!< 2 time quanta */
  149. #define CAN_SJW_3TQ ((uint8_t)0x02) /*!< 3 time quanta */
  150. #define CAN_SJW_4TQ ((uint8_t)0x03) /*!< 4 time quanta */
  151. /**
  152. * @}
  153. */
  154. /** @defgroup CAN_Time_Quanta_In_Bit_Segment_1
  155. * @{
  156. */
  157. #define CAN_BS1_1TQ ((uint8_t)0x00) /*!< 1 time quanta */
  158. #define CAN_BS1_2TQ ((uint8_t)0x01) /*!< 2 time quanta */
  159. #define CAN_BS1_3TQ ((uint8_t)0x02) /*!< 3 time quanta */
  160. #define CAN_BS1_4TQ ((uint8_t)0x03) /*!< 4 time quanta */
  161. #define CAN_BS1_5TQ ((uint8_t)0x04) /*!< 5 time quanta */
  162. #define CAN_BS1_6TQ ((uint8_t)0x05) /*!< 6 time quanta */
  163. #define CAN_BS1_7TQ ((uint8_t)0x06) /*!< 7 time quanta */
  164. #define CAN_BS1_8TQ ((uint8_t)0x07) /*!< 8 time quanta */
  165. #define CAN_BS1_9TQ ((uint8_t)0x08) /*!< 9 time quanta */
  166. #define CAN_BS1_10TQ ((uint8_t)0x09) /*!< 10 time quanta */
  167. #define CAN_BS1_11TQ ((uint8_t)0x0A) /*!< 11 time quanta */
  168. #define CAN_BS1_12TQ ((uint8_t)0x0B) /*!< 12 time quanta */
  169. #define CAN_BS1_13TQ ((uint8_t)0x0C) /*!< 13 time quanta */
  170. #define CAN_BS1_14TQ ((uint8_t)0x0D) /*!< 14 time quanta */
  171. #define CAN_BS1_15TQ ((uint8_t)0x0E) /*!< 15 time quanta */
  172. #define CAN_BS1_16TQ ((uint8_t)0x0F) /*!< 16 time quanta */
  173. /**
  174. * @}
  175. */
  176. /** @defgroup CAN_Time_Quanta_In_Bit_Segment_2
  177. * @{
  178. */
  179. #define CAN_BS2_1TQ ((uint8_t)0x00) /*!< 1 time quanta */
  180. #define CAN_BS2_2TQ ((uint8_t)0x01) /*!< 2 time quanta */
  181. #define CAN_BS2_3TQ ((uint8_t)0x02) /*!< 3 time quanta */
  182. #define CAN_BS2_4TQ ((uint8_t)0x03) /*!< 4 time quanta */
  183. #define CAN_BS2_5TQ ((uint8_t)0x04) /*!< 5 time quanta */
  184. #define CAN_BS2_6TQ ((uint8_t)0x05) /*!< 6 time quanta */
  185. #define CAN_BS2_7TQ ((uint8_t)0x06) /*!< 7 time quanta */
  186. #define CAN_BS2_8TQ ((uint8_t)0x07) /*!< 8 time quanta */
  187. /**
  188. * @}
  189. */
  190. /** @defgroup CAN_Filter_Mode
  191. * @{
  192. */
  193. #define CAN_FILTERMODE_MASK ((uint8_t)0x00) /*!< mask mode */
  194. #define CAN_FILTERMODE_LIST ((uint8_t)0x01) /*!< List mode */
  195. /**
  196. * @}
  197. */
  198. /** @defgroup CAN_Filter_Scale
  199. * @{
  200. */
  201. #define CAN_FILTERSCALE_16BIT ((uint8_t)0x00) /*!< Two 16-bit filters */
  202. #define CAN_FILTERSCALE_32BIT ((uint8_t)0x01) /*!< One 32-bit filter */
  203. /**
  204. * @}
  205. */
  206. /** @defgroup CAN_Filter_FIFO
  207. * @{
  208. */
  209. #define CAN_FILTER_FIFO0 ((uint8_t)0x00) /*!< Filter associated with FIFO0 */
  210. #define CAN_FILTER_FIFO1 ((uint8_t)0x01) /*!< Filter associated with FIFO1 */
  211. /**
  212. * @}
  213. */
  214. /** @defgroup CAN_Format_Frame
  215. * @{
  216. */
  217. #define CAN_FF_STANDARD ((uint32_t)0x00000000) /*!< Standard format frame */
  218. #define CAN_FF_EXTENDED ((uint32_t)0x00000004) /*!< Extended format frame */
  219. /**
  220. * @}
  221. */
  222. /** @defgroup CAN_Frame_Type
  223. * @{
  224. */
  225. #define CAN_FT_DATA ((uint32_t)0x00000000) /*!< Data frame */
  226. #define CAN_FT_REMOTE ((uint32_t)0x00000002) /*!< Remote frame */
  227. /**
  228. * @}
  229. */
  230. /** @defgroup CAN_Transmit_State
  231. * @{
  232. */
  233. #define CAN_TXSTATE_FAILED ((uint8_t)0x00)/*!< CAN transmitted failure */
  234. #define CAN_TXSTATE_OK ((uint8_t)0x01) /*!< CAN transmitted success */
  235. #define CAN_TXSTATE_PENDING ((uint8_t)0x02) /*!< CAN transmitted pending */
  236. #define CAN_TXSTATE_NOMAILBOX ((uint8_t)0x04) /*!< No empty mailbox to be used for CAN */
  237. /**
  238. * @}
  239. */
  240. /** @defgroup CAN_Receive_FIFO_Number_Constants
  241. * @{
  242. */
  243. #define CAN_FIFO0 ((uint8_t)0x00) /*!< Use CAN FIFO 0 to receive */
  244. #define CAN_FIFO1 ((uint8_t)0x01) /*!< Use CAN FIFO 1 to receive */
  245. /**
  246. * @}
  247. */
  248. /** @defgroup CAN_Sleep_Constants
  249. * @{
  250. */
  251. #define CAN_SLEEP_FAILED ((uint8_t)0x00) /*!< CAN entered the sleep mode failed */
  252. #define CAN_SLEEP_OK ((uint8_t)0x01) /*!< CAN entered the sleep mode succeeded */
  253. /**
  254. * @}
  255. */
  256. /** @defgroup CAN_Wake_Wp_Constants
  257. * @{
  258. */
  259. #define CAN_WAKEUP_FAILED ((uint8_t)0x00) /*!< CAN leaved the sleep mode failed */
  260. #define CAN_WAKEUP_OK ((uint8_t)0x01) /*!< CAN leaved the sleep mode succeeded */
  261. /**
  262. * @}
  263. */
  264. /**
  265. * @defgroup CAN_Error_Type_Constants
  266. * @{
  267. */
  268. #define CAN_ERRORTYPE_NOERR ((uint8_t)0x00) /*!< No Error */
  269. #define CAN_ERRORTYPE_STUFFERR ((uint8_t)0x10) /*!< Stuff Error */
  270. #define CAN_ERRORTYPE_FORMERR ((uint8_t)0x20) /*!< Form Error */
  271. #define CAN_ERRORTYPE_ACKERR ((uint8_t)0x30) /*!< Acknowledgment Error */
  272. #define CAN_ERRORTYPE_BITRECESSIVEERR ((uint8_t)0x40) /*!< Bit Recessive Error */
  273. #define CAN_ERRORTYPE_BITDOMINANTERR ((uint8_t)0x50) /*!< Bit Dominant Error */
  274. #define CAN_ERRORTYPE_CRCERR ((uint8_t)0x60) /*!< CRC Error */
  275. #define CAN_ERRORTYPE_SOFTWARESETERR ((uint8_t)0x70) /*!< Set by software */
  276. /**
  277. * @}
  278. */
  279. /** @defgroup CAN_flags
  280. * @{
  281. */
  282. /* The flag value of 0x3XXXXXXX is used with CAN_GetBitState()and CAN_ClearBitState() functions. */
  283. /* The flag value of 0x1XXXXXXX is only used with CAN_GetBitState() function. */
  284. /* Transmit Flags */
  285. #define CAN_FLAG_MTF0 ((uint32_t)0x38000001) /*!< Mailbox 0 transmit finished Flag */
  286. #define CAN_FLAG_MTF1 ((uint32_t)0x38000100) /*!< Mailbox 1 transmit finished Flag */
  287. #define CAN_FLAG_MTF2 ((uint32_t)0x38010000) /*!< Mailbox 2 transmit finished Flag */
  288. /* Receive Flags */
  289. #define CAN_FLAG_RFL0 ((uint32_t)0x12000003) /*!< the length of the receive FIFO0 Flag */
  290. #define CAN_FLAG_RFF0 ((uint32_t)0x32000008) /*!< Receive FIFO 0 full Flag */
  291. #define CAN_FLAG_RFO0 ((uint32_t)0x32000010) /*!< Receive FIFO 0 overfull Flag */
  292. #define CAN_FLAG_RFL1 ((uint32_t)0x14000003) /*!< the length of the receive FIFO1 Flag */
  293. #define CAN_FLAG_RFF1 ((uint32_t)0x34000008) /*!< Receive FIFO 1 full Flag */
  294. #define CAN_FLAG_RFO1 ((uint32_t)0x34000010) /*!< Receive FIFO 1 overfull Flag */
  295. /* Working Mode Flags, in CAN status register */
  296. #define CAN_FLAG_WU ((uint32_t)0x31000008) /*!< Wake up Flag */
  297. #define CAN_FLAG_SLP ((uint32_t)0x31000012) /*!< Sleep working state Flag */
  298. /* Error Flags, in CAN error register */
  299. #define CAN_FLAG_WE ((uint32_t)0x10F00001) /*!< Warning error Flag */
  300. #define CAN_FLAG_PE ((uint32_t)0x10F00002) /*!< Passive error Flag */
  301. #define CAN_FLAG_BOE ((uint32_t)0x10F00004) /*!< Bus-off error Flag */
  302. #define CAN_FLAG_ET ((uint32_t)0x30F00070) /*!< Error type Flag */
  303. /**
  304. * @}
  305. */
  306. /** @defgroup CAN_interrupts
  307. * @{
  308. */
  309. #define CAN_INT_TME ((uint32_t)0x00000001) /*!< Transmit mailbox empty Interrupt*/
  310. /* Receive Interrupts */
  311. #define CAN_INT_RFNE0 ((uint32_t)0x00000002) /*!< FIFO 0 not empty interrupt */
  312. #define CAN_INT_RFF0 ((uint32_t)0x00000004) /*!< FIFO 0 full Interrupt*/
  313. #define CAN_INT_RFO0 ((uint32_t)0x00000008) /*!< FIFO 0 overrun Interrupt*/
  314. #define CAN_INT_RFNE1 ((uint32_t)0x00000010) /*!< FIFO 1 not empty interrupt*/
  315. #define CAN_INT_RFF1 ((uint32_t)0x00000020) /*!< FIFO 1 full Interrupt*/
  316. #define CAN_INT_RFO1 ((uint32_t)0x00000040) /*!< FIFO 1 overfull Interrupt*/
  317. /* Working Mode Interrupts */
  318. #define CAN_INT_WU ((uint32_t)0x00010000) /*!< Wake-up Interrupt*/
  319. #define CAN_INT_SLP ((uint32_t)0x00020000) /*!< Sleep Interrupt*/
  320. /* Error Interrupts */
  321. #define CAN_INT_WE ((uint32_t)0x00000100) /*!< Warning error Interrupt*/
  322. #define CAN_INT_PE ((uint32_t)0x00000200) /*!< Passive error Interrupt*/
  323. #define CAN_INT_BOE ((uint32_t)0x00000400) /*!< Bus-off error Interrupt*/
  324. #define CAN_INT_ET ((uint32_t)0x00000800) /*!< error type Interrupt*/
  325. #define CAN_INT_ERR ((uint32_t)0x00008000) /*!< Error Interrupt*/
  326. #define CAN_INT_MTF0 CAN_INT_TME
  327. #define CAN_INT_MTF1 CAN_INT_TME
  328. #define CAN_INT_MTF2 CAN_INT_TME
  329. /**
  330. * @}
  331. */
  332. /** @defgroup CAN_Legacy
  333. * @{
  334. */
  335. #define CANINITFAILED CAN_INITSTATE_FAILED
  336. #define CANINITOK CAN_INITSTATE_SUCCESS
  337. #define CAN_FILTERFIFO0 CAN_FILTER_FIFO0
  338. #define CAN_FILTERFIFO1 CAN_FILTER_FIFO1
  339. #define CAN_FF_STD CAN_FF_STANDARD
  340. #define CAN_FF_EXT CAN_FF_EXTENDED
  341. //#define CAN_FT_DATA CAN_FT_DATA
  342. //#define CAN_FT_REMOTE CAN_FT_REMOTE
  343. #define CANTXFAILE CAN_TXSTATE_FAILED
  344. #define CANTXOK CAN_TXSTATE_OK
  345. #define CANTXPENDING CAN_TXSTATE_PENDING
  346. #define CAN_NO_MB CAN_TXSTATE_NOMAILBOX
  347. #define CANSLEEPFAILED CAN_SLEEP_FAILED
  348. #define CANSLEEPOK CAN_SLEEP_OK
  349. #define CANWAKEUPFAILED CAN_WAKEUP_FAILED
  350. #define CANWAKEUPOK CAN_WAKEUP_OK
  351. /**
  352. * @}
  353. */
  354. /**
  355. * @}
  356. */
  357. /** @defgroup CAN_Exported_Functions
  358. * @{
  359. */
  360. void CAN_DeInit(CAN_TypeDef *CANx);
  361. uint8_t CAN_Init(CAN_TypeDef *CANx, CAN_InitPara *CAN_InitParaStruct);
  362. void CAN_FilterInit(CAN_FilterInitPara *CAN_FilterInitParaStruct);
  363. void CAN_StructInit(CAN_InitPara *CAN_InitParaStruct);
  364. void CAN_HeaderBank(uint8_t CAN_HeaderBankNumber);
  365. void CAN_DebugFreeze(CAN_TypeDef *CANx, TypeState NewValue);
  366. void CAN_TimeTrigComMode_Enable(CAN_TypeDef *CANx, TypeState NewValue);
  367. /* Transmit functions */
  368. uint8_t CAN_Transmit(CAN_TypeDef *CANx, CanTxMessage *TxMessage);
  369. uint8_t CAN_TransmitState(CAN_TypeDef *CANx, uint8_t TransmitMailbox);
  370. void CAN_StopTransmit(CAN_TypeDef *CANx, uint8_t Mailbox);
  371. /* Receive functions */
  372. void CAN_Receive(CAN_TypeDef *CANx, uint8_t FIFONumber, CanRxMessage *RxMessage);
  373. void CAN_FIFODequeue(CAN_TypeDef *CANx, uint8_t FIFONumber);
  374. uint8_t CAN_MessageLength(CAN_TypeDef *CANx, uint8_t FIFONumber);
  375. /* Working modes functions */
  376. uint8_t CAN_WorkingMode(CAN_TypeDef *CANx, uint8_t CAN_WorkingMode);
  377. uint8_t CAN_EnterSleep(CAN_TypeDef *CANx);
  378. uint8_t CAN_WakeUp(CAN_TypeDef *CANx);
  379. /* Error management functions */
  380. uint8_t CAN_GetErrorType(CAN_TypeDef *CANx);
  381. uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef *CANx);
  382. uint8_t CAN_GetTransmitErrorCounter(CAN_TypeDef *CANx);
  383. /* Interrupts and flags management functions */
  384. void CAN_INTConfig(CAN_TypeDef *CANx, uint32_t CAN_INT, TypeState NewValue);
  385. TypeState CAN_GetBitState(CAN_TypeDef *CANx, uint32_t CAN_FLAG);
  386. void CAN_ClearBitState(CAN_TypeDef *CANx, uint32_t CAN_FLAG);
  387. TypeState CAN_GetIntBitState(CAN_TypeDef *CANx, uint32_t CAN_INT);
  388. void CAN_ClearIntBitState(CAN_TypeDef *CANx, uint32_t CAN_INT);
  389. static TypeState CheckINTState(uint32_t CAN_Reg, uint32_t Int_Bit);
  390. #ifdef __cplusplus
  391. }
  392. #endif
  393. #endif /* __GD32F10x_CAN_H */
  394. /**
  395. * @}
  396. */
  397. /**
  398. * @}
  399. */
  400. /**
  401. * @}
  402. */