6
6
******************************************************************************
7
7
* @attention
8
8
*
9
- * <h2><center>© Copyright (c) 2016 STMicroelectronics.
10
- * All rights reserved.</center></h2>
9
+ * Copyright (c) 2016 STMicroelectronics.
10
+ * All rights reserved.
11
11
*
12
- * This software component is licensed by ST under BSD 3-Clause license,
13
- * the "License"; You may not use this file except in compliance with the
14
- * License. You may obtain a copy of the License at:
15
- * opensource.org/licenses/BSD-3-Clause
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.
16
15
*
17
16
******************************************************************************
18
17
*/
@@ -103,21 +102,25 @@ typedef struct
103
102
{
104
103
uint32_t FilterIdHigh ; /*!< Specifies the filter identification number (MSBs for a 32-bit
105
104
configuration, first one for a 16-bit configuration).
106
- This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
105
+ This parameter must be a number between
106
+ Min_Data = 0x0000 and Max_Data = 0xFFFF. */
107
107
108
108
uint32_t FilterIdLow ; /*!< Specifies the filter identification number (LSBs for a 32-bit
109
109
configuration, second one for a 16-bit configuration).
110
- This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
110
+ This parameter must be a number between
111
+ Min_Data = 0x0000 and Max_Data = 0xFFFF. */
111
112
112
113
uint32_t FilterMaskIdHigh ; /*!< Specifies the filter mask number or identification number,
113
114
according to the mode (MSBs for a 32-bit configuration,
114
115
first one for a 16-bit configuration).
115
- This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
116
+ This parameter must be a number between
117
+ Min_Data = 0x0000 and Max_Data = 0xFFFF. */
116
118
117
119
uint32_t FilterMaskIdLow ; /*!< Specifies the filter mask number or identification number,
118
120
according to the mode (LSBs for a 32-bit configuration,
119
121
second one for a 16-bit configuration).
120
- This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
122
+ This parameter must be a number between
123
+ Min_Data = 0x0000 and Max_Data = 0xFFFF. */
121
124
122
125
uint32_t FilterFIFOAssignment ; /*!< Specifies the FIFO (0 or 1U) which will be assigned to the filter.
123
126
This parameter can be a value of @ref CAN_filter_FIFO */
@@ -295,11 +298,11 @@ typedef void (*pCAN_CallbackTypeDef)(CAN_HandleTypeDef *hcan); /*!< pointer to
295
298
#define HAL_CAN_ERROR_RX_FOV0 (0x00000200U) /*!< Rx FIFO0 overrun error */
296
299
#define HAL_CAN_ERROR_RX_FOV1 (0x00000400U) /*!< Rx FIFO1 overrun error */
297
300
#define HAL_CAN_ERROR_TX_ALST0 (0x00000800U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
298
- #define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 0 transmit failure due to transmit error */
301
+ #define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 0 transmit failure due to transmit error */
299
302
#define HAL_CAN_ERROR_TX_ALST1 (0x00002000U) /*!< TxMailbox 1 transmit failure due to arbitration lost */
300
- #define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to transmit error */
303
+ #define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to transmit error */
301
304
#define HAL_CAN_ERROR_TX_ALST2 (0x00008000U) /*!< TxMailbox 2 transmit failure due to arbitration lost */
302
- #define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 2 transmit failure due to transmit error */
305
+ #define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 2 transmit failure due to transmit error */
303
306
#define HAL_CAN_ERROR_TIMEOUT (0x00020000U) /*!< Timeout error */
304
307
#define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U) /*!< Peripheral not initialized */
305
308
#define HAL_CAN_ERROR_NOT_READY (0x00080000U) /*!< Peripheral not ready */
@@ -330,7 +333,8 @@ typedef void (*pCAN_CallbackTypeDef)(CAN_HandleTypeDef *hcan); /*!< pointer to
330
333
#define CAN_MODE_NORMAL (0x00000000U) /*!< Normal mode */
331
334
#define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /*!< Loopback mode */
332
335
#define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /*!< Silent mode */
333
- #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with silent mode */
336
+ #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with
337
+ silent mode */
334
338
/**
335
339
* @}
336
340
*/
@@ -645,7 +649,8 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan);
645
649
646
650
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
647
651
/* Callbacks Register/UnRegister functions ***********************************/
648
- HAL_StatusTypeDef HAL_CAN_RegisterCallback (CAN_HandleTypeDef * hcan , HAL_CAN_CallbackIDTypeDef CallbackID , void (* pCallback )(CAN_HandleTypeDef * _hcan ));
652
+ HAL_StatusTypeDef HAL_CAN_RegisterCallback (CAN_HandleTypeDef * hcan , HAL_CAN_CallbackIDTypeDef CallbackID ,
653
+ void (* pCallback )(CAN_HandleTypeDef * _hcan ));
649
654
HAL_StatusTypeDef HAL_CAN_UnRegisterCallback (CAN_HandleTypeDef * hcan , HAL_CAN_CallbackIDTypeDef CallbackID );
650
655
651
656
#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */
@@ -659,7 +664,7 @@ HAL_StatusTypeDef HAL_CAN_UnRegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_Ca
659
664
*/
660
665
661
666
/* Configuration functions ****************************************************/
662
- HAL_StatusTypeDef HAL_CAN_ConfigFilter (CAN_HandleTypeDef * hcan , CAN_FilterTypeDef * sFilterConfig );
667
+ HAL_StatusTypeDef HAL_CAN_ConfigFilter (CAN_HandleTypeDef * hcan , const CAN_FilterTypeDef * sFilterConfig );
663
668
664
669
/**
665
670
* @}
@@ -675,14 +680,16 @@ HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan);
675
680
HAL_StatusTypeDef HAL_CAN_Stop (CAN_HandleTypeDef * hcan );
676
681
HAL_StatusTypeDef HAL_CAN_RequestSleep (CAN_HandleTypeDef * hcan );
677
682
HAL_StatusTypeDef HAL_CAN_WakeUp (CAN_HandleTypeDef * hcan );
678
- uint32_t HAL_CAN_IsSleepActive (CAN_HandleTypeDef * hcan );
679
- HAL_StatusTypeDef HAL_CAN_AddTxMessage (CAN_HandleTypeDef * hcan , CAN_TxHeaderTypeDef * pHeader , uint8_t aData [], uint32_t * pTxMailbox );
683
+ uint32_t HAL_CAN_IsSleepActive (const CAN_HandleTypeDef * hcan );
684
+ HAL_StatusTypeDef HAL_CAN_AddTxMessage (CAN_HandleTypeDef * hcan , const CAN_TxHeaderTypeDef * pHeader ,
685
+ const uint8_t aData [], uint32_t * pTxMailbox );
680
686
HAL_StatusTypeDef HAL_CAN_AbortTxRequest (CAN_HandleTypeDef * hcan , uint32_t TxMailboxes );
681
- uint32_t HAL_CAN_GetTxMailboxesFreeLevel (CAN_HandleTypeDef * hcan );
682
- uint32_t HAL_CAN_IsTxMessagePending (CAN_HandleTypeDef * hcan , uint32_t TxMailboxes );
683
- uint32_t HAL_CAN_GetTxTimestamp (CAN_HandleTypeDef * hcan , uint32_t TxMailbox );
684
- HAL_StatusTypeDef HAL_CAN_GetRxMessage (CAN_HandleTypeDef * hcan , uint32_t RxFifo , CAN_RxHeaderTypeDef * pHeader , uint8_t aData []);
685
- uint32_t HAL_CAN_GetRxFifoFillLevel (CAN_HandleTypeDef * hcan , uint32_t RxFifo );
687
+ uint32_t HAL_CAN_GetTxMailboxesFreeLevel (const CAN_HandleTypeDef * hcan );
688
+ uint32_t HAL_CAN_IsTxMessagePending (const CAN_HandleTypeDef * hcan , uint32_t TxMailboxes );
689
+ uint32_t HAL_CAN_GetTxTimestamp (const CAN_HandleTypeDef * hcan , uint32_t TxMailbox );
690
+ HAL_StatusTypeDef HAL_CAN_GetRxMessage (CAN_HandleTypeDef * hcan , uint32_t RxFifo ,
691
+ CAN_RxHeaderTypeDef * pHeader , uint8_t aData []);
692
+ uint32_t HAL_CAN_GetRxFifoFillLevel (const CAN_HandleTypeDef * hcan , uint32_t RxFifo );
686
693
687
694
/**
688
695
* @}
@@ -730,8 +737,8 @@ void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);
730
737
* @{
731
738
*/
732
739
/* Peripheral State and Error functions ***************************************/
733
- HAL_CAN_StateTypeDef HAL_CAN_GetState (CAN_HandleTypeDef * hcan );
734
- uint32_t HAL_CAN_GetError (CAN_HandleTypeDef * hcan );
740
+ HAL_CAN_StateTypeDef HAL_CAN_GetState (const CAN_HandleTypeDef * hcan );
741
+ uint32_t HAL_CAN_GetError (const CAN_HandleTypeDef * hcan );
735
742
HAL_StatusTypeDef HAL_CAN_ResetError (CAN_HandleTypeDef * hcan );
736
743
737
744
/**
@@ -807,7 +814,8 @@ HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan);
807
814
#define IS_CAN_TX_MAILBOX (TRANSMITMAILBOX ) (((TRANSMITMAILBOX) == CAN_TX_MAILBOX0 ) || \
808
815
((TRANSMITMAILBOX) == CAN_TX_MAILBOX1 ) || \
809
816
((TRANSMITMAILBOX) == CAN_TX_MAILBOX2 ))
810
- #define IS_CAN_TX_MAILBOX_LIST (TRANSMITMAILBOX ) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | CAN_TX_MAILBOX2))
817
+ #define IS_CAN_TX_MAILBOX_LIST (TRANSMITMAILBOX ) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | \
818
+ CAN_TX_MAILBOX2))
811
819
#define IS_CAN_STDID (STDID ) ((STDID) <= 0x7FFU)
812
820
#define IS_CAN_EXTID (EXTID ) ((EXTID) <= 0x1FFFFFFFU)
813
821
#define IS_CAN_DLC (DLC ) ((DLC) <= 8U)
@@ -843,6 +851,3 @@ HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan);
843
851
#endif
844
852
845
853
#endif /* STM32F2xx_HAL_CAN_H */
846
-
847
-
848
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 commit comments