stm32g0xx_hal_fdcan.h 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  1. /**
  2. ******************************************************************************
  3. * @file stm32g0xx_hal_fdcan.h
  4. * @author MCD Application Team
  5. * @brief Header file of FDCAN HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2018 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32G0xx_HAL_FDCAN_H
  20. #define STM32G0xx_HAL_FDCAN_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32g0xx_hal_def.h"
  26. #if defined(FDCAN1)
  27. /** @addtogroup STM32G0xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup FDCAN
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /** @defgroup FDCAN_Exported_Types FDCAN Exported Types
  35. * @{
  36. */
  37. /**
  38. * @brief HAL State structures definition
  39. */
  40. typedef enum
  41. {
  42. HAL_FDCAN_STATE_RESET = 0x00U, /*!< FDCAN not yet initialized or disabled */
  43. HAL_FDCAN_STATE_READY = 0x01U, /*!< FDCAN initialized and ready for use */
  44. HAL_FDCAN_STATE_BUSY = 0x02U, /*!< FDCAN process is ongoing */
  45. HAL_FDCAN_STATE_ERROR = 0x03U /*!< FDCAN error state */
  46. } HAL_FDCAN_StateTypeDef;
  47. /**
  48. * @brief FDCAN Init structure definition
  49. */
  50. typedef struct
  51. {
  52. uint32_t ClockDivider; /*!< Specifies the FDCAN kernel clock divider.
  53. The clock is common to all FDCAN instances.
  54. This parameter is applied only at initialisation of
  55. first FDCAN instance.
  56. This parameter can be a value of @ref FDCAN_clock_divider. */
  57. uint32_t FrameFormat; /*!< Specifies the FDCAN frame format.
  58. This parameter can be a value of @ref FDCAN_frame_format */
  59. uint32_t Mode; /*!< Specifies the FDCAN mode.
  60. This parameter can be a value of @ref FDCAN_operating_mode */
  61. FunctionalState AutoRetransmission; /*!< Enable or disable the automatic retransmission mode.
  62. This parameter can be set to ENABLE or DISABLE */
  63. FunctionalState TransmitPause; /*!< Enable or disable the Transmit Pause feature.
  64. This parameter can be set to ENABLE or DISABLE */
  65. FunctionalState ProtocolException; /*!< Enable or disable the Protocol Exception Handling.
  66. This parameter can be set to ENABLE or DISABLE */
  67. uint32_t NominalPrescaler; /*!< Specifies the value by which the oscillator frequency is
  68. divided for generating the nominal bit time quanta.
  69. This parameter must be a number between 1 and 512 */
  70. uint32_t NominalSyncJumpWidth; /*!< Specifies the maximum number of time quanta the FDCAN
  71. hardware is allowed to lengthen or shorten a bit to perform
  72. resynchronization.
  73. This parameter must be a number between 1 and 128 */
  74. uint32_t NominalTimeSeg1; /*!< Specifies the number of time quanta in Bit Segment 1.
  75. This parameter must be a number between 2 and 256 */
  76. uint32_t NominalTimeSeg2; /*!< Specifies the number of time quanta in Bit Segment 2.
  77. This parameter must be a number between 2 and 128 */
  78. uint32_t DataPrescaler; /*!< Specifies the value by which the oscillator frequency is
  79. divided for generating the data bit time quanta.
  80. This parameter must be a number between 1 and 32 */
  81. uint32_t DataSyncJumpWidth; /*!< Specifies the maximum number of time quanta the FDCAN
  82. hardware is allowed to lengthen or shorten a data bit to
  83. perform resynchronization.
  84. This parameter must be a number between 1 and 16 */
  85. uint32_t DataTimeSeg1; /*!< Specifies the number of time quanta in Data Bit Segment 1.
  86. This parameter must be a number between 1 and 32 */
  87. uint32_t DataTimeSeg2; /*!< Specifies the number of time quanta in Data Bit Segment 2.
  88. This parameter must be a number between 1 and 16 */
  89. uint32_t StdFiltersNbr; /*!< Specifies the number of standard Message ID filters.
  90. This parameter must be a number between 0 and 28 */
  91. uint32_t ExtFiltersNbr; /*!< Specifies the number of extended Message ID filters.
  92. This parameter must be a number between 0 and 8 */
  93. uint32_t TxFifoQueueMode; /*!< Tx FIFO/Queue Mode selection.
  94. This parameter can be a value of @ref FDCAN_txFifoQueue_Mode */
  95. } FDCAN_InitTypeDef;
  96. /**
  97. * @brief FDCAN filter structure definition
  98. */
  99. typedef struct
  100. {
  101. uint32_t IdType; /*!< Specifies the identifier type.
  102. This parameter can be a value of @ref FDCAN_id_type */
  103. uint32_t FilterIndex; /*!< Specifies the filter which will be initialized.
  104. This parameter must be a number between:
  105. - 0 and (SRAMCAN_FLS_NBR-1), if IdType is FDCAN_STANDARD_ID
  106. - 0 and (SRAMCAN_FLE_NBR-1), if IdType is FDCAN_EXTENDED_ID */
  107. uint32_t FilterType; /*!< Specifies the filter type.
  108. This parameter can be a value of @ref FDCAN_filter_type.
  109. The value FDCAN_FILTER_RANGE_NO_EIDM is permitted
  110. only when IdType is FDCAN_EXTENDED_ID. */
  111. uint32_t FilterConfig; /*!< Specifies the filter configuration.
  112. This parameter can be a value of @ref FDCAN_filter_config */
  113. uint32_t FilterID1; /*!< Specifies the filter identification 1.
  114. This parameter must be a number between:
  115. - 0 and 0x7FF, if IdType is FDCAN_STANDARD_ID
  116. - 0 and 0x1FFFFFFF, if IdType is FDCAN_EXTENDED_ID */
  117. uint32_t FilterID2; /*!< Specifies the filter identification 2.
  118. This parameter must be a number between:
  119. - 0 and 0x7FF, if IdType is FDCAN_STANDARD_ID
  120. - 0 and 0x1FFFFFFF, if IdType is FDCAN_EXTENDED_ID */
  121. } FDCAN_FilterTypeDef;
  122. /**
  123. * @brief FDCAN Tx header structure definition
  124. */
  125. typedef struct
  126. {
  127. uint32_t Identifier; /*!< Specifies the identifier.
  128. This parameter must be a number between:
  129. - 0 and 0x7FF, if IdType is FDCAN_STANDARD_ID
  130. - 0 and 0x1FFFFFFF, if IdType is FDCAN_EXTENDED_ID */
  131. uint32_t IdType; /*!< Specifies the identifier type for the message that will be
  132. transmitted.
  133. This parameter can be a value of @ref FDCAN_id_type */
  134. uint32_t TxFrameType; /*!< Specifies the frame type of the message that will be transmitted.
  135. This parameter can be a value of @ref FDCAN_frame_type */
  136. uint32_t DataLength; /*!< Specifies the length of the frame that will be transmitted.
  137. This parameter can be a value of @ref FDCAN_data_length_code */
  138. uint32_t ErrorStateIndicator; /*!< Specifies the error state indicator.
  139. This parameter can be a value of @ref FDCAN_error_state_indicator */
  140. uint32_t BitRateSwitch; /*!< Specifies whether the Tx frame will be transmitted with or without
  141. bit rate switching.
  142. This parameter can be a value of @ref FDCAN_bit_rate_switching */
  143. uint32_t FDFormat; /*!< Specifies whether the Tx frame will be transmitted in classic or
  144. FD format.
  145. This parameter can be a value of @ref FDCAN_format */
  146. uint32_t TxEventFifoControl; /*!< Specifies the event FIFO control.
  147. This parameter can be a value of @ref FDCAN_EFC */
  148. uint32_t MessageMarker; /*!< Specifies the message marker to be copied into Tx Event FIFO
  149. element for identification of Tx message status.
  150. This parameter must be a number between 0 and 0xFF */
  151. } FDCAN_TxHeaderTypeDef;
  152. /**
  153. * @brief FDCAN Rx header structure definition
  154. */
  155. typedef struct
  156. {
  157. uint32_t Identifier; /*!< Specifies the identifier.
  158. This parameter must be a number between:
  159. - 0 and 0x7FF, if IdType is FDCAN_STANDARD_ID
  160. - 0 and 0x1FFFFFFF, if IdType is FDCAN_EXTENDED_ID */
  161. uint32_t IdType; /*!< Specifies the identifier type of the received message.
  162. This parameter can be a value of @ref FDCAN_id_type */
  163. uint32_t RxFrameType; /*!< Specifies the the received message frame type.
  164. This parameter can be a value of @ref FDCAN_frame_type */
  165. uint32_t DataLength; /*!< Specifies the received frame length.
  166. This parameter can be a value of @ref FDCAN_data_length_code */
  167. uint32_t ErrorStateIndicator; /*!< Specifies the error state indicator.
  168. This parameter can be a value of @ref FDCAN_error_state_indicator */
  169. uint32_t BitRateSwitch; /*!< Specifies whether the Rx frame is received with or without bit
  170. rate switching.
  171. This parameter can be a value of @ref FDCAN_bit_rate_switching */
  172. uint32_t FDFormat; /*!< Specifies whether the Rx frame is received in classic or FD
  173. format.
  174. This parameter can be a value of @ref FDCAN_format */
  175. uint32_t RxTimestamp; /*!< Specifies the timestamp counter value captured on start of frame
  176. reception.
  177. This parameter must be a number between 0 and 0xFFFF */
  178. uint32_t FilterIndex; /*!< Specifies the index of matching Rx acceptance filter element.
  179. This parameter must be a number between:
  180. - 0 and (SRAMCAN_FLS_NBR-1), if IdType is FDCAN_STANDARD_ID
  181. - 0 and (SRAMCAN_FLE_NBR-1), if IdType is FDCAN_EXTENDED_ID
  182. When the frame is a Non-Filter matching frame, this parameter
  183. is unused. */
  184. uint32_t IsFilterMatchingFrame; /*!< Specifies whether the accepted frame did not match any Rx filter.
  185. Acceptance of non-matching frames may be enabled via
  186. HAL_FDCAN_ConfigGlobalFilter().
  187. This parameter takes 0 if the frame matched an Rx filter or
  188. 1 if it did not match any Rx filter */
  189. } FDCAN_RxHeaderTypeDef;
  190. /**
  191. * @brief FDCAN Tx event FIFO structure definition
  192. */
  193. typedef struct
  194. {
  195. uint32_t Identifier; /*!< Specifies the identifier.
  196. This parameter must be a number between:
  197. - 0 and 0x7FF, if IdType is FDCAN_STANDARD_ID
  198. - 0 and 0x1FFFFFFF, if IdType is FDCAN_EXTENDED_ID */
  199. uint32_t IdType; /*!< Specifies the identifier type for the transmitted message.
  200. This parameter can be a value of @ref FDCAN_id_type */
  201. uint32_t TxFrameType; /*!< Specifies the frame type of the transmitted message.
  202. This parameter can be a value of @ref FDCAN_frame_type */
  203. uint32_t DataLength; /*!< Specifies the length of the transmitted frame.
  204. This parameter can be a value of @ref FDCAN_data_length_code */
  205. uint32_t ErrorStateIndicator; /*!< Specifies the error state indicator.
  206. This parameter can be a value of @ref FDCAN_error_state_indicator */
  207. uint32_t BitRateSwitch; /*!< Specifies whether the Tx frame is transmitted with or without bit
  208. rate switching.
  209. This parameter can be a value of @ref FDCAN_bit_rate_switching */
  210. uint32_t FDFormat; /*!< Specifies whether the Tx frame is transmitted in classic or FD
  211. format.
  212. This parameter can be a value of @ref FDCAN_format */
  213. uint32_t TxTimestamp; /*!< Specifies the timestamp counter value captured on start of frame
  214. transmission.
  215. This parameter must be a number between 0 and 0xFFFF */
  216. uint32_t MessageMarker; /*!< Specifies the message marker copied into Tx Event FIFO element
  217. for identification of Tx message status.
  218. This parameter must be a number between 0 and 0xFF */
  219. uint32_t EventType; /*!< Specifies the event type.
  220. This parameter can be a value of @ref FDCAN_event_type */
  221. } FDCAN_TxEventFifoTypeDef;
  222. /**
  223. * @brief FDCAN High Priority Message Status structure definition
  224. */
  225. typedef struct
  226. {
  227. uint32_t FilterList; /*!< Specifies the filter list of the matching filter element.
  228. This parameter can be:
  229. - 0 : Standard Filter List
  230. - 1 : Extended Filter List */
  231. uint32_t FilterIndex; /*!< Specifies the index of matching filter element.
  232. This parameter can be a number between:
  233. - 0 and (SRAMCAN_FLS_NBR-1), if FilterList is 0 (Standard)
  234. - 0 and (SRAMCAN_FLE_NBR-1), if FilterList is 1 (Extended) */
  235. uint32_t MessageStorage; /*!< Specifies the HP Message Storage.
  236. This parameter can be a value of @ref FDCAN_hp_msg_storage */
  237. uint32_t MessageIndex; /*!< Specifies the Index of Rx FIFO element to which the
  238. message was stored.
  239. This parameter is valid only when MessageStorage is:
  240. FDCAN_HP_STORAGE_RXFIFO0
  241. or
  242. FDCAN_HP_STORAGE_RXFIFO1 */
  243. } FDCAN_HpMsgStatusTypeDef;
  244. /**
  245. * @brief FDCAN Protocol Status structure definition
  246. */
  247. typedef struct
  248. {
  249. uint32_t LastErrorCode; /*!< Specifies the type of the last error that occurred on the FDCAN bus.
  250. This parameter can be a value of @ref FDCAN_protocol_error_code */
  251. uint32_t DataLastErrorCode; /*!< Specifies the type of the last error that occurred in the data phase
  252. of a CAN FD format frame with its BRS flag set.
  253. This parameter can be a value of @ref FDCAN_protocol_error_code */
  254. uint32_t Activity; /*!< Specifies the FDCAN module communication state.
  255. This parameter can be a value of @ref FDCAN_communication_state */
  256. uint32_t ErrorPassive; /*!< Specifies the FDCAN module error status.
  257. This parameter can be:
  258. - 0 : The FDCAN is in Error_Active state
  259. - 1 : The FDCAN is in Error_Passive state */
  260. uint32_t Warning; /*!< Specifies the FDCAN module warning status.
  261. This parameter can be:
  262. - 0 : error counters (RxErrorCnt and TxErrorCnt) are below the
  263. Error_Warning limit of 96
  264. - 1 : at least one of error counters has reached the Error_Warning
  265. limit of 96 */
  266. uint32_t BusOff; /*!< Specifies the FDCAN module Bus_Off status.
  267. This parameter can be:
  268. - 0 : The FDCAN is not in Bus_Off state
  269. - 1 : The FDCAN is in Bus_Off state */
  270. uint32_t RxESIflag; /*!< Specifies ESI flag of last received CAN FD message.
  271. This parameter can be:
  272. - 0 : Last received CAN FD message did not have its ESI flag set
  273. - 1 : Last received CAN FD message had its ESI flag set */
  274. uint32_t RxBRSflag; /*!< Specifies BRS flag of last received CAN FD message.
  275. This parameter can be:
  276. - 0 : Last received CAN FD message did not have its BRS flag set
  277. - 1 : Last received CAN FD message had its BRS flag set */
  278. uint32_t RxFDFflag; /*!< Specifies if CAN FD message (FDF flag set) has been received
  279. since last protocol status.
  280. This parameter can be:
  281. - 0 : No CAN FD message received
  282. - 1 : CAN FD message received */
  283. uint32_t ProtocolException; /*!< Specifies the FDCAN module Protocol Exception status.
  284. This parameter can be:
  285. - 0 : No protocol exception event occurred since last read access
  286. - 1 : Protocol exception event occurred */
  287. uint32_t TDCvalue; /*!< Specifies the Transmitter Delay Compensation Value.
  288. This parameter can be a number between 0 and 127 */
  289. } FDCAN_ProtocolStatusTypeDef;
  290. /**
  291. * @brief FDCAN Error Counters structure definition
  292. */
  293. typedef struct
  294. {
  295. uint32_t TxErrorCnt; /*!< Specifies the Transmit Error Counter Value.
  296. This parameter can be a number between 0 and 255 */
  297. uint32_t RxErrorCnt; /*!< Specifies the Receive Error Counter Value.
  298. This parameter can be a number between 0 and 127 */
  299. uint32_t RxErrorPassive; /*!< Specifies the Receive Error Passive status.
  300. This parameter can be:
  301. - 0 : The Receive Error Counter (RxErrorCnt) is below the error
  302. passive level of 128
  303. - 1 : The Receive Error Counter (RxErrorCnt) has reached the error
  304. passive level of 128 */
  305. uint32_t ErrorLogging; /*!< Specifies the Transmit/Receive error logging counter value.
  306. This parameter can be a number between 0 and 255.
  307. This counter is incremented each time when a FDCAN protocol error causes
  308. the TxErrorCnt or the RxErrorCnt to be incremented. The counter stops at 255;
  309. the next increment of TxErrorCnt or RxErrorCnt sets interrupt flag
  310. FDCAN_FLAG_ERROR_LOGGING_OVERFLOW */
  311. } FDCAN_ErrorCountersTypeDef;
  312. /**
  313. * @brief FDCAN Message RAM blocks
  314. */
  315. typedef struct
  316. {
  317. uint32_t StandardFilterSA; /*!< Specifies the Standard Filter List Start Address.
  318. This parameter must be a 32-bit word address */
  319. uint32_t ExtendedFilterSA; /*!< Specifies the Extended Filter List Start Address.
  320. This parameter must be a 32-bit word address */
  321. uint32_t RxFIFO0SA; /*!< Specifies the Rx FIFO 0 Start Address.
  322. This parameter must be a 32-bit word address */
  323. uint32_t RxFIFO1SA; /*!< Specifies the Rx FIFO 1 Start Address.
  324. This parameter must be a 32-bit word address */
  325. uint32_t TxEventFIFOSA; /*!< Specifies the Tx Event FIFO Start Address.
  326. This parameter must be a 32-bit word address */
  327. uint32_t TxFIFOQSA; /*!< Specifies the Tx FIFO/Queue Start Address.
  328. This parameter must be a 32-bit word address */
  329. } FDCAN_MsgRamAddressTypeDef;
  330. /**
  331. * @brief FDCAN handle structure definition
  332. */
  333. #if USE_HAL_FDCAN_REGISTER_CALLBACKS == 1
  334. typedef struct __FDCAN_HandleTypeDef
  335. #else
  336. typedef struct
  337. #endif /* USE_HAL_FDCAN_REGISTER_CALLBACKS */
  338. {
  339. FDCAN_GlobalTypeDef *Instance; /*!< Register base address */
  340. FDCAN_InitTypeDef Init; /*!< FDCAN required parameters */
  341. FDCAN_MsgRamAddressTypeDef msgRam; /*!< FDCAN Message RAM blocks */
  342. uint32_t LatestTxFifoQRequest; /*!< FDCAN Tx buffer index
  343. of latest Tx FIFO/Queue request */
  344. __IO HAL_FDCAN_StateTypeDef State; /*!< FDCAN communication state */
  345. HAL_LockTypeDef Lock; /*!< FDCAN locking object */
  346. __IO uint32_t ErrorCode; /*!< FDCAN Error code */
  347. #if USE_HAL_FDCAN_REGISTER_CALLBACKS == 1
  348. void (* TxEventFifoCallback)(struct __FDCAN_HandleTypeDef *hfdcan, uint32_t TxEventFifoITs); /*!< FDCAN Tx Event Fifo callback */
  349. void (* RxFifo0Callback)(struct __FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs); /*!< FDCAN Rx Fifo 0 callback */
  350. void (* RxFifo1Callback)(struct __FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo1ITs); /*!< FDCAN Rx Fifo 1 callback */
  351. void (* TxFifoEmptyCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN Tx Fifo Empty callback */
  352. void (* TxBufferCompleteCallback)(struct __FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes); /*!< FDCAN Tx Buffer complete callback */
  353. void (* TxBufferAbortCallback)(struct __FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes); /*!< FDCAN Tx Buffer abort callback */
  354. void (* HighPriorityMessageCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN High priority message callback */
  355. void (* TimestampWraparoundCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN Timestamp wraparound callback */
  356. void (* TimeoutOccurredCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN Timeout occurred callback */
  357. void (* ErrorCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN Error callback */
  358. void (* ErrorStatusCallback)(struct __FDCAN_HandleTypeDef *hfdcan, uint32_t ErrorStatusITs); /*!< FDCAN Error status callback */
  359. void (* MspInitCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN Msp Init callback */
  360. void (* MspDeInitCallback)(struct __FDCAN_HandleTypeDef *hfdcan); /*!< FDCAN Msp DeInit callback */
  361. #endif /* USE_HAL_FDCAN_REGISTER_CALLBACKS */
  362. } FDCAN_HandleTypeDef;
  363. #if USE_HAL_FDCAN_REGISTER_CALLBACKS == 1
  364. /**
  365. * @brief HAL FDCAN common Callback ID enumeration definition
  366. */
  367. typedef enum
  368. {
  369. HAL_FDCAN_TX_FIFO_EMPTY_CB_ID = 0x00U, /*!< FDCAN Tx Fifo Empty callback ID */
  370. HAL_FDCAN_HIGH_PRIO_MESSAGE_CB_ID = 0x01U, /*!< FDCAN High priority message callback ID */
  371. HAL_FDCAN_TIMESTAMP_WRAPAROUND_CB_ID = 0x02U, /*!< FDCAN Timestamp wraparound callback ID */
  372. HAL_FDCAN_TIMEOUT_OCCURRED_CB_ID = 0x03U, /*!< FDCAN Timeout occurred callback ID */
  373. HAL_FDCAN_ERROR_CALLBACK_CB_ID = 0x04U, /*!< FDCAN Error callback ID */
  374. HAL_FDCAN_MSPINIT_CB_ID = 0x05U, /*!< FDCAN MspInit callback ID */
  375. HAL_FDCAN_MSPDEINIT_CB_ID = 0x06U, /*!< FDCAN MspDeInit callback ID */
  376. } HAL_FDCAN_CallbackIDTypeDef;
  377. /**
  378. * @brief HAL FDCAN Callback pointer definition
  379. */
  380. typedef void (*pFDCAN_CallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan); /*!< pointer to a common FDCAN callback function */
  381. typedef void (*pFDCAN_TxEventFifoCallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan, uint32_t TxEventFifoITs); /*!< pointer to Tx event Fifo FDCAN callback function */
  382. typedef void (*pFDCAN_RxFifo0CallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs); /*!< pointer to Rx Fifo 0 FDCAN callback function */
  383. typedef void (*pFDCAN_RxFifo1CallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo1ITs); /*!< pointer to Rx Fifo 1 FDCAN callback function */
  384. typedef void (*pFDCAN_TxBufferCompleteCallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes); /*!< pointer to Tx Buffer complete FDCAN callback function */
  385. typedef void (*pFDCAN_TxBufferAbortCallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes); /*!< pointer to Tx Buffer abort FDCAN callback function */
  386. typedef void (*pFDCAN_ErrorStatusCallbackTypeDef)(FDCAN_HandleTypeDef *hfdcan, uint32_t ErrorStatusITs); /*!< pointer to Error Status callback function */
  387. #endif /* USE_HAL_FDCAN_REGISTER_CALLBACKS */
  388. /**
  389. * @}
  390. */
  391. /* Exported constants --------------------------------------------------------*/
  392. /** @defgroup FDCAN_Exported_Constants FDCAN Exported Constants
  393. * @{
  394. */
  395. /** @defgroup HAL_FDCAN_Error_Code HAL FDCAN Error Code
  396. * @{
  397. */
  398. #define HAL_FDCAN_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
  399. #define HAL_FDCAN_ERROR_TIMEOUT ((uint32_t)0x00000001U) /*!< Timeout error */
  400. #define HAL_FDCAN_ERROR_NOT_INITIALIZED ((uint32_t)0x00000002U) /*!< Peripheral not initialized */
  401. #define HAL_FDCAN_ERROR_NOT_READY ((uint32_t)0x00000004U) /*!< Peripheral not ready */
  402. #define HAL_FDCAN_ERROR_NOT_STARTED ((uint32_t)0x00000008U) /*!< Peripheral not started */
  403. #define HAL_FDCAN_ERROR_NOT_SUPPORTED ((uint32_t)0x00000010U) /*!< Mode not supported */
  404. #define HAL_FDCAN_ERROR_PARAM ((uint32_t)0x00000020U) /*!< Parameter error */
  405. #define HAL_FDCAN_ERROR_PENDING ((uint32_t)0x00000040U) /*!< Pending operation */
  406. #define HAL_FDCAN_ERROR_RAM_ACCESS ((uint32_t)0x00000080U) /*!< Message RAM Access Failure */
  407. #define HAL_FDCAN_ERROR_FIFO_EMPTY ((uint32_t)0x00000100U) /*!< Put element in full FIFO */
  408. #define HAL_FDCAN_ERROR_FIFO_FULL ((uint32_t)0x00000200U) /*!< Get element from empty FIFO */
  409. #define HAL_FDCAN_ERROR_LOG_OVERFLOW FDCAN_IR_ELO /*!< Overflow of CAN Error Logging Counter */
  410. #define HAL_FDCAN_ERROR_RAM_WDG FDCAN_IR_WDI /*!< Message RAM Watchdog event occurred */
  411. #define HAL_FDCAN_ERROR_PROTOCOL_ARBT FDCAN_IR_PEA /*!< Protocol Error in Arbitration Phase (Nominal Bit Time is used) */
  412. #define HAL_FDCAN_ERROR_PROTOCOL_DATA FDCAN_IR_PED /*!< Protocol Error in Data Phase (Data Bit Time is used) */
  413. #define HAL_FDCAN_ERROR_RESERVED_AREA FDCAN_IR_ARA /*!< Access to Reserved Address */
  414. #if USE_HAL_FDCAN_REGISTER_CALLBACKS == 1
  415. #define HAL_FDCAN_ERROR_INVALID_CALLBACK ((uint32_t)0x00000100U) /*!< Invalid Callback error */
  416. #endif /* USE_HAL_FDCAN_REGISTER_CALLBACKS */
  417. /**
  418. * @}
  419. */
  420. /** @defgroup FDCAN_frame_format FDCAN Frame Format
  421. * @{
  422. */
  423. #define FDCAN_FRAME_CLASSIC ((uint32_t)0x00000000U) /*!< Classic mode */
  424. #define FDCAN_FRAME_FD_NO_BRS ((uint32_t)FDCAN_CCCR_FDOE) /*!< FD mode without BitRate Switching */
  425. #define FDCAN_FRAME_FD_BRS ((uint32_t)(FDCAN_CCCR_FDOE | FDCAN_CCCR_BRSE)) /*!< FD mode with BitRate Switching */
  426. /**
  427. * @}
  428. */
  429. /** @defgroup FDCAN_operating_mode FDCAN Operating Mode
  430. * @{
  431. */
  432. #define FDCAN_MODE_NORMAL ((uint32_t)0x00000000U) /*!< Normal mode */
  433. #define FDCAN_MODE_RESTRICTED_OPERATION ((uint32_t)0x00000001U) /*!< Restricted Operation mode */
  434. #define FDCAN_MODE_BUS_MONITORING ((uint32_t)0x00000002U) /*!< Bus Monitoring mode */
  435. #define FDCAN_MODE_INTERNAL_LOOPBACK ((uint32_t)0x00000003U) /*!< Internal LoopBack mode */
  436. #define FDCAN_MODE_EXTERNAL_LOOPBACK ((uint32_t)0x00000004U) /*!< External LoopBack mode */
  437. /**
  438. * @}
  439. */
  440. /** @defgroup FDCAN_clock_divider FDCAN Clock Divider
  441. * @{
  442. */
  443. #define FDCAN_CLOCK_DIV1 ((uint32_t)0x00000000U) /*!< Divide kernel clock by 1 */
  444. #define FDCAN_CLOCK_DIV2 ((uint32_t)0x00000001U) /*!< Divide kernel clock by 2 */
  445. #define FDCAN_CLOCK_DIV4 ((uint32_t)0x00000002U) /*!< Divide kernel clock by 4 */
  446. #define FDCAN_CLOCK_DIV6 ((uint32_t)0x00000003U) /*!< Divide kernel clock by 6 */
  447. #define FDCAN_CLOCK_DIV8 ((uint32_t)0x00000004U) /*!< Divide kernel clock by 8 */
  448. #define FDCAN_CLOCK_DIV10 ((uint32_t)0x00000005U) /*!< Divide kernel clock by 10 */
  449. #define FDCAN_CLOCK_DIV12 ((uint32_t)0x00000006U) /*!< Divide kernel clock by 12 */
  450. #define FDCAN_CLOCK_DIV14 ((uint32_t)0x00000007U) /*!< Divide kernel clock by 14 */
  451. #define FDCAN_CLOCK_DIV16 ((uint32_t)0x00000008U) /*!< Divide kernel clock by 16 */
  452. #define FDCAN_CLOCK_DIV18 ((uint32_t)0x00000009U) /*!< Divide kernel clock by 18 */
  453. #define FDCAN_CLOCK_DIV20 ((uint32_t)0x0000000AU) /*!< Divide kernel clock by 20 */
  454. #define FDCAN_CLOCK_DIV22 ((uint32_t)0x0000000BU) /*!< Divide kernel clock by 22 */
  455. #define FDCAN_CLOCK_DIV24 ((uint32_t)0x0000000CU) /*!< Divide kernel clock by 24 */
  456. #define FDCAN_CLOCK_DIV26 ((uint32_t)0x0000000DU) /*!< Divide kernel clock by 26 */
  457. #define FDCAN_CLOCK_DIV28 ((uint32_t)0x0000000EU) /*!< Divide kernel clock by 28 */
  458. #define FDCAN_CLOCK_DIV30 ((uint32_t)0x0000000FU) /*!< Divide kernel clock by 30 */
  459. /**
  460. * @}
  461. */
  462. /** @defgroup FDCAN_txFifoQueue_Mode FDCAN Tx FIFO/Queue Mode
  463. * @{
  464. */
  465. #define FDCAN_TX_FIFO_OPERATION ((uint32_t)0x00000000U) /*!< FIFO mode */
  466. #define FDCAN_TX_QUEUE_OPERATION ((uint32_t)FDCAN_TXBC_TFQM) /*!< Queue mode */
  467. /**
  468. * @}
  469. */
  470. /** @defgroup FDCAN_id_type FDCAN ID Type
  471. * @{
  472. */
  473. #define FDCAN_STANDARD_ID ((uint32_t)0x00000000U) /*!< Standard ID element */
  474. #define FDCAN_EXTENDED_ID ((uint32_t)0x40000000U) /*!< Extended ID element */
  475. /**
  476. * @}
  477. */
  478. /** @defgroup FDCAN_frame_type FDCAN Frame Type
  479. * @{
  480. */
  481. #define FDCAN_DATA_FRAME ((uint32_t)0x00000000U) /*!< Data frame */
  482. #define FDCAN_REMOTE_FRAME ((uint32_t)0x20000000U) /*!< Remote frame */
  483. /**
  484. * @}
  485. */
  486. /** @defgroup FDCAN_data_length_code FDCAN Data Length Code
  487. * @{
  488. */
  489. #define FDCAN_DLC_BYTES_0 ((uint32_t)0x00000000U) /*!< 0 bytes data field */
  490. #define FDCAN_DLC_BYTES_1 ((uint32_t)0x00000001U) /*!< 1 bytes data field */
  491. #define FDCAN_DLC_BYTES_2 ((uint32_t)0x00000002U) /*!< 2 bytes data field */
  492. #define FDCAN_DLC_BYTES_3 ((uint32_t)0x00000003U) /*!< 3 bytes data field */
  493. #define FDCAN_DLC_BYTES_4 ((uint32_t)0x00000004U) /*!< 4 bytes data field */
  494. #define FDCAN_DLC_BYTES_5 ((uint32_t)0x00000005U) /*!< 5 bytes data field */
  495. #define FDCAN_DLC_BYTES_6 ((uint32_t)0x00000006U) /*!< 6 bytes data field */
  496. #define FDCAN_DLC_BYTES_7 ((uint32_t)0x00000007U) /*!< 7 bytes data field */
  497. #define FDCAN_DLC_BYTES_8 ((uint32_t)0x00000008U) /*!< 8 bytes data field */
  498. #define FDCAN_DLC_BYTES_12 ((uint32_t)0x00000009U) /*!< 12 bytes data field */
  499. #define FDCAN_DLC_BYTES_16 ((uint32_t)0x0000000AU) /*!< 16 bytes data field */
  500. #define FDCAN_DLC_BYTES_20 ((uint32_t)0x0000000BU) /*!< 20 bytes data field */
  501. #define FDCAN_DLC_BYTES_24 ((uint32_t)0x0000000CU) /*!< 24 bytes data field */
  502. #define FDCAN_DLC_BYTES_32 ((uint32_t)0x0000000DU) /*!< 32 bytes data field */
  503. #define FDCAN_DLC_BYTES_48 ((uint32_t)0x0000000EU) /*!< 48 bytes data field */
  504. #define FDCAN_DLC_BYTES_64 ((uint32_t)0x0000000FU) /*!< 64 bytes data field */
  505. /**
  506. * @}
  507. */
  508. /** @defgroup FDCAN_error_state_indicator FDCAN Error State Indicator
  509. * @{
  510. */
  511. #define FDCAN_ESI_ACTIVE ((uint32_t)0x00000000U) /*!< Transmitting node is error active */
  512. #define FDCAN_ESI_PASSIVE ((uint32_t)0x80000000U) /*!< Transmitting node is error passive */
  513. /**
  514. * @}
  515. */
  516. /** @defgroup FDCAN_bit_rate_switching FDCAN Bit Rate Switching
  517. * @{
  518. */
  519. #define FDCAN_BRS_OFF ((uint32_t)0x00000000U) /*!< FDCAN frames transmitted/received without bit rate switching */
  520. #define FDCAN_BRS_ON ((uint32_t)0x00100000U) /*!< FDCAN frames transmitted/received with bit rate switching */
  521. /**
  522. * @}
  523. */
  524. /** @defgroup FDCAN_format FDCAN format
  525. * @{
  526. */
  527. #define FDCAN_CLASSIC_CAN ((uint32_t)0x00000000U) /*!< Frame transmitted/received in Classic CAN format */
  528. #define FDCAN_FD_CAN ((uint32_t)0x00200000U) /*!< Frame transmitted/received in FDCAN format */
  529. /**
  530. * @}
  531. */
  532. /** @defgroup FDCAN_EFC FDCAN Event FIFO control
  533. * @{
  534. */
  535. #define FDCAN_NO_TX_EVENTS ((uint32_t)0x00000000U) /*!< Do not store Tx events */
  536. #define FDCAN_STORE_TX_EVENTS ((uint32_t)0x00800000U) /*!< Store Tx events */
  537. /**
  538. * @}
  539. */
  540. /** @defgroup FDCAN_filter_type FDCAN Filter Type
  541. * @{
  542. */
  543. #define FDCAN_FILTER_RANGE ((uint32_t)0x00000000U) /*!< Range filter from FilterID1 to FilterID2 */
  544. #define FDCAN_FILTER_DUAL ((uint32_t)0x00000001U) /*!< Dual ID filter for FilterID1 or FilterID2 */
  545. #define FDCAN_FILTER_MASK ((uint32_t)0x00000002U) /*!< Classic filter: FilterID1 = filter, FilterID2 = mask */
  546. #define FDCAN_FILTER_RANGE_NO_EIDM ((uint32_t)0x00000003U) /*!< Range filter from FilterID1 to FilterID2, EIDM mask not applied */
  547. /**
  548. * @}
  549. */
  550. /** @defgroup FDCAN_filter_config FDCAN Filter Configuration
  551. * @{
  552. */
  553. #define FDCAN_FILTER_DISABLE ((uint32_t)0x00000000U) /*!< Disable filter element */
  554. #define FDCAN_FILTER_TO_RXFIFO0 ((uint32_t)0x00000001U) /*!< Store in Rx FIFO 0 if filter matches */
  555. #define FDCAN_FILTER_TO_RXFIFO1 ((uint32_t)0x00000002U) /*!< Store in Rx FIFO 1 if filter matches */
  556. #define FDCAN_FILTER_REJECT ((uint32_t)0x00000003U) /*!< Reject ID if filter matches */
  557. #define FDCAN_FILTER_HP ((uint32_t)0x00000004U) /*!< Set high priority if filter matches */
  558. #define FDCAN_FILTER_TO_RXFIFO0_HP ((uint32_t)0x00000005U) /*!< Set high priority and store in FIFO 0 if filter matches */
  559. #define FDCAN_FILTER_TO_RXFIFO1_HP ((uint32_t)0x00000006U) /*!< Set high priority and store in FIFO 1 if filter matches */
  560. /**
  561. * @}
  562. */
  563. /** @defgroup FDCAN_Tx_location FDCAN Tx Location
  564. * @{
  565. */
  566. #define FDCAN_TX_BUFFER0 ((uint32_t)0x00000001U) /*!< Add message to Tx Buffer 0 */
  567. #define FDCAN_TX_BUFFER1 ((uint32_t)0x00000002U) /*!< Add message to Tx Buffer 1 */
  568. #define FDCAN_TX_BUFFER2 ((uint32_t)0x00000004U) /*!< Add message to Tx Buffer 2 */
  569. /**
  570. * @}
  571. */
  572. /** @defgroup FDCAN_Rx_location FDCAN Rx Location
  573. * @{
  574. */
  575. #define FDCAN_RX_FIFO0 ((uint32_t)0x00000040U) /*!< Get received message from Rx FIFO 0 */
  576. #define FDCAN_RX_FIFO1 ((uint32_t)0x00000041U) /*!< Get received message from Rx FIFO 1 */
  577. /**
  578. * @}
  579. */
  580. /** @defgroup FDCAN_event_type FDCAN Event Type
  581. * @{
  582. */
  583. #define FDCAN_TX_EVENT ((uint32_t)0x00400000U) /*!< Tx event */
  584. #define FDCAN_TX_IN_SPITE_OF_ABORT ((uint32_t)0x00800000U) /*!< Transmission in spite of cancellation */
  585. /**
  586. * @}
  587. */
  588. /** @defgroup FDCAN_hp_msg_storage FDCAN High Priority Message Storage
  589. * @{
  590. */
  591. #define FDCAN_HP_STORAGE_NO_FIFO ((uint32_t)0x00000000U) /*!< No FIFO selected */
  592. #define FDCAN_HP_STORAGE_MSG_LOST ((uint32_t)0x00000040U) /*!< FIFO message lost */
  593. #define FDCAN_HP_STORAGE_RXFIFO0 ((uint32_t)0x00000080U) /*!< Message stored in FIFO 0 */
  594. #define FDCAN_HP_STORAGE_RXFIFO1 ((uint32_t)0x000000C0U) /*!< Message stored in FIFO 1 */
  595. /**
  596. * @}
  597. */
  598. /** @defgroup FDCAN_protocol_error_code FDCAN protocol error code
  599. * @{
  600. */
  601. #define FDCAN_PROTOCOL_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error occurred */
  602. #define FDCAN_PROTOCOL_ERROR_STUFF ((uint32_t)0x00000001U) /*!< Stuff error */
  603. #define FDCAN_PROTOCOL_ERROR_FORM ((uint32_t)0x00000002U) /*!< Form error */
  604. #define FDCAN_PROTOCOL_ERROR_ACK ((uint32_t)0x00000003U) /*!< Acknowledge error */
  605. #define FDCAN_PROTOCOL_ERROR_BIT1 ((uint32_t)0x00000004U) /*!< Bit 1 (recessive) error */
  606. #define FDCAN_PROTOCOL_ERROR_BIT0 ((uint32_t)0x00000005U) /*!< Bit 0 (dominant) error */
  607. #define FDCAN_PROTOCOL_ERROR_CRC ((uint32_t)0x00000006U) /*!< CRC check sum error */
  608. #define FDCAN_PROTOCOL_ERROR_NO_CHANGE ((uint32_t)0x00000007U) /*!< No change since last read */
  609. /**
  610. * @}
  611. */
  612. /** @defgroup FDCAN_communication_state FDCAN communication state
  613. * @{
  614. */
  615. #define FDCAN_COM_STATE_SYNC ((uint32_t)0x00000000U) /*!< Node is synchronizing on CAN communication */
  616. #define FDCAN_COM_STATE_IDLE ((uint32_t)0x00000008U) /*!< Node is neither receiver nor transmitter */
  617. #define FDCAN_COM_STATE_RX ((uint32_t)0x00000010U) /*!< Node is operating as receiver */
  618. #define FDCAN_COM_STATE_TX ((uint32_t)0x00000018U) /*!< Node is operating as transmitter */
  619. /**
  620. * @}
  621. */
  622. /** @defgroup FDCAN_Rx_FIFO_operation_mode FDCAN FIFO operation mode
  623. * @{
  624. */
  625. #define FDCAN_RX_FIFO_BLOCKING ((uint32_t)0x00000000U) /*!< Rx FIFO blocking mode */
  626. #define FDCAN_RX_FIFO_OVERWRITE ((uint32_t)0x00000001U) /*!< Rx FIFO overwrite mode */
  627. /**
  628. * @}
  629. */
  630. /** @defgroup FDCAN_Non_Matching_Frames FDCAN non-matching frames
  631. * @{
  632. */
  633. #define FDCAN_ACCEPT_IN_RX_FIFO0 ((uint32_t)0x00000000U) /*!< Accept in Rx FIFO 0 */
  634. #define FDCAN_ACCEPT_IN_RX_FIFO1 ((uint32_t)0x00000001U) /*!< Accept in Rx FIFO 1 */
  635. #define FDCAN_REJECT ((uint32_t)0x00000002U) /*!< Reject */
  636. /**
  637. * @}
  638. */
  639. /** @defgroup FDCAN_Reject_Remote_Frames FDCAN reject remote frames
  640. * @{
  641. */
  642. #define FDCAN_FILTER_REMOTE ((uint32_t)0x00000000U) /*!< Filter remote frames */
  643. #define FDCAN_REJECT_REMOTE ((uint32_t)0x00000001U) /*!< Reject all remote frames */
  644. /**
  645. * @}
  646. */
  647. /** @defgroup FDCAN_Interrupt_Line FDCAN interrupt line
  648. * @{
  649. */
  650. #define FDCAN_INTERRUPT_LINE0 ((uint32_t)0x00000001U) /*!< Interrupt Line 0 */
  651. #define FDCAN_INTERRUPT_LINE1 ((uint32_t)0x00000002U) /*!< Interrupt Line 1 */
  652. /**
  653. * @}
  654. */
  655. /** @defgroup FDCAN_Timestamp FDCAN timestamp
  656. * @{
  657. */
  658. #define FDCAN_TIMESTAMP_INTERNAL ((uint32_t)0x00000001U) /*!< Timestamp counter value incremented according to TCP */
  659. #define FDCAN_TIMESTAMP_EXTERNAL ((uint32_t)0x00000002U) /*!< External timestamp counter value used */
  660. /**
  661. * @}
  662. */
  663. /** @defgroup FDCAN_Timestamp_Prescaler FDCAN timestamp prescaler
  664. * @{
  665. */
  666. #define FDCAN_TIMESTAMP_PRESC_1 ((uint32_t)0x00000000U) /*!< Timestamp counter time unit in equal to CAN bit time */
  667. #define FDCAN_TIMESTAMP_PRESC_2 ((uint32_t)0x00010000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 2 */
  668. #define FDCAN_TIMESTAMP_PRESC_3 ((uint32_t)0x00020000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 3 */
  669. #define FDCAN_TIMESTAMP_PRESC_4 ((uint32_t)0x00030000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 4 */
  670. #define FDCAN_TIMESTAMP_PRESC_5 ((uint32_t)0x00040000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 5 */
  671. #define FDCAN_TIMESTAMP_PRESC_6 ((uint32_t)0x00050000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 6 */
  672. #define FDCAN_TIMESTAMP_PRESC_7 ((uint32_t)0x00060000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 7 */
  673. #define FDCAN_TIMESTAMP_PRESC_8 ((uint32_t)0x00070000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 8 */
  674. #define FDCAN_TIMESTAMP_PRESC_9 ((uint32_t)0x00080000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 9 */
  675. #define FDCAN_TIMESTAMP_PRESC_10 ((uint32_t)0x00090000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 10 */
  676. #define FDCAN_TIMESTAMP_PRESC_11 ((uint32_t)0x000A0000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 11 */
  677. #define FDCAN_TIMESTAMP_PRESC_12 ((uint32_t)0x000B0000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 12 */
  678. #define FDCAN_TIMESTAMP_PRESC_13 ((uint32_t)0x000C0000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 13 */
  679. #define FDCAN_TIMESTAMP_PRESC_14 ((uint32_t)0x000D0000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 14 */
  680. #define FDCAN_TIMESTAMP_PRESC_15 ((uint32_t)0x000E0000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 15 */
  681. #define FDCAN_TIMESTAMP_PRESC_16 ((uint32_t)0x000F0000U) /*!< Timestamp counter time unit in equal to CAN bit time multiplied by 16 */
  682. /**
  683. * @}
  684. */
  685. /** @defgroup FDCAN_Timeout_Operation FDCAN timeout operation
  686. * @{
  687. */
  688. #define FDCAN_TIMEOUT_CONTINUOUS ((uint32_t)0x00000000U) /*!< Timeout continuous operation */
  689. #define FDCAN_TIMEOUT_TX_EVENT_FIFO ((uint32_t)0x00000002U) /*!< Timeout controlled by Tx Event FIFO */
  690. #define FDCAN_TIMEOUT_RX_FIFO0 ((uint32_t)0x00000004U) /*!< Timeout controlled by Rx FIFO 0 */
  691. #define FDCAN_TIMEOUT_RX_FIFO1 ((uint32_t)0x00000006U) /*!< Timeout controlled by Rx FIFO 1 */
  692. /**
  693. * @}
  694. */
  695. /** @defgroup Interrupt_Masks Interrupt masks
  696. * @{
  697. */
  698. #define FDCAN_IR_MASK ((uint32_t)0x00FFFFFFU) /*!< FDCAN interrupts mask */
  699. #define FDCAN_ILS_MASK ((uint32_t)0x0000007FU) /*!< FDCAN interrupts group mask */
  700. /**
  701. * @}
  702. */
  703. /** @defgroup FDCAN_flags FDCAN Flags
  704. * @{
  705. */
  706. #define FDCAN_FLAG_TX_COMPLETE FDCAN_IR_TC /*!< Transmission Completed */
  707. #define FDCAN_FLAG_TX_ABORT_COMPLETE FDCAN_IR_TCF /*!< Transmission Cancellation Finished */
  708. #define FDCAN_FLAG_TX_FIFO_EMPTY FDCAN_IR_TFE /*!< Tx FIFO Empty */
  709. #define FDCAN_FLAG_RX_HIGH_PRIORITY_MSG FDCAN_IR_HPM /*!< High priority message received */
  710. #define FDCAN_FLAG_TX_EVT_FIFO_ELT_LOST FDCAN_IR_TEFL /*!< Tx Event FIFO element lost */
  711. #define FDCAN_FLAG_TX_EVT_FIFO_FULL FDCAN_IR_TEFF /*!< Tx Event FIFO full */
  712. #define FDCAN_FLAG_TX_EVT_FIFO_NEW_DATA FDCAN_IR_TEFN /*!< Tx Handler wrote Tx Event FIFO element */
  713. #define FDCAN_FLAG_RX_FIFO0_MESSAGE_LOST FDCAN_IR_RF0L /*!< Rx FIFO 0 message lost */
  714. #define FDCAN_FLAG_RX_FIFO0_FULL FDCAN_IR_RF0F /*!< Rx FIFO 0 full */
  715. #define FDCAN_FLAG_RX_FIFO0_NEW_MESSAGE FDCAN_IR_RF0N /*!< New message written to Rx FIFO 0 */
  716. #define FDCAN_FLAG_RX_FIFO1_MESSAGE_LOST FDCAN_IR_RF1L /*!< Rx FIFO 1 message lost */
  717. #define FDCAN_FLAG_RX_FIFO1_FULL FDCAN_IR_RF1F /*!< Rx FIFO 1 full */
  718. #define FDCAN_FLAG_RX_FIFO1_NEW_MESSAGE FDCAN_IR_RF1N /*!< New message written to Rx FIFO 1 */
  719. #define FDCAN_FLAG_RAM_ACCESS_FAILURE FDCAN_IR_MRAF /*!< Message RAM access failure occurred */
  720. #define FDCAN_FLAG_ERROR_LOGGING_OVERFLOW FDCAN_IR_ELO /*!< Overflow of FDCAN Error Logging Counter occurred */
  721. #define FDCAN_FLAG_ERROR_PASSIVE FDCAN_IR_EP /*!< Error_Passive status changed */
  722. #define FDCAN_FLAG_ERROR_WARNING FDCAN_IR_EW /*!< Error_Warning status changed */
  723. #define FDCAN_FLAG_BUS_OFF FDCAN_IR_BO /*!< Bus_Off status changed */
  724. #define FDCAN_FLAG_RAM_WATCHDOG FDCAN_IR_WDI /*!< Message RAM Watchdog event due to missing READY */
  725. #define FDCAN_FLAG_ARB_PROTOCOL_ERROR FDCAN_IR_PEA /*!< Protocol error in arbitration phase detected */
  726. #define FDCAN_FLAG_DATA_PROTOCOL_ERROR FDCAN_IR_PED /*!< Protocol error in data phase detected */
  727. #define FDCAN_FLAG_RESERVED_ADDRESS_ACCESS FDCAN_IR_ARA /*!< Access to reserved address occurred */
  728. #define FDCAN_FLAG_TIMESTAMP_WRAPAROUND FDCAN_IR_TSW /*!< Timestamp counter wrapped around */
  729. #define FDCAN_FLAG_TIMEOUT_OCCURRED FDCAN_IR_TOO /*!< Timeout reached */
  730. /**
  731. * @}
  732. */
  733. /** @defgroup FDCAN_Interrupts FDCAN Interrupts
  734. * @{
  735. */
  736. /** @defgroup FDCAN_Tx_Interrupts FDCAN Tx Interrupts
  737. * @{
  738. */
  739. #define FDCAN_IT_TX_COMPLETE FDCAN_IE_TCE /*!< Transmission Completed */
  740. #define FDCAN_IT_TX_ABORT_COMPLETE FDCAN_IE_TCFE /*!< Transmission Cancellation Finished */
  741. #define FDCAN_IT_TX_FIFO_EMPTY FDCAN_IE_TFEE /*!< Tx FIFO Empty */
  742. /**
  743. * @}
  744. */
  745. /** @defgroup FDCAN_Rx_Interrupts FDCAN Rx Interrupts
  746. * @{
  747. */
  748. #define FDCAN_IT_RX_HIGH_PRIORITY_MSG FDCAN_IE_HPME /*!< High priority message received */
  749. /**
  750. * @}
  751. */
  752. /** @defgroup FDCAN_Counter_Interrupts FDCAN Counter Interrupts
  753. * @{
  754. */
  755. #define FDCAN_IT_TIMESTAMP_WRAPAROUND FDCAN_IE_TSWE /*!< Timestamp counter wrapped around */
  756. #define FDCAN_IT_TIMEOUT_OCCURRED FDCAN_IE_TOOE /*!< Timeout reached */
  757. /**
  758. * @}
  759. */
  760. /** @defgroup FDCAN_Tx_Event_Fifo_Interrupts FDCAN Tx Event FIFO Interrupts
  761. * @{
  762. */
  763. #define FDCAN_IT_TX_EVT_FIFO_ELT_LOST FDCAN_IE_TEFLE /*!< Tx Event FIFO element lost */
  764. #define FDCAN_IT_TX_EVT_FIFO_FULL FDCAN_IE_TEFFE /*!< Tx Event FIFO full */
  765. #define FDCAN_IT_TX_EVT_FIFO_NEW_DATA FDCAN_IE_TEFNE /*!< Tx Handler wrote Tx Event FIFO element */
  766. /**
  767. * @}
  768. */
  769. /** @defgroup FDCAN_Rx_Fifo0_Interrupts FDCAN Rx FIFO 0 Interrupts
  770. * @{
  771. */
  772. #define FDCAN_IT_RX_FIFO0_MESSAGE_LOST FDCAN_IE_RF0LE /*!< Rx FIFO 0 message lost */
  773. #define FDCAN_IT_RX_FIFO0_FULL FDCAN_IE_RF0FE /*!< Rx FIFO 0 full */
  774. #define FDCAN_IT_RX_FIFO0_NEW_MESSAGE FDCAN_IE_RF0NE /*!< New message written to Rx FIFO 0 */
  775. /**
  776. * @}
  777. */
  778. /** @defgroup FDCAN_Rx_Fifo1_Interrupts FDCAN Rx FIFO 1 Interrupts
  779. * @{
  780. */
  781. #define FDCAN_IT_RX_FIFO1_MESSAGE_LOST FDCAN_IE_RF1LE /*!< Rx FIFO 1 message lost */
  782. #define FDCAN_IT_RX_FIFO1_FULL FDCAN_IE_RF1FE /*!< Rx FIFO 1 full */
  783. #define FDCAN_IT_RX_FIFO1_NEW_MESSAGE FDCAN_IE_RF1NE /*!< New message written to Rx FIFO 1 */
  784. /**
  785. * @}
  786. */
  787. /** @defgroup FDCAN_Error_Interrupts FDCAN Error Interrupts
  788. * @{
  789. */
  790. #define FDCAN_IT_RAM_ACCESS_FAILURE FDCAN_IE_MRAFE /*!< Message RAM access failure occurred */
  791. #define FDCAN_IT_ERROR_LOGGING_OVERFLOW FDCAN_IE_ELOE /*!< Overflow of FDCAN Error Logging Counter occurred */
  792. #define FDCAN_IT_RAM_WATCHDOG FDCAN_IE_WDIE /*!< Message RAM Watchdog event due to missing READY */
  793. #define FDCAN_IT_ARB_PROTOCOL_ERROR FDCAN_IE_PEAE /*!< Protocol error in arbitration phase detected */
  794. #define FDCAN_IT_DATA_PROTOCOL_ERROR FDCAN_IE_PEDE /*!< Protocol error in data phase detected */
  795. #define FDCAN_IT_RESERVED_ADDRESS_ACCESS FDCAN_IE_ARAE /*!< Access to reserved address occurred */
  796. /**
  797. * @}
  798. */
  799. /** @defgroup FDCAN_Error_Status_Interrupts FDCAN Error Status Interrupts
  800. * @{
  801. */
  802. #define FDCAN_IT_ERROR_PASSIVE FDCAN_IE_EPE /*!< Error_Passive status changed */
  803. #define FDCAN_IT_ERROR_WARNING FDCAN_IE_EWE /*!< Error_Warning status changed */
  804. #define FDCAN_IT_BUS_OFF FDCAN_IE_BOE /*!< Bus_Off status changed */
  805. /**
  806. * @}
  807. */
  808. /**
  809. * @}
  810. */
  811. /** @defgroup FDCAN_Interrupts_List FDCAN Interrupts List
  812. * @{
  813. */
  814. #define FDCAN_IT_LIST_RX_FIFO0 (FDCAN_IT_RX_FIFO0_MESSAGE_LOST | \
  815. FDCAN_IT_RX_FIFO0_FULL | \
  816. FDCAN_IT_RX_FIFO0_NEW_MESSAGE) /*!< RX FIFO 0 Interrupts List */
  817. #define FDCAN_IT_LIST_RX_FIFO1 (FDCAN_IT_RX_FIFO1_MESSAGE_LOST | \
  818. FDCAN_IT_RX_FIFO1_FULL | \
  819. FDCAN_IT_RX_FIFO1_NEW_MESSAGE) /*!< RX FIFO 1 Interrupts List */
  820. #define FDCAN_IT_LIST_SMSG (FDCAN_IT_TX_ABORT_COMPLETE | \
  821. FDCAN_IT_TX_COMPLETE | \
  822. FDCAN_IT_RX_HIGH_PRIORITY_MSG) /*!< Status Message Interrupts List */
  823. #define FDCAN_IT_LIST_TX_FIFO_ERROR (FDCAN_IT_TX_EVT_FIFO_ELT_LOST | \
  824. FDCAN_IT_TX_EVT_FIFO_FULL | \
  825. FDCAN_IT_TX_EVT_FIFO_NEW_DATA | \
  826. FDCAN_IT_TX_FIFO_EMPTY) /*!< TX FIFO Error Interrupts List */
  827. #define FDCAN_IT_LIST_MISC (FDCAN_IT_TIMEOUT_OCCURRED | \
  828. FDCAN_IT_RAM_ACCESS_FAILURE | \
  829. FDCAN_IT_TIMESTAMP_WRAPAROUND) /*!< Misc. Interrupts List */
  830. #define FDCAN_IT_LIST_BIT_LINE_ERROR (FDCAN_IT_ERROR_PASSIVE | \
  831. FDCAN_IT_ERROR_LOGGING_OVERFLOW) /*!< Bit and Line Error Interrupts List */
  832. #define FDCAN_IT_LIST_PROTOCOL_ERROR (FDCAN_IT_RESERVED_ADDRESS_ACCESS | \
  833. FDCAN_IT_DATA_PROTOCOL_ERROR | \
  834. FDCAN_IT_ARB_PROTOCOL_ERROR | \
  835. FDCAN_IT_RAM_WATCHDOG | \
  836. FDCAN_IT_BUS_OFF | \
  837. FDCAN_IT_ERROR_WARNING) /*!< Protocol Error Interrupts List */
  838. /**
  839. * @}
  840. */
  841. /** @defgroup FDCAN_Interrupts_Group FDCAN Interrupts Group
  842. * @{
  843. */
  844. #define FDCAN_IT_GROUP_RX_FIFO0 FDCAN_ILS_RXFIFO0 /*!< RX FIFO 0 Interrupts Group:
  845. RF0LL: Rx FIFO 0 Message Lost
  846. RF0FL: Rx FIFO 0 is Full
  847. RF0NL: Rx FIFO 0 Has New Message */
  848. #define FDCAN_IT_GROUP_RX_FIFO1 FDCAN_ILS_RXFIFO1 /*!< RX FIFO 1 Interrupts Group:
  849. RF1LL: Rx FIFO 1 Message Lost
  850. RF1FL: Rx FIFO 1 is Full
  851. RF1NL: Rx FIFO 1 Has New Message */
  852. #define FDCAN_IT_GROUP_SMSG FDCAN_ILS_SMSG /*!< Status Message Interrupts Group:
  853. TCFL: Transmission Cancellation Finished
  854. TCL: Transmission Completed
  855. HPML: High Priority Message */
  856. #define FDCAN_IT_GROUP_TX_FIFO_ERROR FDCAN_ILS_TFERR /*!< TX FIFO Error Interrupts Group:
  857. TEFLL: Tx Event FIFO Element Lost
  858. TEFFL: Tx Event FIFO Full
  859. TEFNL: Tx Event FIFO New Entry
  860. TFEL: Tx FIFO Empty Interrupt Line */
  861. #define FDCAN_IT_GROUP_MISC FDCAN_ILS_MISC /*!< Misc. Interrupts Group:
  862. TOOL: Timeout Occurred
  863. MRAFL: Message RAM Access Failure
  864. TSWL: Timestamp Wraparound */
  865. #define FDCAN_IT_GROUP_BIT_LINE_ERROR FDCAN_ILS_BERR /*!< Bit and Line Error Interrupts Group:
  866. EPL: Error Passive
  867. ELOL: Error Logging Overflow */
  868. #define FDCAN_IT_GROUP_PROTOCOL_ERROR FDCAN_ILS_PERR /*!< Protocol Error Group:
  869. ARAL: Access to Reserved Address Line
  870. PEDL: Protocol Error in Data Phase Line
  871. PEAL: Protocol Error in Arbitration Phase Line
  872. WDIL: Watchdog Interrupt Line
  873. BOL: Bus_Off Status
  874. EWL: Warning Status */
  875. /**
  876. * @}
  877. */
  878. /**
  879. * @}
  880. */
  881. /* Exported macro ------------------------------------------------------------*/
  882. /** @defgroup FDCAN_Exported_Macros FDCAN Exported Macros
  883. * @{
  884. */
  885. /** @brief Reset FDCAN handle state.
  886. * @param __HANDLE__ FDCAN handle.
  887. * @retval None
  888. */
  889. #if USE_HAL_FDCAN_REGISTER_CALLBACKS == 1
  890. #define __HAL_FDCAN_RESET_HANDLE_STATE(__HANDLE__) do{ \
  891. (__HANDLE__)->State = HAL_FDCAN_STATE_RESET; \
  892. (__HANDLE__)->MspInitCallback = NULL; \
  893. (__HANDLE__)->MspDeInitCallback = NULL; \
  894. } while(0)
  895. #else
  896. #define __HAL_FDCAN_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_FDCAN_STATE_RESET)
  897. #endif /* USE_HAL_FDCAN_REGISTER_CALLBACKS */
  898. /**
  899. * @brief Enable the specified FDCAN interrupts.
  900. * @param __HANDLE__ FDCAN handle.
  901. * @param __INTERRUPT__ FDCAN interrupt.
  902. * This parameter can be any combination of @arg FDCAN_Interrupts
  903. * @retval None
  904. */
  905. #define __HAL_FDCAN_ENABLE_IT(__HANDLE__, __INTERRUPT__) \
  906. (__HANDLE__)->Instance->IE |= (__INTERRUPT__)
  907. /**
  908. * @brief Disable the specified FDCAN interrupts.
  909. * @param __HANDLE__ FDCAN handle.
  910. * @param __INTERRUPT__ FDCAN interrupt.
  911. * This parameter can be any combination of @arg FDCAN_Interrupts
  912. * @retval None
  913. */
  914. #define __HAL_FDCAN_DISABLE_IT(__HANDLE__, __INTERRUPT__) \
  915. ((__HANDLE__)->Instance->IE) &= ~(__INTERRUPT__)
  916. /**
  917. * @brief Check whether the specified FDCAN interrupt is set or not.
  918. * @param __HANDLE__ FDCAN handle.
  919. * @param __INTERRUPT__ FDCAN interrupt.
  920. * This parameter can be one of @arg FDCAN_Interrupts
  921. * @retval ITStatus
  922. */
  923. #define __HAL_FDCAN_GET_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IR & (__INTERRUPT__))
  924. /**
  925. * @brief Clear the specified FDCAN interrupts.
  926. * @param __HANDLE__ FDCAN handle.
  927. * @param __INTERRUPT__ specifies the interrupts to clear.
  928. * This parameter can be any combination of @arg FDCAN_Interrupts
  929. * @retval None
  930. */
  931. #define __HAL_FDCAN_CLEAR_IT(__HANDLE__, __INTERRUPT__) \
  932. ((__HANDLE__)->Instance->IR) = (__INTERRUPT__)
  933. /**
  934. * @brief Check whether the specified FDCAN flag is set or not.
  935. * @param __HANDLE__ FDCAN handle.
  936. * @param __FLAG__ FDCAN flag.
  937. * This parameter can be one of @arg FDCAN_flags
  938. * @retval FlagStatus
  939. */
  940. #define __HAL_FDCAN_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->IR & (__FLAG__))
  941. /**
  942. * @brief Clear the specified FDCAN flags.
  943. * @param __HANDLE__ FDCAN handle.
  944. * @param __FLAG__ specifies the flags to clear.
  945. * This parameter can be any combination of @arg FDCAN_flags
  946. * @retval None
  947. */
  948. #define __HAL_FDCAN_CLEAR_FLAG(__HANDLE__, __FLAG__) \
  949. ((__HANDLE__)->Instance->IR) = (__FLAG__)
  950. /** @brief Check if the specified FDCAN interrupt source is enabled or disabled.
  951. * @param __HANDLE__ FDCAN handle.
  952. * @param __INTERRUPT__ specifies the FDCAN interrupt source to check.
  953. * This parameter can be a value of @arg FDCAN_Interrupts
  954. * @retval ITStatus
  955. */
  956. #define __HAL_FDCAN_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IE & (__INTERRUPT__))
  957. /**
  958. * @}
  959. */
  960. /* Exported functions --------------------------------------------------------*/
  961. /** @addtogroup FDCAN_Exported_Functions
  962. * @{
  963. */
  964. /** @addtogroup FDCAN_Exported_Functions_Group1
  965. * @{
  966. */
  967. /* Initialization and de-initialization functions *****************************/
  968. HAL_StatusTypeDef HAL_FDCAN_Init(FDCAN_HandleTypeDef *hfdcan);
  969. HAL_StatusTypeDef HAL_FDCAN_DeInit(FDCAN_HandleTypeDef *hfdcan);
  970. void HAL_FDCAN_MspInit(FDCAN_HandleTypeDef *hfdcan);
  971. void HAL_FDCAN_MspDeInit(FDCAN_HandleTypeDef *hfdcan);
  972. HAL_StatusTypeDef HAL_FDCAN_EnterPowerDownMode(FDCAN_HandleTypeDef *hfdcan);
  973. HAL_StatusTypeDef HAL_FDCAN_ExitPowerDownMode(FDCAN_HandleTypeDef *hfdcan);
  974. #if USE_HAL_FDCAN_REGISTER_CALLBACKS == 1
  975. /* Callbacks Register/UnRegister functions ***********************************/
  976. HAL_StatusTypeDef HAL_FDCAN_RegisterCallback(FDCAN_HandleTypeDef *hfdcan, HAL_FDCAN_CallbackIDTypeDef CallbackID,
  977. pFDCAN_CallbackTypeDef pCallback);
  978. HAL_StatusTypeDef HAL_FDCAN_UnRegisterCallback(FDCAN_HandleTypeDef *hfdcan, HAL_FDCAN_CallbackIDTypeDef CallbackID);
  979. HAL_StatusTypeDef HAL_FDCAN_RegisterTxEventFifoCallback(FDCAN_HandleTypeDef *hfdcan,
  980. pFDCAN_TxEventFifoCallbackTypeDef pCallback);
  981. HAL_StatusTypeDef HAL_FDCAN_UnRegisterTxEventFifoCallback(FDCAN_HandleTypeDef *hfdcan);
  982. HAL_StatusTypeDef HAL_FDCAN_RegisterRxFifo0Callback(FDCAN_HandleTypeDef *hfdcan,
  983. pFDCAN_RxFifo0CallbackTypeDef pCallback);
  984. HAL_StatusTypeDef HAL_FDCAN_UnRegisterRxFifo0Callback(FDCAN_HandleTypeDef *hfdcan);
  985. HAL_StatusTypeDef HAL_FDCAN_RegisterRxFifo1Callback(FDCAN_HandleTypeDef *hfdcan,
  986. pFDCAN_RxFifo1CallbackTypeDef pCallback);
  987. HAL_StatusTypeDef HAL_FDCAN_UnRegisterRxFifo1Callback(FDCAN_HandleTypeDef *hfdcan);
  988. HAL_StatusTypeDef HAL_FDCAN_RegisterTxBufferCompleteCallback(FDCAN_HandleTypeDef *hfdcan,
  989. pFDCAN_TxBufferCompleteCallbackTypeDef pCallback);
  990. HAL_StatusTypeDef HAL_FDCAN_UnRegisterTxBufferCompleteCallback(FDCAN_HandleTypeDef *hfdcan);
  991. HAL_StatusTypeDef HAL_FDCAN_RegisterTxBufferAbortCallback(FDCAN_HandleTypeDef *hfdcan,
  992. pFDCAN_TxBufferAbortCallbackTypeDef pCallback);
  993. HAL_StatusTypeDef HAL_FDCAN_UnRegisterTxBufferAbortCallback(FDCAN_HandleTypeDef *hfdcan);
  994. HAL_StatusTypeDef HAL_FDCAN_RegisterErrorStatusCallback(FDCAN_HandleTypeDef *hfdcan,
  995. pFDCAN_ErrorStatusCallbackTypeDef pCallback);
  996. HAL_StatusTypeDef HAL_FDCAN_UnRegisterErrorStatusCallback(FDCAN_HandleTypeDef *hfdcan);
  997. #endif /* USE_HAL_FDCAN_REGISTER_CALLBACKS */
  998. /**
  999. * @}
  1000. */
  1001. /** @addtogroup FDCAN_Exported_Functions_Group2
  1002. * @{
  1003. */
  1004. /* Configuration functions ****************************************************/
  1005. HAL_StatusTypeDef HAL_FDCAN_ConfigFilter(FDCAN_HandleTypeDef *hfdcan, const FDCAN_FilterTypeDef *sFilterConfig);
  1006. HAL_StatusTypeDef HAL_FDCAN_ConfigGlobalFilter(FDCAN_HandleTypeDef *hfdcan, uint32_t NonMatchingStd,
  1007. uint32_t NonMatchingExt, uint32_t RejectRemoteStd,
  1008. uint32_t RejectRemoteExt);
  1009. HAL_StatusTypeDef HAL_FDCAN_ConfigExtendedIdMask(FDCAN_HandleTypeDef *hfdcan, uint32_t Mask);
  1010. HAL_StatusTypeDef HAL_FDCAN_ConfigRxFifoOverwrite(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo, uint32_t OperationMode);
  1011. HAL_StatusTypeDef HAL_FDCAN_ConfigRamWatchdog(FDCAN_HandleTypeDef *hfdcan, uint32_t CounterStartValue);
  1012. HAL_StatusTypeDef HAL_FDCAN_ConfigTimestampCounter(FDCAN_HandleTypeDef *hfdcan, uint32_t TimestampPrescaler);
  1013. HAL_StatusTypeDef HAL_FDCAN_EnableTimestampCounter(FDCAN_HandleTypeDef *hfdcan, uint32_t TimestampOperation);
  1014. HAL_StatusTypeDef HAL_FDCAN_DisableTimestampCounter(FDCAN_HandleTypeDef *hfdcan);
  1015. uint16_t HAL_FDCAN_GetTimestampCounter(const FDCAN_HandleTypeDef *hfdcan);
  1016. HAL_StatusTypeDef HAL_FDCAN_ResetTimestampCounter(FDCAN_HandleTypeDef *hfdcan);
  1017. HAL_StatusTypeDef HAL_FDCAN_ConfigTimeoutCounter(FDCAN_HandleTypeDef *hfdcan, uint32_t TimeoutOperation,
  1018. uint32_t TimeoutPeriod);
  1019. HAL_StatusTypeDef HAL_FDCAN_EnableTimeoutCounter(FDCAN_HandleTypeDef *hfdcan);
  1020. HAL_StatusTypeDef HAL_FDCAN_DisableTimeoutCounter(FDCAN_HandleTypeDef *hfdcan);
  1021. uint16_t HAL_FDCAN_GetTimeoutCounter(const FDCAN_HandleTypeDef *hfdcan);
  1022. HAL_StatusTypeDef HAL_FDCAN_ResetTimeoutCounter(FDCAN_HandleTypeDef *hfdcan);
  1023. HAL_StatusTypeDef HAL_FDCAN_ConfigTxDelayCompensation(FDCAN_HandleTypeDef *hfdcan, uint32_t TdcOffset,
  1024. uint32_t TdcFilter);
  1025. HAL_StatusTypeDef HAL_FDCAN_EnableTxDelayCompensation(FDCAN_HandleTypeDef *hfdcan);
  1026. HAL_StatusTypeDef HAL_FDCAN_DisableTxDelayCompensation(FDCAN_HandleTypeDef *hfdcan);
  1027. HAL_StatusTypeDef HAL_FDCAN_EnableISOMode(FDCAN_HandleTypeDef *hfdcan);
  1028. HAL_StatusTypeDef HAL_FDCAN_DisableISOMode(FDCAN_HandleTypeDef *hfdcan);
  1029. HAL_StatusTypeDef HAL_FDCAN_EnableEdgeFiltering(FDCAN_HandleTypeDef *hfdcan);
  1030. HAL_StatusTypeDef HAL_FDCAN_DisableEdgeFiltering(FDCAN_HandleTypeDef *hfdcan);
  1031. /**
  1032. * @}
  1033. */
  1034. /** @addtogroup FDCAN_Exported_Functions_Group3
  1035. * @{
  1036. */
  1037. /* Control functions **********************************************************/
  1038. HAL_StatusTypeDef HAL_FDCAN_Start(FDCAN_HandleTypeDef *hfdcan);
  1039. HAL_StatusTypeDef HAL_FDCAN_Stop(FDCAN_HandleTypeDef *hfdcan);
  1040. HAL_StatusTypeDef HAL_FDCAN_AddMessageToTxFifoQ(FDCAN_HandleTypeDef *hfdcan, const FDCAN_TxHeaderTypeDef *pTxHeader,
  1041. const uint8_t *pTxData);
  1042. uint32_t HAL_FDCAN_GetLatestTxFifoQRequestBuffer(const FDCAN_HandleTypeDef *hfdcan);
  1043. HAL_StatusTypeDef HAL_FDCAN_AbortTxRequest(FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndex);
  1044. HAL_StatusTypeDef HAL_FDCAN_GetRxMessage(FDCAN_HandleTypeDef *hfdcan, uint32_t RxLocation,
  1045. FDCAN_RxHeaderTypeDef *pRxHeader, uint8_t *pRxData);
  1046. HAL_StatusTypeDef HAL_FDCAN_GetTxEvent(FDCAN_HandleTypeDef *hfdcan, FDCAN_TxEventFifoTypeDef *pTxEvent);
  1047. HAL_StatusTypeDef HAL_FDCAN_GetHighPriorityMessageStatus(const FDCAN_HandleTypeDef *hfdcan,
  1048. FDCAN_HpMsgStatusTypeDef *HpMsgStatus);
  1049. HAL_StatusTypeDef HAL_FDCAN_GetProtocolStatus(const FDCAN_HandleTypeDef *hfdcan,
  1050. FDCAN_ProtocolStatusTypeDef *ProtocolStatus);
  1051. HAL_StatusTypeDef HAL_FDCAN_GetErrorCounters(const FDCAN_HandleTypeDef *hfdcan,
  1052. FDCAN_ErrorCountersTypeDef *ErrorCounters);
  1053. uint32_t HAL_FDCAN_IsTxBufferMessagePending(const FDCAN_HandleTypeDef *hfdcan, uint32_t TxBufferIndex);
  1054. uint32_t HAL_FDCAN_GetRxFifoFillLevel(const FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo);
  1055. uint32_t HAL_FDCAN_GetTxFifoFreeLevel(const FDCAN_HandleTypeDef *hfdcan);
  1056. uint32_t HAL_FDCAN_IsRestrictedOperationMode(const FDCAN_HandleTypeDef *hfdcan);
  1057. HAL_StatusTypeDef HAL_FDCAN_ExitRestrictedOperationMode(FDCAN_HandleTypeDef *hfdcan);
  1058. /**
  1059. * @}
  1060. */
  1061. /** @addtogroup FDCAN_Exported_Functions_Group4
  1062. * @{
  1063. */
  1064. /* Interrupts management ******************************************************/
  1065. HAL_StatusTypeDef HAL_FDCAN_ConfigInterruptLines(FDCAN_HandleTypeDef *hfdcan, uint32_t ITList, uint32_t InterruptLine);
  1066. HAL_StatusTypeDef HAL_FDCAN_ActivateNotification(FDCAN_HandleTypeDef *hfdcan, uint32_t ActiveITs,
  1067. uint32_t BufferIndexes);
  1068. HAL_StatusTypeDef HAL_FDCAN_DeactivateNotification(FDCAN_HandleTypeDef *hfdcan, uint32_t InactiveITs);
  1069. void HAL_FDCAN_IRQHandler(FDCAN_HandleTypeDef *hfdcan);
  1070. /**
  1071. * @}
  1072. */
  1073. /** @addtogroup FDCAN_Exported_Functions_Group5
  1074. * @{
  1075. */
  1076. /* Callback functions *********************************************************/
  1077. void HAL_FDCAN_TxEventFifoCallback(FDCAN_HandleTypeDef *hfdcan, uint32_t TxEventFifoITs);
  1078. void HAL_FDCAN_RxFifo0Callback(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs);
  1079. void HAL_FDCAN_RxFifo1Callback(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo1ITs);
  1080. void HAL_FDCAN_TxFifoEmptyCallback(FDCAN_HandleTypeDef *hfdcan);
  1081. void HAL_FDCAN_TxBufferCompleteCallback(FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes);
  1082. void HAL_FDCAN_TxBufferAbortCallback(FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes);
  1083. void HAL_FDCAN_HighPriorityMessageCallback(FDCAN_HandleTypeDef *hfdcan);
  1084. void HAL_FDCAN_TimestampWraparoundCallback(FDCAN_HandleTypeDef *hfdcan);
  1085. void HAL_FDCAN_TimeoutOccurredCallback(FDCAN_HandleTypeDef *hfdcan);
  1086. void HAL_FDCAN_ErrorCallback(FDCAN_HandleTypeDef *hfdcan);
  1087. void HAL_FDCAN_ErrorStatusCallback(FDCAN_HandleTypeDef *hfdcan, uint32_t ErrorStatusITs);
  1088. /**
  1089. * @}
  1090. */
  1091. /** @addtogroup FDCAN_Exported_Functions_Group6
  1092. * @{
  1093. */
  1094. /* Peripheral State functions *************************************************/
  1095. uint32_t HAL_FDCAN_GetError(const FDCAN_HandleTypeDef *hfdcan);
  1096. HAL_FDCAN_StateTypeDef HAL_FDCAN_GetState(const FDCAN_HandleTypeDef *hfdcan);
  1097. /**
  1098. * @}
  1099. */
  1100. /**
  1101. * @}
  1102. */
  1103. /* Private types -------------------------------------------------------------*/
  1104. /* Private variables ---------------------------------------------------------*/
  1105. /** @defgroup FDCAN_Private_Variables FDCAN Private Variables
  1106. * @{
  1107. */
  1108. /**
  1109. * @}
  1110. */
  1111. /* Private constants ---------------------------------------------------------*/
  1112. /** @defgroup FDCAN_Private_Constants FDCAN Private Constants
  1113. * @{
  1114. */
  1115. /**
  1116. * @}
  1117. */
  1118. /* Private macros ------------------------------------------------------------*/
  1119. /** @defgroup FDCAN_Private_Macros FDCAN Private Macros
  1120. * @{
  1121. */
  1122. #define IS_FDCAN_FRAME_FORMAT(FORMAT) (((FORMAT) == FDCAN_FRAME_CLASSIC ) || \
  1123. ((FORMAT) == FDCAN_FRAME_FD_NO_BRS) || \
  1124. ((FORMAT) == FDCAN_FRAME_FD_BRS ))
  1125. #define IS_FDCAN_MODE(MODE) (((MODE) == FDCAN_MODE_NORMAL ) || \
  1126. ((MODE) == FDCAN_MODE_RESTRICTED_OPERATION) || \
  1127. ((MODE) == FDCAN_MODE_BUS_MONITORING ) || \
  1128. ((MODE) == FDCAN_MODE_INTERNAL_LOOPBACK ) || \
  1129. ((MODE) == FDCAN_MODE_EXTERNAL_LOOPBACK ))
  1130. #define IS_FDCAN_CKDIV(CKDIV) (((CKDIV) == FDCAN_CLOCK_DIV1 ) || \
  1131. ((CKDIV) == FDCAN_CLOCK_DIV2 ) || \
  1132. ((CKDIV) == FDCAN_CLOCK_DIV4 ) || \
  1133. ((CKDIV) == FDCAN_CLOCK_DIV6 ) || \
  1134. ((CKDIV) == FDCAN_CLOCK_DIV8 ) || \
  1135. ((CKDIV) == FDCAN_CLOCK_DIV10) || \
  1136. ((CKDIV) == FDCAN_CLOCK_DIV12) || \
  1137. ((CKDIV) == FDCAN_CLOCK_DIV14) || \
  1138. ((CKDIV) == FDCAN_CLOCK_DIV16) || \
  1139. ((CKDIV) == FDCAN_CLOCK_DIV18) || \
  1140. ((CKDIV) == FDCAN_CLOCK_DIV20) || \
  1141. ((CKDIV) == FDCAN_CLOCK_DIV22) || \
  1142. ((CKDIV) == FDCAN_CLOCK_DIV24) || \
  1143. ((CKDIV) == FDCAN_CLOCK_DIV26) || \
  1144. ((CKDIV) == FDCAN_CLOCK_DIV28) || \
  1145. ((CKDIV) == FDCAN_CLOCK_DIV30))
  1146. #define IS_FDCAN_NOMINAL_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 512U))
  1147. #define IS_FDCAN_NOMINAL_SJW(SJW) (((SJW) >= 1U) && ((SJW) <= 128U))
  1148. #define IS_FDCAN_NOMINAL_TSEG1(TSEG1) (((TSEG1) >= 1U) && ((TSEG1) <= 256U))
  1149. #define IS_FDCAN_NOMINAL_TSEG2(TSEG2) (((TSEG2) >= 1U) && ((TSEG2) <= 128U))
  1150. #define IS_FDCAN_DATA_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 32U))
  1151. #define IS_FDCAN_DATA_SJW(SJW) (((SJW) >= 1U) && ((SJW) <= 16U))
  1152. #define IS_FDCAN_DATA_TSEG1(TSEG1) (((TSEG1) >= 1U) && ((TSEG1) <= 32U))
  1153. #define IS_FDCAN_DATA_TSEG2(TSEG2) (((TSEG2) >= 1U) && ((TSEG2) <= 16U))
  1154. #define IS_FDCAN_MAX_VALUE(VALUE, _MAX_) ((VALUE) <= (_MAX_))
  1155. #define IS_FDCAN_MIN_VALUE(VALUE, _MIN_) ((VALUE) >= (_MIN_))
  1156. #define IS_FDCAN_TX_FIFO_QUEUE_MODE(MODE) (((MODE) == FDCAN_TX_FIFO_OPERATION ) || \
  1157. ((MODE) == FDCAN_TX_QUEUE_OPERATION))
  1158. #define IS_FDCAN_ID_TYPE(ID_TYPE) (((ID_TYPE) == FDCAN_STANDARD_ID) || \
  1159. ((ID_TYPE) == FDCAN_EXTENDED_ID))
  1160. #define IS_FDCAN_FILTER_CFG(CONFIG) (((CONFIG) == FDCAN_FILTER_DISABLE ) || \
  1161. ((CONFIG) == FDCAN_FILTER_TO_RXFIFO0 ) || \
  1162. ((CONFIG) == FDCAN_FILTER_TO_RXFIFO1 ) || \
  1163. ((CONFIG) == FDCAN_FILTER_REJECT ) || \
  1164. ((CONFIG) == FDCAN_FILTER_HP ) || \
  1165. ((CONFIG) == FDCAN_FILTER_TO_RXFIFO0_HP) || \
  1166. ((CONFIG) == FDCAN_FILTER_TO_RXFIFO1_HP))
  1167. #define IS_FDCAN_TX_LOCATION(LOCATION) (((LOCATION) == FDCAN_TX_BUFFER0 ) || ((LOCATION) == FDCAN_TX_BUFFER1 ) || \
  1168. ((LOCATION) == FDCAN_TX_BUFFER2 ))
  1169. #define IS_FDCAN_TX_LOCATION_LIST(LOCATION) (((LOCATION) >= FDCAN_TX_BUFFER0) && \
  1170. ((LOCATION) <= (FDCAN_TX_BUFFER0 | FDCAN_TX_BUFFER1 | FDCAN_TX_BUFFER2)))
  1171. #define IS_FDCAN_RX_FIFO(FIFO) (((FIFO) == FDCAN_RX_FIFO0) || \
  1172. ((FIFO) == FDCAN_RX_FIFO1))
  1173. #define IS_FDCAN_RX_FIFO_MODE(MODE) (((MODE) == FDCAN_RX_FIFO_BLOCKING ) || \
  1174. ((MODE) == FDCAN_RX_FIFO_OVERWRITE))
  1175. #define IS_FDCAN_STD_FILTER_TYPE(TYPE) (((TYPE) == FDCAN_FILTER_RANGE) || \
  1176. ((TYPE) == FDCAN_FILTER_DUAL ) || \
  1177. ((TYPE) == FDCAN_FILTER_MASK ))
  1178. #define IS_FDCAN_EXT_FILTER_TYPE(TYPE) (((TYPE) == FDCAN_FILTER_RANGE ) || \
  1179. ((TYPE) == FDCAN_FILTER_DUAL ) || \
  1180. ((TYPE) == FDCAN_FILTER_MASK ) || \
  1181. ((TYPE) == FDCAN_FILTER_RANGE_NO_EIDM))
  1182. #define IS_FDCAN_FRAME_TYPE(TYPE) (((TYPE) == FDCAN_DATA_FRAME ) || \
  1183. ((TYPE) == FDCAN_REMOTE_FRAME))
  1184. #define IS_FDCAN_DLC(DLC) (((DLC) == FDCAN_DLC_BYTES_0 ) || \
  1185. ((DLC) == FDCAN_DLC_BYTES_1 ) || \
  1186. ((DLC) == FDCAN_DLC_BYTES_2 ) || \
  1187. ((DLC) == FDCAN_DLC_BYTES_3 ) || \
  1188. ((DLC) == FDCAN_DLC_BYTES_4 ) || \
  1189. ((DLC) == FDCAN_DLC_BYTES_5 ) || \
  1190. ((DLC) == FDCAN_DLC_BYTES_6 ) || \
  1191. ((DLC) == FDCAN_DLC_BYTES_7 ) || \
  1192. ((DLC) == FDCAN_DLC_BYTES_8 ) || \
  1193. ((DLC) == FDCAN_DLC_BYTES_12) || \
  1194. ((DLC) == FDCAN_DLC_BYTES_16) || \
  1195. ((DLC) == FDCAN_DLC_BYTES_20) || \
  1196. ((DLC) == FDCAN_DLC_BYTES_24) || \
  1197. ((DLC) == FDCAN_DLC_BYTES_32) || \
  1198. ((DLC) == FDCAN_DLC_BYTES_48) || \
  1199. ((DLC) == FDCAN_DLC_BYTES_64))
  1200. #define IS_FDCAN_ESI(ESI) (((ESI) == FDCAN_ESI_ACTIVE ) || \
  1201. ((ESI) == FDCAN_ESI_PASSIVE))
  1202. #define IS_FDCAN_BRS(BRS) (((BRS) == FDCAN_BRS_OFF) || \
  1203. ((BRS) == FDCAN_BRS_ON ))
  1204. #define IS_FDCAN_FDF(FDF) (((FDF) == FDCAN_CLASSIC_CAN) || \
  1205. ((FDF) == FDCAN_FD_CAN ))
  1206. #define IS_FDCAN_EFC(EFC) (((EFC) == FDCAN_NO_TX_EVENTS ) || \
  1207. ((EFC) == FDCAN_STORE_TX_EVENTS))
  1208. #define IS_FDCAN_IT(IT) (((IT) & ~(FDCAN_IR_MASK)) == 0U)
  1209. #define IS_FDCAN_IT_GROUP(IT_GROUP) (((IT_GROUP) & ~(FDCAN_ILS_MASK)) == 0U)
  1210. #define IS_FDCAN_NON_MATCHING(DESTINATION) (((DESTINATION) == FDCAN_ACCEPT_IN_RX_FIFO0) || \
  1211. ((DESTINATION) == FDCAN_ACCEPT_IN_RX_FIFO1) || \
  1212. ((DESTINATION) == FDCAN_REJECT ))
  1213. #define IS_FDCAN_REJECT_REMOTE(DESTINATION) (((DESTINATION) == FDCAN_FILTER_REMOTE) || \
  1214. ((DESTINATION) == FDCAN_REJECT_REMOTE))
  1215. #define IS_FDCAN_IT_LINE(IT_LINE) (((IT_LINE) == FDCAN_INTERRUPT_LINE0) || \
  1216. ((IT_LINE) == FDCAN_INTERRUPT_LINE1))
  1217. #define IS_FDCAN_TIMESTAMP(OPERATION) (((OPERATION) == FDCAN_TIMESTAMP_INTERNAL) || \
  1218. ((OPERATION) == FDCAN_TIMESTAMP_EXTERNAL))
  1219. #define IS_FDCAN_TIMESTAMP_PRESCALER(PRESCALER) (((PRESCALER) == FDCAN_TIMESTAMP_PRESC_1 ) || \
  1220. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_2 ) || \
  1221. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_3 ) || \
  1222. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_4 ) || \
  1223. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_5 ) || \
  1224. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_6 ) || \
  1225. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_7 ) || \
  1226. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_8 ) || \
  1227. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_9 ) || \
  1228. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_10) || \
  1229. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_11) || \
  1230. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_12) || \
  1231. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_13) || \
  1232. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_14) || \
  1233. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_15) || \
  1234. ((PRESCALER) == FDCAN_TIMESTAMP_PRESC_16))
  1235. #define IS_FDCAN_TIMEOUT(OPERATION) (((OPERATION) == FDCAN_TIMEOUT_CONTINUOUS ) || \
  1236. ((OPERATION) == FDCAN_TIMEOUT_TX_EVENT_FIFO) || \
  1237. ((OPERATION) == FDCAN_TIMEOUT_RX_FIFO0 ) || \
  1238. ((OPERATION) == FDCAN_TIMEOUT_RX_FIFO1 ))
  1239. #define FDCAN_CHECK_IT_SOURCE(__IE__, __IT__) ((((__IE__) & (__IT__)) == (__IT__)) ? SET : RESET)
  1240. #define FDCAN_CHECK_FLAG(__IR__, __FLAG__) ((((__IR__) & (__FLAG__)) == (__FLAG__)) ? SET : RESET)
  1241. /**
  1242. * @}
  1243. */
  1244. /* Private functions prototypes ----------------------------------------------*/
  1245. /* Private functions ---------------------------------------------------------*/
  1246. /**
  1247. * @}
  1248. */
  1249. /**
  1250. * @}
  1251. */
  1252. #endif /* FDCAN1 */
  1253. #ifdef __cplusplus
  1254. }
  1255. #endif
  1256. #endif /* STM32G0xx_HAL_FDCAN_H */