tae32f53xx_ll_can.h 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  1. /**
  2. ******************************************************************************
  3. * @file tae32f53xx_ll_can.h
  4. * @author MCD Application Team
  5. * @brief Header file for CAN LL module.
  6. *
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2020 Tai-Action.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software is licensed by Tai-Action 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. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef _TAE32F53XX_LL_CAN_H_
  22. #define _TAE32F53XX_LL_CAN_H_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /* __cplusplus */
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "tae32f53xx_ll_def.h"
  28. /** @addtogroup TAE32F53xx_LL_Driver
  29. * @{
  30. */
  31. /** @addtogroup CAN_LL
  32. * @{
  33. */
  34. /* Exported constants --------------------------------------------------------*/
  35. /* Exported types ------------------------------------------------------------*/
  36. /** @defgroup CAN_LL_Exported_Types CAN LL Exported Types
  37. * @brief CAN LL Exported Types
  38. * @{
  39. */
  40. /**
  41. *@brief CAN RX buffer status enum type define
  42. */
  43. typedef enum {
  44. CAN_RX_BUF_STA_EMPTY = 0, /*!< CAN RX buffer empty */
  45. CAN_RX_BUF_STA_FEW, /*!< CAN RX buffer few */
  46. CAN_RX_BUF_STA_ALMOST_FULL, /*!< CAN RX buffer almost full */
  47. CAN_RX_BUF_STA_FULL, /*!< CAN RX buffer full */
  48. } CAN_RxBufStaETypeDef;
  49. /**
  50. * @brief CAN acceptance filter slot definition.
  51. */
  52. typedef enum {
  53. CAN_ACCEPT_FILT_SLOT_0 = 0, /*!< CAN acceptance filter slot 0 */
  54. CAN_ACCEPT_FILT_SLOT_1, /*!< CAN acceptance filter slot 1 */
  55. CAN_ACCEPT_FILT_SLOT_2, /*!< CAN acceptance filter slot 2 */
  56. CAN_ACCEPT_FILT_SLOT_3, /*!< CAN acceptance filter slot 3 */
  57. CAN_ACCEPT_FILT_SLOT_4, /*!< CAN acceptance filter slot 4 */
  58. CAN_ACCEPT_FILT_SLOT_5, /*!< CAN acceptance filter slot 5 */
  59. CAN_ACCEPT_FILT_SLOT_6, /*!< CAN acceptance filter slot 6 */
  60. CAN_ACCEPT_FILT_SLOT_7, /*!< CAN acceptance filter slot 7 */
  61. CAN_ACCEPT_FILT_SLOT_8, /*!< CAN acceptance filter slot 8 */
  62. CAN_ACCEPT_FILT_SLOT_9, /*!< CAN acceptance filter slot 9 */
  63. CAN_ACCEPT_FILT_SLOT_10, /*!< CAN acceptance filter slot 10 */
  64. CAN_ACCEPT_FILT_SLOT_11, /*!< CAN acceptance filter slot 11 */
  65. CAN_ACCEPT_FILT_SLOT_12, /*!< CAN acceptance filter slot 12 */
  66. CAN_ACCEPT_FILT_SLOT_13, /*!< CAN acceptance filter slot 13 */
  67. CAN_ACCEPT_FILT_SLOT_14, /*!< CAN acceptance filter slot 14 */
  68. CAN_ACCEPT_FILT_SLOT_15, /*!< CAN acceptance filter slot 15 */
  69. } CAN_AcceptFilSlotETypeDef;
  70. /**
  71. * @brief CAN RX buffer almost full warnning limit definition
  72. */
  73. typedef enum {
  74. CAN_RX_ALMOST_FULL_LIMIT_0 = 0, /*!< CAN RX buffer almost full warnning limit: 0 Byte */
  75. CAN_RX_ALMOST_FULL_LIMIT_1, /*!< CAN RX buffer almost full warnning limit: 1 Byte */
  76. CAN_RX_ALMOST_FULL_LIMIT_2, /*!< CAN RX buffer almost full warnning limit: 2 Byte */
  77. CAN_RX_ALMOST_FULL_LIMIT_3, /*!< CAN RX buffer almost full warnning limit: 3 Byte */
  78. CAN_RX_ALMOST_FULL_LIMIT_4, /*!< CAN RX buffer almost full warnning limit: 4 Byte */
  79. CAN_RX_ALMOST_FULL_LIMIT_5, /*!< CAN RX buffer almost full warnning limit: 5 Byte */
  80. CAN_RX_ALMOST_FULL_LIMIT_6, /*!< CAN RX buffer almost full warnning limit: 6 Byte */
  81. CAN_RX_ALMOST_FULL_LIMIT_7, /*!< CAN RX buffer almost full warnning limit: 7 Byte */
  82. CAN_RX_ALMOST_FULL_LIMIT_8, /*!< CAN RX buffer almost full warnning limit: 8 Byte */
  83. CAN_RX_ALMOST_FULL_LIMIT_9, /*!< CAN RX buffer almost full warnning limit: 9 Byte */
  84. CAN_RX_ALMOST_FULL_LIMIT_10, /*!< CAN RX buffer almost full warnning limit: 10 Byte */
  85. CAN_RX_ALMOST_FULL_LIMIT_11, /*!< CAN RX buffer almost full warnning limit: 11 Byte */
  86. CAN_RX_ALMOST_FULL_LIMIT_12, /*!< CAN RX buffer almost full warnning limit: 12 Byte */
  87. CAN_RX_ALMOST_FULL_LIMIT_13, /*!< CAN RX buffer almost full warnning limit: 13 Byte */
  88. CAN_RX_ALMOST_FULL_LIMIT_14, /*!< CAN RX buffer almost full warnning limit: 14 Byte */
  89. CAN_RX_ALMOST_FULL_LIMIT_15, /*!< CAN RX buffer almost full warnning limit: 15 Byte */
  90. } CAN_RxAlmostFullLimitETypeDef;
  91. /**
  92. * @brief CAN programmable error warning limit definition
  93. */
  94. typedef enum {
  95. CAN_ERR_WARN_LIMIT_8 = 0, /*!< CAN programmable error warning limit: 8 bytes */
  96. CAN_ERR_WARN_LIMIT_16, /*!< CAN programmable error warning limit: 16 bytes */
  97. CAN_ERR_WARN_LIMIT_24, /*!< CAN programmable error warning limit: 24 bytes */
  98. CAN_ERR_WARN_LIMIT_32, /*!< CAN programmable error warning limit: 32 bytes */
  99. CAN_ERR_WARN_LIMIT_40, /*!< CAN programmable error warning limit: 40 bytes */
  100. CAN_ERR_WARN_LIMIT_48, /*!< CAN programmable error warning limit: 48 bytes */
  101. CAN_ERR_WARN_LIMIT_56, /*!< CAN programmable error warning limit: 56 bytes */
  102. CAN_ERR_WARN_LIMIT_64, /*!< CAN programmable error warning limit: 64 bytes */
  103. CAN_ERR_WARN_LIMIT_72, /*!< CAN programmable error warning limit: 72 bytes */
  104. CAN_ERR_WARN_LIMIT_80, /*!< CAN programmable error warning limit: 80 bytes */
  105. CAN_ERR_WARN_LIMIT_88, /*!< CAN programmable error warning limit: 88 bytes */
  106. CAN_ERR_WARN_LIMIT_96, /*!< CAN programmable error warning limit: 96 bytes */
  107. CAN_ERR_WARN_LIMIT_104, /*!< CAN programmable error warning limit: 104 bytes */
  108. CAN_ERR_WARN_LIMIT_112, /*!< CAN programmable error warning limit: 112 bytes */
  109. CAN_ERR_WARN_LIMIT_120, /*!< CAN programmable error warning limit: 120 bytes */
  110. CAN_ERR_WARN_LIMIT_128, /*!< CAN programmable error warning limit: 128 bytes */
  111. } CAN_ErrWarnLimitETypeDef;
  112. /**
  113. * @brief CAN RX buffer format type definition
  114. */
  115. typedef struct __CAN_RxBufFormatTypeDef {
  116. /*! Standard/Extended iDentifier value
  117. */
  118. uint32_t id : 29,
  119. /*! Reserved bit.
  120. */
  121. reserved1 : 2,
  122. /*! Error State Indicator. This is a read-only status bit for RBUF and is not available
  123. * in TBUF. The protocol machine automatically embeds the correct value of ESI into
  124. * transmitted frames. ESI is only included in CAN FD frames and does not exist in CAN
  125. * 2.0 frames.
  126. */
  127. err_state_indicator : 1;
  128. /*! The Data Length Code (DLC) in RBUF and TBUF defines the length of the payload(the
  129. * number of payload bytes in a frame).
  130. */
  131. uint32_t data_len_code : 4,
  132. /*! Bit Rate Switch
  133. * 0: nominal / slow bit rate for the complete frame.
  134. * 1: switch to data / fast bit rate for the data payload and the CRC
  135. * Only CAN FD frames can switch the bitrate. Therefore BRS is forced to 0 if EDL=0
  136. */
  137. bit_rate_switch : 1,
  138. /*! Extended Data Length
  139. * 0: CAN 2.0 frame (up to 8 bytes payload)
  140. * 1: CAN FD frame (up to 64 bytes payload)
  141. */
  142. extended_data_len : 1,
  143. /*! Remote Transmission Request
  144. * 0: data frame
  145. * 1: remote frame
  146. * Only CAN 2.0 frames can be remote frames. There is no remote frame for CAN FD.
  147. * Therefore RTR is forced to 0 if EDL=1 in the TBUF.
  148. */
  149. remote_tx_req : 1,
  150. /*! IDentifier Extension
  151. * 0: Standard Format: ID(10:0)
  152. * 1: Extended Format: ID(28:0)
  153. */
  154. id_extension : 1,
  155. /*! Reserved bit.
  156. */
  157. reserved2 : 24;
  158. } CAN_RxBufFormatTypeDef;
  159. /**
  160. * @brief CAN TX buffer format type definition
  161. */
  162. typedef struct __CAN_TxBufFormatTypeDef {
  163. /*! Standard/Extended iDentifier value
  164. */
  165. uint32_t id : 29,
  166. /*! Reserved bit.
  167. */
  168. reserved1 : 3;
  169. /*! The Data Length Code (DLC) in RBUF and TBUF defines the length of the payload(the
  170. * number of payload bytes in a frame).
  171. */
  172. uint32_t data_len_code : 4,
  173. /*! Bit Rate Switch
  174. * 0: nominal / slow bit rate for the complete frame.
  175. * 1: switch to data / fast bit rate for the data payload and the CRC
  176. * Only CAN FD frames can switch the bitrate. Therefore BRS is forced to 0 if EDL=0
  177. */
  178. bit_rate_switch : 1,
  179. /*! Extended Data Length
  180. * 0: CAN 2.0 frame (up to 8 bytes payload)
  181. * 1: CAN FD frame (up to 64 bytes payload)
  182. */
  183. extended_data_len : 1,
  184. /*! Remote Transmission Request
  185. * 0: data frame
  186. * 1: remote frame
  187. * Only CAN 2.0 frames can be remote frames. There is no remote frame for CAN FD.
  188. * Therefore RTR is forced to 0 if EDL=1 in the TBUF.
  189. */
  190. remote_tx_req : 1,
  191. /*! IDentifier Extension
  192. * 0: Standard Format: ID(10:0)
  193. * 1: Extended Format: ID(28:0)
  194. */
  195. id_extension : 1,
  196. /*! Reserved bit.
  197. */
  198. reserved2 : 24;
  199. } CAN_TxBufFormatTypeDef;
  200. /**
  201. * @brief CAN acceptance filter config type definition
  202. */
  203. typedef struct __CAN_AcceptFilCfgTypeDef {
  204. CAN_AcceptFilSlotETypeDef slot; /*!< acceptance filter slot number */
  205. uint32_t code_val; /*!< acceptance filter code value */
  206. uint32_t mask_val; /*!< acceptance filter mask value */
  207. } CAN_AcceptFilCfgTypeDef;
  208. /**
  209. * @brief CAN user config type definition
  210. */
  211. typedef struct __CAN_UserCfgTypeDef {
  212. uint32_t baudrate; /*!< baudrate */
  213. uint8_t bit_timing_seg1; /*!< bit timing segment1 */
  214. uint8_t bit_timing_seg2; /*!< bit timing degment2 */
  215. uint8_t bit_timing_sjw; /*!< bit timing synchronization jump width */
  216. CAN_RxAlmostFullLimitETypeDef rx_almost_full_limit; /*!< rx buffer almost full warning limit */
  217. CAN_ErrWarnLimitETypeDef err_limit; /*!< error warning limit */
  218. CAN_AcceptFilCfgTypeDef *accept_fil_cfg_ptr; /*!< acceptance filter config pointer */
  219. uint8_t accept_fil_cfg_num; /*!< acceptance filter config number */
  220. } CAN_UserCfgTypeDef;
  221. /**
  222. * @}
  223. */
  224. /* Exported macro ------------------------------------------------------------*/
  225. /** @defgroup CAN_LL_Exported_Macros CAN LL Exported Macros
  226. * @brief CAN LL Exported Macros
  227. * @{
  228. */
  229. /**
  230. * @brief CAN reset set
  231. * @param __CAN__ Specifies CAN peripheral
  232. * @return None
  233. */
  234. #define __LL_CAN_Reset_Set(__CAN__) SET_BIT((__CAN__)->CFG_STAT, CAN_RESET_Msk)
  235. /**
  236. * @brief CAN reset clear
  237. * @param __CAN__ Specifies CAN peripheral
  238. * @return None
  239. */
  240. #define __LL_CAN_Reset_Clr(__CAN__) CLEAR_BIT((__CAN__)->CFG_STAT, CAN_RESET_Msk)
  241. /**
  242. * @brief CAN reset status get
  243. * @param __CAN__ Specifies CAN peripheral
  244. * @retval 0 CAN reset has set
  245. * @retval 1 CAN reset has clear
  246. */
  247. #define __LL_CAN_ResetSta_Get(__CAN__) (READ_BIT((__CAN__)->CFG_STAT, CAN_RESET_Msk) >> CAN_RESET_Pos)
  248. /**
  249. * @brief CAN loop back mode external enable
  250. * @param __CAN__ Specifies CAN peripheral
  251. * @return None
  252. */
  253. #define __LL_CAN_LoopBackModeExt_En(__CAN__) SET_BIT((__CAN__)->CFG_STAT, CAN_LOOP_BACK_EXTERNAL_Msk)
  254. /**
  255. * @brief CAN loop back mode external disable
  256. * @param __CAN__ Specifies CAN peripheral
  257. * @return None
  258. */
  259. #define __LL_CAN_LoopBackModeExt_Dis(__CAN__) CLEAR_BIT((__CAN__)->CFG_STAT, CAN_LOOP_BACK_EXTERNAL_Msk)
  260. /**
  261. * @brief CAN loop back mode internal enable
  262. * @param __CAN__ Specifies CAN peripheral
  263. * @return None
  264. */
  265. #define __LL_CAN_LoopBackModeInternal_En(__CAN__) SET_BIT((__CAN__)->CFG_STAT, CAN_LOOP_BACK_INTERNAL_Msk)
  266. /**
  267. * @brief CAN loop back mode internal disable
  268. * @param __CAN__ Specifies CAN peripheral
  269. * @return None
  270. */
  271. #define __LL_CAN_LoopBackModeInternal_Dis(__CAN__) CLEAR_BIT((__CAN__)->CFG_STAT, CAN_LOOP_BACK_INTERNAL_Msk)
  272. /**
  273. * @brief CAN TX primary single shot enable
  274. * @param __CAN__ Specifies CAN peripheral
  275. * @return None
  276. */
  277. #define __LL_CAN_TxPriSingleShot_En(__CAN__) SET_BIT((__CAN__)->CFG_STAT, CAN_TX_PRI_SINGLE_SHOT_Msk)
  278. /**
  279. * @brief CAN TX primary single shot disable
  280. * @param __CAN__ Specifies CAN peripheral
  281. * @return None
  282. */
  283. #define __LL_CAN_TxPriSingleShot_Dis(__CAN__) CLEAR_BIT((__CAN__)->CFG_STAT, CAN_TX_PRI_SINGLE_SHOT_Msk)
  284. /**
  285. * @brief CAN TX secondary single shot enable
  286. * @param __CAN__ Specifies CAN peripheral
  287. * @return None
  288. */
  289. #define __LL_CAN_TxSecSingleShot_En(__CAN__) SET_BIT((__CAN__)->CFG_STAT, CAN_TX_SEC_SINGLE_SHOT_Msk)
  290. /**
  291. * @brief CAN TX secondary single shot disable
  292. * @param __CAN__ Specifies CAN peripheral
  293. * @return None
  294. */
  295. #define __LL_CAN_TxSecSingleShot_Dis(__CAN__) CLEAR_BIT((__CAN__)->CFG_STAT, CAN_TX_SEC_SINGLE_SHOT_Msk)
  296. /**
  297. * @brief Judge is RX active or not
  298. * @param __CAN__ Specifies CAN peripheral
  299. * @retval 0 Isn't RX active
  300. * @retval 1 Is RX active
  301. */
  302. #define __LL_CAN_IsRxActive(__CAN__) (READ_BIT((__CAN__)->CFG_STAT, CAN_RX_ACT_Msk) >> CAN_RX_ACT_Pos)
  303. /**
  304. * @brief Judge is TX active or not
  305. * @param __CAN__ Specifies CAN peripheral
  306. * @retval 0 Isn't TX active
  307. * @retval 1 Is TX active
  308. */
  309. #define __LL_CAN_IsTxActive(__CAN__) (READ_BIT((__CAN__)->CFG_STAT, CAN_TX_ACT_Msk) >> CAN_TX_ACT_Pos)
  310. /**
  311. * @brief Judge is bus off or not
  312. * @param __CAN__ Specifies CAN peripheral
  313. * @retval 0 Is bus on
  314. * @retval 1 Is bus off
  315. */
  316. #define __LL_CAN_IsBusOff(__CAN__) (READ_BIT((__CAN__)->CFG_STAT, CAN_BUS_OFF_Msk) >> CAN_BUS_OFF_Pos)
  317. /**
  318. * @brief TX buffer select PTB
  319. * @param __CAN__ Specifies CAN peripheral
  320. * @return None
  321. */
  322. #define __LL_CAN_TxBufSel_PTB(__CAN__) CLEAR_BIT((__CAN__)->TCMD, CAN_TX_BUF_SEL_Msk)
  323. /**
  324. * @brief TX buffer select STB
  325. * @param __CAN__ Specifies CAN peripheral
  326. * @return None
  327. */
  328. #define __LL_CAN_TxBufSel_STB(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_BUF_SEL_Msk)
  329. /**
  330. * @brief Listen only mode enable
  331. * @param __CAN__ Specifies CAN peripheral
  332. * @return None
  333. */
  334. #define __LL_CAN_ListenOnlyMode_En(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_LISTEN_ONLY_Msk)
  335. /**
  336. * @brief Listen only mode disable
  337. * @param __CAN__ Specifies CAN peripheral
  338. * @return None
  339. */
  340. #define __LL_CAN_ListenOnlyMode_Dis(__CAN__) CLEAR_BIT((__CAN__)->TCMD, CAN_LISTEN_ONLY_Msk)
  341. /**
  342. * @brief TX standby mode enalbe
  343. * @param __CAN__ Specifies CAN peripheral
  344. * @return None
  345. */
  346. #define __LL_CAN_TxStandbyMode_En(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_STANDBY_Msk)
  347. /**
  348. * @brief TX standby mode disalbe
  349. * @param __CAN__ Specifies CAN peripheral
  350. * @return None
  351. */
  352. #define __LL_CAN_TxStandbyMode_Dis(__CAN__) CLEAR_BIT((__CAN__)->TCMD, CAN_TX_STANDBY_Msk)
  353. /**
  354. * @brief TX primary enable set
  355. * @param __CAN__ Specifies CAN peripheral
  356. * @return None
  357. */
  358. #define __LL_CAN_TxPriEn_Set(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_PRI_EN_Msk)
  359. /**
  360. * @brief TX primary enable get
  361. * @param __CAN__ Specifies CAN peripheral
  362. * @return TX primary enable status
  363. */
  364. #define __LL_CAN_TxPriEn_Get(__CAN__) (READ_BIT((__CAN__)->TCMD, CAN_TX_PRI_EN_Msk) >> CAN_TX_PRI_EN_Pos)
  365. /**
  366. * @brief TX primary abort set
  367. * @param __CAN__ Specifies CAN peripheral
  368. * @return None
  369. */
  370. #define __LL_CAN_TxPriAbort_Set(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_PRI_ABORT_Msk)
  371. /**
  372. * @brief TX secondary one set
  373. * @param __CAN__ Specifies CAN peripheral
  374. * @return None
  375. */
  376. #define __LL_CAN_TxSecOne_Set(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_SEC_ONE_Msk)
  377. /**
  378. * @brief TX secondary one get
  379. * @param __CAN__ Specifies CAN peripheral
  380. * @return TX secondary one status
  381. */
  382. #define __LL_CAN_TxSecOne_Get(__CAN__) (READ_BIT((__CAN__)->TCMD, CAN_TX_SEC_ONE_Msk) >> CAN_TX_SEC_ONE_Pos)
  383. /**
  384. * @brief TX secondary all set
  385. * @param __CAN__ Specifies CAN peripheral
  386. * @return None
  387. */
  388. #define __LL_CAN_TxSecAll_Set(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_SEC_ALL_Msk)
  389. /**
  390. * @brief TX secondary all get
  391. * @param __CAN__ Specifies CAN peripheral
  392. * @return TX secondary send all status
  393. */
  394. #define __LL_CAN_TxSecAll_Get(__CAN__) (READ_BIT((__CAN__)->TCMD, CAN_TX_SEC_ALL_Msk) >> CAN_TX_SEC_ALL_Pos)
  395. /**
  396. * @brief TX secondary abort set
  397. * @param __CAN__ Specifies CAN peripheral
  398. * @return None
  399. */
  400. #define __LL_CAN_TxSecAbort_Set(__CAN__) SET_BIT((__CAN__)->TCMD, CAN_TX_SEC_ABORT_Msk)
  401. /**
  402. * @brief FD ISO enable
  403. * @param __CAN__ Specifies CAN peripheral
  404. * @return None
  405. */
  406. #define __LL_CAN_FD_ISO_En(__CAN__) SET_BIT((__CAN__)->TCTRL, CAN_FD_ISO_Msk)
  407. /**
  408. * @brief FD ISO disable
  409. * @param __CAN__ Specifies CAN peripheral
  410. * @return None
  411. */
  412. #define __LL_CAN_FD_ISO_Dis(__CAN__) CLEAR_BIT((__CAN__)->TCTRL, CAN_FD_ISO_Msk)
  413. /**
  414. * @brief TX secondary buffer next set
  415. * @param __CAN__ Specifies CAN peripheral
  416. * @return None
  417. */
  418. #define __LL_CAN_TxSecNext_Set(__CAN__) SET_BIT((__CAN__)->TCTRL, CAN_TX_SEC_NEXT_Msk)
  419. /**
  420. * @brief TX secondary status get
  421. * @param __CAN__ Specifies CAN peripheral
  422. * @return Number of filled message secondary buffers
  423. */
  424. #define __LL_CAN_TxSecSta_Get(__CAN__) (READ_BIT((__CAN__)->TCTRL, CAN_TX_SEC_STA_Msk) >> CAN_TX_SEC_STA_Pos)
  425. /**
  426. * @brief Judge is RX buffer overflow or not
  427. * @param __CAN__ Specifies CAN peripheral
  428. * @retval 0 Isn't RX buffer overflow
  429. * @retval 1 Is RX buffer overflow
  430. */
  431. #define __LL_CAN_IsRxBufOver(__CAN__) (READ_BIT((__CAN__)->RCTRL, CAN_RX_BUF_OVER_Msk) >> CAN_RX_BUF_OVER_Pos)
  432. /**
  433. * @brief RX buffer release
  434. * @param __CAN__ Specifies CAN peripheral
  435. * @return None
  436. */
  437. #define __LL_CAN_RxBufRelease(__CAN__) SET_BIT((__CAN__)->RCTRL, CAN_RX_BUF_REL_Msk)
  438. /**
  439. * @brief RX buffer status get
  440. * @param __CAN__ Specifies CAN peripheral
  441. * @retval 0 RX buffer empty
  442. * @retval 1 empty < RX buffer < almost full
  443. * @retval 2 RX buffer >= almost full
  444. * @retval 3 RX buffer full
  445. */
  446. #define __LL_CAN_RxBufSta_Get(__CAN__) (READ_BIT((__CAN__)->RCTRL, CAN_RX_BUF_STA_Msk) >> CAN_RX_BUF_STA_Pos)
  447. /**
  448. * @brief RX interrupt enable
  449. * @param __CAN__ Specifies CAN peripheral
  450. * @return None
  451. */
  452. #define __LL_CAN_Rx_INT_EN(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_RX_INT_EN_Msk)
  453. /**
  454. * @brief RX interrupt disable
  455. * @param __CAN__ Specifies CAN peripheral
  456. * @return None
  457. */
  458. #define __LL_CAN_Rx_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_RX_INT_EN_Msk)
  459. /**
  460. * @brief RX buffer overrun interrupt enable
  461. * @param __CAN__ Specifies CAN peripheral
  462. * @return None
  463. */
  464. #define __LL_CAN_RxBufOver_INT_EN(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_RX_BUF_OVER_INT_EN_Msk)
  465. /**
  466. * @brief RX buffer overrun interrupt disable
  467. * @param __CAN__ Specifies CAN peripheral
  468. * @return None
  469. */
  470. #define __LL_CAN_RxBufOver_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_RX_BUF_OVER_INT_EN_Msk)
  471. /**
  472. * @brief RX buffer full interrupt enable
  473. * @param __CAN__ Specifies CAN peripheral
  474. * @return None
  475. */
  476. #define __LL_CAN_RxBufFull_INT_EN(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_RX_BUF_FULL_INT_EN_Msk)
  477. /**
  478. * @brief RX buffer full interrupt disable
  479. * @param __CAN__ Specifies CAN peripheral
  480. * @return None
  481. */
  482. #define __LL_CAN_RxBufFull_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_RX_BUF_FULL_INT_EN_Msk)
  483. /**
  484. * @brief RX buffer almost full interrupt enable
  485. * @param __CAN__ Specifies CAN peripheral
  486. * @return None
  487. */
  488. #define __LL_CAN_RxBufAlmostFull_INT_EN(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_RX_BUF_ALMOST_FULL_INT_EN_Msk)
  489. /**
  490. * @brief RX buffer almost full interrupt disable
  491. * @param __CAN__ Specifies CAN peripheral
  492. * @return None
  493. */
  494. #define __LL_CAN_RxBufAlmostFull_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_RX_BUF_ALMOST_FULL_INT_EN_Msk)
  495. /**
  496. * @brief TX primary interrupt enable
  497. * @param __CAN__ Specifies CAN peripheral
  498. * @return None
  499. */
  500. #define __LL_CAN_TxPri_INT_En(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_TX_PRI_INT_EN_Msk)
  501. /**
  502. * @brief TX primary interrupt disable
  503. * @param __CAN__ Specifies CAN peripheral
  504. * @return None
  505. */
  506. #define __LL_CAN_TxPri_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_TX_PRI_INT_EN_Msk)
  507. /**
  508. * @brief TX secondary interrupt enable
  509. * @param __CAN__ Specifies CAN peripheral
  510. * @return None
  511. */
  512. #define __LL_CAN_TxSec_INT_En(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_TX_SEC_INT_EN_Msk)
  513. /**
  514. * @brief TX secondary interrupt disable
  515. * @param __CAN__ Specifies CAN peripheral
  516. * @return None
  517. */
  518. #define __LL_CAN_TxSec_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_TX_SEC_INT_EN_Msk)
  519. /**
  520. * @brief Error interrupt enalbe
  521. * @param __CAN__ Specifies CAN peripheral
  522. * @return None
  523. */
  524. #define __LL_CAN_Err_INT_En(__CAN__) SET_BIT((__CAN__)->RTIE, CAN_ERR_INT_EN_Msk)
  525. /**
  526. * @brief Error interrupt disalbe
  527. * @param __CAN__ Specifies CAN peripheral
  528. * @return None
  529. */
  530. #define __LL_CAN_Err_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->RTIE, CAN_ERR_INT_EN_Msk)
  531. /**
  532. * @brief Judge is TX secondary buffer full or not
  533. * @param __CAN__ Specifies CAN peripheral
  534. * @retval 0 Isn't TX secondary buffer full
  535. * @retval 1 Is TX secondary buffer full
  536. */
  537. #define __LL_CAN_IsTxSecBufFull(__CAN__) (READ_BIT((__CAN__)->RTIE, CAN_TX_SEC_BUF_FULL_Msk) >> CAN_TX_SEC_BUF_FULL_Pos)
  538. /**
  539. * @brief Interrupt status get
  540. * @param __CAN__ Specifies CAN peripheral
  541. * @return Interrupt status
  542. */
  543. #define __LL_CAN_IntSta_Get(__CAN__) READ_REG((__CAN__)->RTIF)
  544. /**
  545. * @brief Judge is error warning limit reached or not
  546. * @param __CAN__ Specifies CAN peripheral
  547. * @retval 0 Isn't error warning limit reached
  548. * @retval 1 Is error warning limit reached
  549. */
  550. #define __LL_CAN_IsErrWarnLimitReached(__CAN__) \
  551. (READ_BIT((__CAN__)ERRINT, CAN_ERR_WARN_LIMIT_REACHED_Msk) >> CAN_ERR_WARN_LIMIT_REACHED_Pos)
  552. /**
  553. * @brief Judge is error passive mode active or not
  554. * @param __CAN__ Specifies CAN peripheral
  555. * @retval 0 Error passive mode isn't active
  556. * @retval 1 Error passive mode is active
  557. */
  558. #define __LL_CAN_IsErrPassiveModeActive(__CAN__) (READ_BIT((__CAN__)->ERRINT, CAN_ERR_PASS_ACT_Msk) >> CAN_ERR_PASS_ACT_Pos)
  559. /**
  560. * @brief Error passive interrupt enable
  561. * @param __CAN__ Specifies CAN peripheral
  562. * @return None
  563. */
  564. #define __LL_CAN_ErrPassive_INT_En(__CAN__) SET_BIT((__CAN__)->ERRINT, CAN_ERR_PASS_INT_EN_Msk)
  565. /**
  566. * @brief Error passive interrupt disable
  567. * @param __CAN__ Specifies CAN peripheral
  568. * @return None
  569. */
  570. #define __LL_CAN_ErrPassive_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->ERRINT, CAN_ERR_PASS_INT_EN_Msk)
  571. /**
  572. * @brief Arbitration lost interrupt enable
  573. * @param __CAN__ Specifies CAN peripheral
  574. * @return None
  575. */
  576. #define __LL_CAN_ArbLost_INT_En(__CAN__) SET_BIT((__CAN__)->ERRINT, CAN_ARB_LOST_INT_EN_Msk)
  577. /**
  578. * @brief Arbitration lost interrupt disable
  579. * @param __CAN__ Specifies CAN peripheral
  580. * @return None
  581. */
  582. #define __LL_CAN_ArbLost_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->ERRINT, CAN_ARB_LOST_INT_EN_Msk)
  583. /**
  584. * @brief Bus error interrupt enable
  585. * @param __CAN__ Specifies CAN peripheral
  586. * @return None
  587. */
  588. #define __LL_CAN_BusErr_INT_En(__CAN__) SET_BIT((__CAN__)->ERRINT, CAN_BUS_ERR_INT_EN_Msk)
  589. /**
  590. * @brief Bus error interrupt disable
  591. * @param __CAN__ Specifies CAN peripheral
  592. * @return None
  593. */
  594. #define __LL_CAN_BusErr_INT_Dis(__CAN__) CLEAR_BIT((__CAN__)->ERRINT, CAN_BUS_ERR_INT_EN_Msk)
  595. /**
  596. * @brief Error interrupt status get
  597. * @param __CAN__ Specifies CAN peripheral
  598. * @return Error interrupt status
  599. */
  600. #define __LL_CAN_ErrIntSta_Get(__CAN__) \
  601. (READ_BIT((__CAN__)->ERRINT, (CAN_ERR_PASS_INT_STA_Msk | CAN_ARB_LOST_INT_STA_Msk | CAN_BUS_ERR_INT_STA_Msk)))
  602. /**
  603. * @brief RX buffer almost full warning limit set
  604. * @param __CAN__ Specifies CAN peripheral
  605. * @param val set value
  606. * @return None
  607. */
  608. #define __LL_CAN_RxBufAlmostFullLimit_Set(__CAN__,val) \
  609. MODIFY_REG((__CAN__)->LIMIT, CAN_RX_BUF_ALMOST_FULL_LIMIT_Msk, ((val & 0xfUL) << CAN_RX_BUF_ALMOST_FULL_LIMIT_Pos))
  610. /**
  611. * @brief Error warning limit set
  612. * @param __CAN__ Specifies CAN peripheral
  613. * @param val set value
  614. * @return None
  615. */
  616. #define __LL_CAN_ErrWarnLimit_Set(__CAN__,val) \
  617. MODIFY_REG((__CAN__)->LIMIT, CAN_ERR_WARN_LIMIT_Msk, ((val & 0xfUL) << CAN_ERR_WARN_LIMIT_Pos))
  618. /**
  619. * @brief Fast speed synchronization jump width set
  620. * @param __CAN__ Specifies CAN peripheral
  621. * @param val set value
  622. * @return None
  623. */
  624. #define __LL_CAN_FS_SyncJumpWidth_Set(__CAN__,val) \
  625. MODIFY_REG((__CAN__)->BITTIME0, CAN_FS_SYNC_JUMP_WIDTH_Msk, ((val & 0x3UL) << CAN_FS_SYNC_JUMP_WIDTH_Pos))
  626. /**
  627. * @brief Slow speed bit timing segment1 set
  628. * @param __CAN__ Specifies CAN peripheral
  629. * @param val set value
  630. * @return None
  631. */
  632. #define __LL_CAN_SS_BitTimingSeg1_Set(__CAN__,val) \
  633. MODIFY_REG((__CAN__)->BITTIME0, CAN_SS_SEG1_Msk, ((val & 0x3fUL) << CAN_SS_SEG1_Pos))
  634. /**
  635. * @brief Fast speed bit timing segment2 set
  636. * @param __CAN__ Specifies CAN peripheral
  637. * @param val set value
  638. * @return None
  639. */
  640. #define __LL_CAN_FS_BitTimingSeg2_Set(__CAN__,val) \
  641. MODIFY_REG((__CAN__)->BITTIME1, CAN_FS_SEG2_Msk, ((val & 0x7UL) << CAN_FS_SEG2_Pos))
  642. /**
  643. * @brief Slow speed bit timing segment2 set
  644. * @param __CAN__ Specifies CAN peripheral
  645. * @param val set value
  646. * @return None
  647. */
  648. #define __LL_CAN_SS_BitTimingSeg2_Set(__CAN__,val) \
  649. MODIFY_REG((__CAN__)->BITTIME1, CAN_SS_SEG2_Msk, ((val & 0x1fUL) << CAN_SS_SEG2_Pos))
  650. /**
  651. * @brief Fast speed bit timing segment1 set
  652. * @param __CAN__ Specifies CAN peripheral
  653. * @param val set value
  654. * @return None
  655. */
  656. #define __LL_CAN_FS_BitTimingSeg1_Set(__CAN__,val) \
  657. MODIFY_REG((__CAN__)->BITTIME2, CAN_FS_SEG1_Msk, ((val & 0xfUL) << CAN_FS_SEG1_Pos))
  658. /**
  659. * @brief Slow speed synchronization jump width set
  660. * @param __CAN__ Specifies CAN peripheral
  661. * @param val set value
  662. * @return None
  663. */
  664. #define __LL_CAN_SS_SyncJumpWidth_Set(__CAN__,val) \
  665. MODIFY_REG((__CAN__)->BITTIME2, CAN_SS_SYNC_JUMP_WIDTH_Msk, ((val & 0xfUL) << CAN_SS_SYNC_JUMP_WIDTH_Pos))
  666. /**
  667. * @brief Slow speed prescaler set
  668. * @param __CAN__ Specifies CAN peripheral
  669. * @param val set value
  670. * @return None
  671. */
  672. #define __LL_CAN_SS_Prescaler_Set(__CAN__,val) WRITE_REG((__CAN__)->S_PRESC, ((val) & CAN_SS_PRESCALER_Msk))
  673. /**
  674. * @brief Fast speed prescaler set
  675. * @param __CAN__ Specifies CAN peripheral
  676. * @param val set value
  677. * @return None
  678. */
  679. #define __LL_CAN_FS_Prescaler_Set(__CAN__,val) WRITE_REG((__CAN__)->F_PRESC, ((val) & CAN_FS_PRESCALER_Msk))
  680. /**
  681. * @brief TX delay compensation enable
  682. * @param __CAN__ Specifies CAN peripheral
  683. * @return None
  684. */
  685. #define __LL_CAN_TxDelayComp_En(__CAN__) SET_BIT((__CAN__)->TDC, CAN_TX_DELAY_COMP_EN_Msk)
  686. /**
  687. * @brief TX delay compensation disable
  688. * @param __CAN__ Specifies CAN peripheral
  689. * @return None
  690. */
  691. #define __LL_CAN_TxDelayComp_Dis(__CAN__) CLEAR_BIT((__CAN__)->TDC, CAN_TX_DELAY_COMP_EN_Msk)
  692. /**
  693. * @brief Secondary sample point offset set
  694. * @param __CAN__ Specifies CAN peripheral
  695. * @param val set value
  696. * @return None
  697. */
  698. #define __LL_CAN_SecSamplePointOffset_Set(__CAN__,val) \
  699. MODIFY_REG((__CAN__)->TDC, CAN_SEC_SAMPLE_POINT_OFFSET_Msk, ((val & 0x1f) << CAN_SEC_SAMPLE_POINT_OFFSET_Pos))
  700. /**
  701. * @brief Error code get
  702. * @param __CAN__ Specifies CAN peripheral
  703. * @retval 0 no error
  704. * @retval 1 bit error
  705. * @retval 2 form error
  706. * @retval 3 stuff error
  707. * @retval 4 acknowledgement error
  708. * @retval 5 CRC error
  709. * @retval 6 other error
  710. * @retval 7 not used
  711. */
  712. #define __LL_CAN_ErrCode_Get(__CAN__) (READ_BIT((__CAN__)->EALCAP, CAN_ERR_CODE_Msk) >> CAN_ERR_CODE_Pos)
  713. /**
  714. * @brief Arbitration lost capture get
  715. * @param __CAN__ Specifies CAN peripheral
  716. * @return bit position in the frame where the arbitration has been lost
  717. */
  718. #define __LL_CAN_ArbLostCapture_Get(__CAN__) (READ_BIT((__CAN__)->EALCAP, CAN_ARB_LOST_CAPTURE_Msk) >> CAN_ARB_LOST_CAPTURE_Pos)
  719. /**
  720. * @brief RX error count get
  721. * @param __CAN__ Specifies CAN peripheral
  722. * @return RX error count
  723. */
  724. #define __LL_CAN_RxErrCnt_Get(__CAN__) READ_REG((__CAN__)->RECNT)
  725. /**
  726. * @brief TX error count get
  727. * @param __CAN__ Specifies CAN peripheral
  728. * @return TX error count
  729. */
  730. #define __LL_CAN_TxErrCnt_Get(__CAN__) READ_REG((__CAN__)->TECNT)
  731. /**
  732. * @brief Acceptance filter content select mask
  733. * @param __CAN__ Specifies CAN peripheral
  734. * @return None
  735. */
  736. #define __LL_CAN_AcceptFilContentSel_Mask(__CAN__) SET_BIT((__CAN__)->ACFCTRL, CAN_ACPT_FIL_CONTENT_SEL_Msk)
  737. /**
  738. * @brief Acceptance filter content select code
  739. * @param __CAN__ Specifies CAN peripheral
  740. * @return None
  741. */
  742. #define __LL_CAN_AcceptFilContentSel_Code(__CAN__) CLEAR_BIT((__CAN__)->ACFCTRL, CAN_ACPT_FIL_CONTENT_SEL_Msk)
  743. /**
  744. * @brief Acceptance filter address set
  745. * @param __CAN__ Specifies CAN peripheral
  746. * @param val set value
  747. * @return None
  748. */
  749. #define __LL_CAN_AcceptFilAddr_Set(__CAN__, val) \
  750. MODIFY_REG((__CAN__)->ACFCTRL, CAN_ACPT_FIL_ADDR_Msk, ((val & 0xfUL) << CAN_ACPT_FIL_ADDR_Pos))
  751. /**
  752. * @brief Acceptance filter enable
  753. * @param __CAN__ Specifies CAN peripheral
  754. * @param fil_num Acceptance filter slot number
  755. * @note fil_num value range [0, 15]
  756. * @return None
  757. */
  758. #define __LL_CAN_AcceptFil_En(__CAN__, fil_num) \
  759. do { \
  760. if(fil_num < 8) { \
  761. MODIFY_REG((__CAN__)->ACF_EN_0, (0x1UL<<fil_num), (0x1UL<<fil_num)); \
  762. } else if(fil_num < 16) { \
  763. MODIFY_REG((__CAN__)->ACF_EN_1, (0x1UL<<(fil_num-8)), (0x1UL<<(fil_num-8))); \
  764. } \
  765. } while(0)
  766. /**
  767. * @brief Acceptance mask IDE bit check enable
  768. * @param __CAN__ Specifies CAN peripheral
  769. * @return None
  770. */
  771. #define __LL_CAN_AcceptFilMaskIDE_En(__CAN__) SET_BIT((__CAN__)->ACF, CAN_ACPT_MASK_IDE_CHK_EN_Msk)
  772. /**
  773. * @brief Acceptance mask IDE bit check disable
  774. * @param __CAN__ Specifies CAN peripheral
  775. * @return None
  776. */
  777. #define __LL_CAN_AcceptFilMaskIDE_Dis(__CAN__) CLEAR_BIT((__CAN__)->ACF, CAN_ACPT_MASK_IDE_CHK_EN_Msk)
  778. /**
  779. * @brief Acceptance filter accepts only extended frames
  780. * @param __CAN__ Specifies CAN peripheral
  781. * @return None
  782. */
  783. #define __LL_CAN_AcceptFilMaskIDESel_Ext(__CAN__) SET_BIT((__CAN__)->ACF, CAN_ACPT_MASK_IDE_BIT_VAL_Msk)
  784. /**
  785. * @brief Acceptance filter accepts only standard frames
  786. * @param __CAN__ Specifies CAN peripheral
  787. * @return None
  788. */
  789. #define __LL_CAN_AcceptFilMaskIDESel_Std(__CAN__) CLEAR_BIT((__CAN__)->ACF, CAN_ACPT_MASK_IDE_BIT_VAL_Msk)
  790. /**
  791. * @brief Acceptance filter code or mask set
  792. * @param __CAN__ Specifies CAN peripheral
  793. * @param val set value
  794. * @return None
  795. */
  796. #define __LL_CAN_AcceptFilCodeOrMaskVal_Set(__CAN__, val) \
  797. MODIFY_REG((__CAN__)->ACF, CAN_ACPT_CODE_OR_MASK_Msk, ((val & 0x1fffffffUL) << CAN_ACPT_CODE_OR_MASK_Pos))
  798. /**
  799. * @brief CAN frame ID format to 11 bits
  800. */
  801. #define __LL_CAN_FrameIDFormat_11Bits(n) ((n) & 0x7FFUL)
  802. /**
  803. * @brief CAN frame ID format to 29 bits
  804. */
  805. #define __LL_CAN_FrameIDFormat_29Bits(n) ((n) & 0x1FFFFFFFUL)
  806. /**
  807. * @}
  808. */
  809. /* Exported functions --------------------------------------------------------*/
  810. /** @addtogroup CAN_LL_Exported_Functions
  811. * @{
  812. */
  813. /** @addtogroup CAN_LL_Exported_Functions_Group1
  814. * @{
  815. */
  816. LL_StatusETypeDef LL_CAN_Init(CAN_TypeDef *Instance, CAN_UserCfgTypeDef *user_cfg);
  817. LL_StatusETypeDef LL_CAN_DeInit(CAN_TypeDef *Instance);
  818. void LL_CAN_MspInit(CAN_TypeDef *Instance);
  819. void LL_CAN_MspDeInit(CAN_TypeDef *Instance);
  820. /**
  821. * @}
  822. */
  823. /** @addtogroup CAN_LL_Exported_Functions_Group2
  824. * @{
  825. */
  826. uint32_t LL_CAN_SendStandard_PTB(CAN_TypeDef *Instance, CAN_TxBufFormatTypeDef *buf_fmt, uint32_t *buf);
  827. uint32_t LL_CAN_SendStandard_STB(CAN_TypeDef *Instance, CAN_TxBufFormatTypeDef *buf_fmt, uint32_t *buf);
  828. uint32_t LL_CAN_SendStandard_STB_Multi(CAN_TypeDef *Instance, CAN_TxBufFormatTypeDef *buf_fmt,
  829. uint32_t *buf, uint32_t send_cnt);
  830. /**
  831. * @}
  832. */
  833. /** @addtogroup CAN_LL_Exported_Functions_Interrupt
  834. * @{
  835. */
  836. void LL_CAN_IRQHandler(CAN_TypeDef *Instance);
  837. void LL_CAN_RxCallback(CAN_TypeDef *Instance);
  838. void LL_CAN_RxOverCallback(CAN_TypeDef *Instance);
  839. void LL_CAN_RxFullCallback(CAN_TypeDef *Instance);
  840. void LL_CAN_RxAlmostFullCallback(CAN_TypeDef *Instance);
  841. void LL_CAN_TxPriCallback(CAN_TypeDef *Instance);
  842. void LL_CAN_TxSecCallback(CAN_TypeDef *Instance);
  843. void LL_CAN_ErrCallback(CAN_TypeDef *Instance);
  844. void LL_CAN_AbortCallback(CAN_TypeDef *Instance);
  845. void LL_CAN_ErrPassiveCallback(CAN_TypeDef *Instance);
  846. void LL_CAN_ArbLostCallback(CAN_TypeDef *Instance);
  847. void LL_CAN_BusErrCallback(CAN_TypeDef *Instance);
  848. /**
  849. * @}
  850. */
  851. /**
  852. * @}
  853. */
  854. /* Private constants ---------------------------------------------------------*/
  855. /* Private variables ---------------------------------------------------------*/
  856. /* Private types -------------------------------------------------------------*/
  857. /* Private macros ------------------------------------------------------------*/
  858. /* Private functions ---------------------------------------------------------*/
  859. /**
  860. * @}
  861. */
  862. /**
  863. * @}
  864. */
  865. #ifdef __cplusplus
  866. }
  867. #endif /* __cplusplus */
  868. #endif /* _TAE32F53XX_LL_CAN_H_ */
  869. /************************* (C) COPYRIGHT Tai-Action *****END OF FILE***********/