Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /**
lypinator 0:bb348c97df44 2 ******************************************************************************
lypinator 0:bb348c97df44 3 * @file stm32f4xx_hal_can.h
lypinator 0:bb348c97df44 4 * @author MCD Application Team
lypinator 0:bb348c97df44 5 * @brief Header file of CAN HAL module.
lypinator 0:bb348c97df44 6 ******************************************************************************
lypinator 0:bb348c97df44 7 * @attention
lypinator 0:bb348c97df44 8 *
lypinator 0:bb348c97df44 9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
lypinator 0:bb348c97df44 10 *
lypinator 0:bb348c97df44 11 * Redistribution and use in source and binary forms, with or without modification,
lypinator 0:bb348c97df44 12 * are permitted provided that the following conditions are met:
lypinator 0:bb348c97df44 13 * 1. Redistributions of source code must retain the above copyright notice,
lypinator 0:bb348c97df44 14 * this list of conditions and the following disclaimer.
lypinator 0:bb348c97df44 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
lypinator 0:bb348c97df44 16 * this list of conditions and the following disclaimer in the documentation
lypinator 0:bb348c97df44 17 * and/or other materials provided with the distribution.
lypinator 0:bb348c97df44 18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
lypinator 0:bb348c97df44 19 * may be used to endorse or promote products derived from this software
lypinator 0:bb348c97df44 20 * without specific prior written permission.
lypinator 0:bb348c97df44 21 *
lypinator 0:bb348c97df44 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
lypinator 0:bb348c97df44 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
lypinator 0:bb348c97df44 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
lypinator 0:bb348c97df44 25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
lypinator 0:bb348c97df44 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
lypinator 0:bb348c97df44 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
lypinator 0:bb348c97df44 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
lypinator 0:bb348c97df44 29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
lypinator 0:bb348c97df44 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
lypinator 0:bb348c97df44 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
lypinator 0:bb348c97df44 32 *
lypinator 0:bb348c97df44 33 ******************************************************************************
lypinator 0:bb348c97df44 34 */
lypinator 0:bb348c97df44 35
lypinator 0:bb348c97df44 36 /* Define to prevent recursive inclusion -------------------------------------*/
lypinator 0:bb348c97df44 37 #ifndef STM32F4xx_HAL_CAN_H
lypinator 0:bb348c97df44 38 #define STM32F4xx_HAL_CAN_H
lypinator 0:bb348c97df44 39
lypinator 0:bb348c97df44 40 #ifdef __cplusplus
lypinator 0:bb348c97df44 41 extern "C" {
lypinator 0:bb348c97df44 42 #endif
lypinator 0:bb348c97df44 43
lypinator 0:bb348c97df44 44 /* Includes ------------------------------------------------------------------*/
lypinator 0:bb348c97df44 45 #include "stm32f4xx_hal_def.h"
lypinator 0:bb348c97df44 46
lypinator 0:bb348c97df44 47 /** @addtogroup STM32F4xx_HAL_Driver
lypinator 0:bb348c97df44 48 * @{
lypinator 0:bb348c97df44 49 */
lypinator 0:bb348c97df44 50
lypinator 0:bb348c97df44 51 #if defined (CAN1)
lypinator 0:bb348c97df44 52 /** @addtogroup CAN
lypinator 0:bb348c97df44 53 * @{
lypinator 0:bb348c97df44 54 */
lypinator 0:bb348c97df44 55
lypinator 0:bb348c97df44 56 /* Exported types ------------------------------------------------------------*/
lypinator 0:bb348c97df44 57 /** @defgroup CAN_Exported_Types CAN Exported Types
lypinator 0:bb348c97df44 58 * @{
lypinator 0:bb348c97df44 59 */
lypinator 0:bb348c97df44 60 /**
lypinator 0:bb348c97df44 61 * @brief HAL State structures definition
lypinator 0:bb348c97df44 62 */
lypinator 0:bb348c97df44 63 typedef enum
lypinator 0:bb348c97df44 64 {
lypinator 0:bb348c97df44 65 HAL_CAN_STATE_RESET = 0x00U, /*!< CAN not yet initialized or disabled */
lypinator 0:bb348c97df44 66 HAL_CAN_STATE_READY = 0x01U, /*!< CAN initialized and ready for use */
lypinator 0:bb348c97df44 67 HAL_CAN_STATE_LISTENING = 0x02U, /*!< CAN receive process is ongoing */
lypinator 0:bb348c97df44 68 HAL_CAN_STATE_SLEEP_PENDING = 0x03U, /*!< CAN sleep request is pending */
lypinator 0:bb348c97df44 69 HAL_CAN_STATE_SLEEP_ACTIVE = 0x04U, /*!< CAN sleep mode is active */
lypinator 0:bb348c97df44 70 HAL_CAN_STATE_ERROR = 0x05U /*!< CAN error state */
lypinator 0:bb348c97df44 71
lypinator 0:bb348c97df44 72 } HAL_CAN_StateTypeDef;
lypinator 0:bb348c97df44 73
lypinator 0:bb348c97df44 74 /**
lypinator 0:bb348c97df44 75 * @brief CAN init structure definition
lypinator 0:bb348c97df44 76 */
lypinator 0:bb348c97df44 77 typedef struct
lypinator 0:bb348c97df44 78 {
lypinator 0:bb348c97df44 79 uint32_t Prescaler; /*!< Specifies the length of a time quantum.
lypinator 0:bb348c97df44 80 This parameter must be a number between Min_Data = 1 and Max_Data = 1024. */
lypinator 0:bb348c97df44 81
lypinator 0:bb348c97df44 82 uint32_t Mode; /*!< Specifies the CAN operating mode.
lypinator 0:bb348c97df44 83 This parameter can be a value of @ref CAN_operating_mode */
lypinator 0:bb348c97df44 84
lypinator 0:bb348c97df44 85 uint32_t SyncJumpWidth; /*!< Specifies the maximum number of time quanta the CAN hardware
lypinator 0:bb348c97df44 86 is allowed to lengthen or shorten a bit to perform resynchronization.
lypinator 0:bb348c97df44 87 This parameter can be a value of @ref CAN_synchronisation_jump_width */
lypinator 0:bb348c97df44 88
lypinator 0:bb348c97df44 89 uint32_t TimeSeg1; /*!< Specifies the number of time quanta in Bit Segment 1.
lypinator 0:bb348c97df44 90 This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */
lypinator 0:bb348c97df44 91
lypinator 0:bb348c97df44 92 uint32_t TimeSeg2; /*!< Specifies the number of time quanta in Bit Segment 2.
lypinator 0:bb348c97df44 93 This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */
lypinator 0:bb348c97df44 94
lypinator 0:bb348c97df44 95 FunctionalState TimeTriggeredMode; /*!< Enable or disable the time triggered communication mode.
lypinator 0:bb348c97df44 96 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 97
lypinator 0:bb348c97df44 98 FunctionalState AutoBusOff; /*!< Enable or disable the automatic bus-off management.
lypinator 0:bb348c97df44 99 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 100
lypinator 0:bb348c97df44 101 FunctionalState AutoWakeUp; /*!< Enable or disable the automatic wake-up mode.
lypinator 0:bb348c97df44 102 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 103
lypinator 0:bb348c97df44 104 FunctionalState AutoRetransmission; /*!< Enable or disable the non-automatic retransmission mode.
lypinator 0:bb348c97df44 105 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 106
lypinator 0:bb348c97df44 107 FunctionalState ReceiveFifoLocked; /*!< Enable or disable the Receive FIFO Locked mode.
lypinator 0:bb348c97df44 108 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 109
lypinator 0:bb348c97df44 110 FunctionalState TransmitFifoPriority;/*!< Enable or disable the transmit FIFO priority.
lypinator 0:bb348c97df44 111 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 112
lypinator 0:bb348c97df44 113 } CAN_InitTypeDef;
lypinator 0:bb348c97df44 114
lypinator 0:bb348c97df44 115 /**
lypinator 0:bb348c97df44 116 * @brief CAN filter configuration structure definition
lypinator 0:bb348c97df44 117 */
lypinator 0:bb348c97df44 118 typedef struct
lypinator 0:bb348c97df44 119 {
lypinator 0:bb348c97df44 120 uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit
lypinator 0:bb348c97df44 121 configuration, first one for a 16-bit configuration).
lypinator 0:bb348c97df44 122 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
lypinator 0:bb348c97df44 123
lypinator 0:bb348c97df44 124 uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit
lypinator 0:bb348c97df44 125 configuration, second one for a 16-bit configuration).
lypinator 0:bb348c97df44 126 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
lypinator 0:bb348c97df44 127
lypinator 0:bb348c97df44 128 uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number,
lypinator 0:bb348c97df44 129 according to the mode (MSBs for a 32-bit configuration,
lypinator 0:bb348c97df44 130 first one for a 16-bit configuration).
lypinator 0:bb348c97df44 131 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
lypinator 0:bb348c97df44 132
lypinator 0:bb348c97df44 133 uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number,
lypinator 0:bb348c97df44 134 according to the mode (LSBs for a 32-bit configuration,
lypinator 0:bb348c97df44 135 second one for a 16-bit configuration).
lypinator 0:bb348c97df44 136 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
lypinator 0:bb348c97df44 137
lypinator 0:bb348c97df44 138 uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1U) which will be assigned to the filter.
lypinator 0:bb348c97df44 139 This parameter can be a value of @ref CAN_filter_FIFO */
lypinator 0:bb348c97df44 140
lypinator 0:bb348c97df44 141 uint32_t FilterBank; /*!< Specifies the filter bank which will be initialized.
lypinator 0:bb348c97df44 142 For single CAN instance(14 dedicated filter banks),
lypinator 0:bb348c97df44 143 this parameter must be a number between Min_Data = 0 and Max_Data = 13.
lypinator 0:bb348c97df44 144 For dual CAN instances(28 filter banks shared),
lypinator 0:bb348c97df44 145 this parameter must be a number between Min_Data = 0 and Max_Data = 27. */
lypinator 0:bb348c97df44 146
lypinator 0:bb348c97df44 147 uint32_t FilterMode; /*!< Specifies the filter mode to be initialized.
lypinator 0:bb348c97df44 148 This parameter can be a value of @ref CAN_filter_mode */
lypinator 0:bb348c97df44 149
lypinator 0:bb348c97df44 150 uint32_t FilterScale; /*!< Specifies the filter scale.
lypinator 0:bb348c97df44 151 This parameter can be a value of @ref CAN_filter_scale */
lypinator 0:bb348c97df44 152
lypinator 0:bb348c97df44 153 uint32_t FilterActivation; /*!< Enable or disable the filter.
lypinator 0:bb348c97df44 154 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 155
lypinator 0:bb348c97df44 156 uint32_t SlaveStartFilterBank; /*!< Select the start filter bank for the slave CAN instance.
lypinator 0:bb348c97df44 157 For single CAN instances, this parameter is meaningless.
lypinator 0:bb348c97df44 158 For dual CAN instances, all filter banks with lower index are assigned to master
lypinator 0:bb348c97df44 159 CAN instance, whereas all filter banks with greater index are assigned to slave
lypinator 0:bb348c97df44 160 CAN instance.
lypinator 0:bb348c97df44 161 This parameter must be a number between Min_Data = 0 and Max_Data = 27. */
lypinator 0:bb348c97df44 162
lypinator 0:bb348c97df44 163 } CAN_FilterTypeDef;
lypinator 0:bb348c97df44 164
lypinator 0:bb348c97df44 165 /**
lypinator 0:bb348c97df44 166 * @brief CAN Tx message header structure definition
lypinator 0:bb348c97df44 167 */
lypinator 0:bb348c97df44 168 typedef struct
lypinator 0:bb348c97df44 169 {
lypinator 0:bb348c97df44 170 uint32_t StdId; /*!< Specifies the standard identifier.
lypinator 0:bb348c97df44 171 This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */
lypinator 0:bb348c97df44 172
lypinator 0:bb348c97df44 173 uint32_t ExtId; /*!< Specifies the extended identifier.
lypinator 0:bb348c97df44 174 This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */
lypinator 0:bb348c97df44 175
lypinator 0:bb348c97df44 176 uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted.
lypinator 0:bb348c97df44 177 This parameter can be a value of @ref CAN_identifier_type */
lypinator 0:bb348c97df44 178
lypinator 0:bb348c97df44 179 uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted.
lypinator 0:bb348c97df44 180 This parameter can be a value of @ref CAN_remote_transmission_request */
lypinator 0:bb348c97df44 181
lypinator 0:bb348c97df44 182 uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted.
lypinator 0:bb348c97df44 183 This parameter must be a number between Min_Data = 0 and Max_Data = 8. */
lypinator 0:bb348c97df44 184
lypinator 0:bb348c97df44 185 FunctionalState TransmitGlobalTime; /*!< Specifies whether the timestamp counter value captured on start
lypinator 0:bb348c97df44 186 of frame transmission, is sent in DATA6 and DATA7 replacing pData[6] and pData[7].
lypinator 0:bb348c97df44 187 @note: Time Triggered Communication Mode must be enabled.
lypinator 0:bb348c97df44 188 @note: DLC must be programmed as 8 bytes, in order these 2 bytes are sent.
lypinator 0:bb348c97df44 189 This parameter can be set to ENABLE or DISABLE. */
lypinator 0:bb348c97df44 190
lypinator 0:bb348c97df44 191 } CAN_TxHeaderTypeDef;
lypinator 0:bb348c97df44 192
lypinator 0:bb348c97df44 193 /**
lypinator 0:bb348c97df44 194 * @brief CAN Rx message header structure definition
lypinator 0:bb348c97df44 195 */
lypinator 0:bb348c97df44 196 typedef struct
lypinator 0:bb348c97df44 197 {
lypinator 0:bb348c97df44 198 uint32_t StdId; /*!< Specifies the standard identifier.
lypinator 0:bb348c97df44 199 This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */
lypinator 0:bb348c97df44 200
lypinator 0:bb348c97df44 201 uint32_t ExtId; /*!< Specifies the extended identifier.
lypinator 0:bb348c97df44 202 This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */
lypinator 0:bb348c97df44 203
lypinator 0:bb348c97df44 204 uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted.
lypinator 0:bb348c97df44 205 This parameter can be a value of @ref CAN_identifier_type */
lypinator 0:bb348c97df44 206
lypinator 0:bb348c97df44 207 uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted.
lypinator 0:bb348c97df44 208 This parameter can be a value of @ref CAN_remote_transmission_request */
lypinator 0:bb348c97df44 209
lypinator 0:bb348c97df44 210 uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted.
lypinator 0:bb348c97df44 211 This parameter must be a number between Min_Data = 0 and Max_Data = 8. */
lypinator 0:bb348c97df44 212
lypinator 0:bb348c97df44 213 uint32_t Timestamp; /*!< Specifies the timestamp counter value captured on start of frame reception.
lypinator 0:bb348c97df44 214 @note: Time Triggered Communication Mode must be enabled.
lypinator 0:bb348c97df44 215 This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF. */
lypinator 0:bb348c97df44 216
lypinator 0:bb348c97df44 217 uint32_t FilterMatchIndex; /*!< Specifies the index of matching acceptance filter element.
lypinator 0:bb348c97df44 218 This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */
lypinator 0:bb348c97df44 219
lypinator 0:bb348c97df44 220 } CAN_RxHeaderTypeDef;
lypinator 0:bb348c97df44 221
lypinator 0:bb348c97df44 222 /**
lypinator 0:bb348c97df44 223 * @brief CAN handle Structure definition
lypinator 0:bb348c97df44 224 */
lypinator 0:bb348c97df44 225 typedef struct __CAN_HandleTypeDef
lypinator 0:bb348c97df44 226 {
lypinator 0:bb348c97df44 227 CAN_TypeDef *Instance; /*!< Register base address */
lypinator 0:bb348c97df44 228
lypinator 0:bb348c97df44 229 CAN_InitTypeDef Init; /*!< CAN required parameters */
lypinator 0:bb348c97df44 230
lypinator 0:bb348c97df44 231 __IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */
lypinator 0:bb348c97df44 232
lypinator 0:bb348c97df44 233 __IO uint32_t ErrorCode; /*!< CAN Error code.
lypinator 0:bb348c97df44 234 This parameter can be a value of @ref CAN_Error_Code */
lypinator 0:bb348c97df44 235
lypinator 0:bb348c97df44 236 } CAN_HandleTypeDef;
lypinator 0:bb348c97df44 237
lypinator 0:bb348c97df44 238 /**
lypinator 0:bb348c97df44 239 * @}
lypinator 0:bb348c97df44 240 */
lypinator 0:bb348c97df44 241
lypinator 0:bb348c97df44 242 /* Exported constants --------------------------------------------------------*/
lypinator 0:bb348c97df44 243
lypinator 0:bb348c97df44 244 /** @defgroup CAN_Exported_Constants CAN Exported Constants
lypinator 0:bb348c97df44 245 * @{
lypinator 0:bb348c97df44 246 */
lypinator 0:bb348c97df44 247
lypinator 0:bb348c97df44 248 /** @defgroup CAN_Error_Code CAN Error Code
lypinator 0:bb348c97df44 249 * @{
lypinator 0:bb348c97df44 250 */
lypinator 0:bb348c97df44 251 #define HAL_CAN_ERROR_NONE (0x00000000U) /*!< No error */
lypinator 0:bb348c97df44 252 #define HAL_CAN_ERROR_EWG (0x00000001U) /*!< Protocol Error Warning */
lypinator 0:bb348c97df44 253 #define HAL_CAN_ERROR_EPV (0x00000002U) /*!< Error Passive */
lypinator 0:bb348c97df44 254 #define HAL_CAN_ERROR_BOF (0x00000004U) /*!< Bus-off error */
lypinator 0:bb348c97df44 255 #define HAL_CAN_ERROR_STF (0x00000008U) /*!< Stuff error */
lypinator 0:bb348c97df44 256 #define HAL_CAN_ERROR_FOR (0x00000010U) /*!< Form error */
lypinator 0:bb348c97df44 257 #define HAL_CAN_ERROR_ACK (0x00000020U) /*!< Acknowledgment error */
lypinator 0:bb348c97df44 258 #define HAL_CAN_ERROR_BR (0x00000040U) /*!< Bit recessive error */
lypinator 0:bb348c97df44 259 #define HAL_CAN_ERROR_BD (0x00000080U) /*!< Bit dominant error */
lypinator 0:bb348c97df44 260 #define HAL_CAN_ERROR_CRC (0x00000100U) /*!< CRC error */
lypinator 0:bb348c97df44 261 #define HAL_CAN_ERROR_RX_FOV0 (0x00000200U) /*!< Rx FIFO0 overrun error */
lypinator 0:bb348c97df44 262 #define HAL_CAN_ERROR_RX_FOV1 (0x00000400U) /*!< Rx FIFO1 overrun error */
lypinator 0:bb348c97df44 263 #define HAL_CAN_ERROR_TX_ALST0 (0x00000800U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
lypinator 0:bb348c97df44 264 #define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 1 transmit failure due to tranmit error */
lypinator 0:bb348c97df44 265 #define HAL_CAN_ERROR_TX_ALST1 (0x00002000U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
lypinator 0:bb348c97df44 266 #define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to tranmit error */
lypinator 0:bb348c97df44 267 #define HAL_CAN_ERROR_TX_ALST2 (0x00008000U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
lypinator 0:bb348c97df44 268 #define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 1 transmit failure due to tranmit error */
lypinator 0:bb348c97df44 269 #define HAL_CAN_ERROR_TIMEOUT (0x00020000U) /*!< Timeout error */
lypinator 0:bb348c97df44 270 #define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U) /*!< Peripheral not initialized */
lypinator 0:bb348c97df44 271 #define HAL_CAN_ERROR_NOT_READY (0x00080000U) /*!< Peripheral not ready */
lypinator 0:bb348c97df44 272 #define HAL_CAN_ERROR_NOT_STARTED (0x00100000U) /*!< Peripheral not started */
lypinator 0:bb348c97df44 273 #define HAL_CAN_ERROR_PARAM (0x00200000U) /*!< Parameter error */
lypinator 0:bb348c97df44 274
lypinator 0:bb348c97df44 275 /**
lypinator 0:bb348c97df44 276 * @}
lypinator 0:bb348c97df44 277 */
lypinator 0:bb348c97df44 278
lypinator 0:bb348c97df44 279 /** @defgroup CAN_InitStatus CAN InitStatus
lypinator 0:bb348c97df44 280 * @{
lypinator 0:bb348c97df44 281 */
lypinator 0:bb348c97df44 282 #define CAN_INITSTATUS_FAILED (0x00000000U) /*!< CAN initialization failed */
lypinator 0:bb348c97df44 283 #define CAN_INITSTATUS_SUCCESS (0x00000001U) /*!< CAN initialization OK */
lypinator 0:bb348c97df44 284 /**
lypinator 0:bb348c97df44 285 * @}
lypinator 0:bb348c97df44 286 */
lypinator 0:bb348c97df44 287
lypinator 0:bb348c97df44 288 /** @defgroup CAN_operating_mode CAN Operating Mode
lypinator 0:bb348c97df44 289 * @{
lypinator 0:bb348c97df44 290 */
lypinator 0:bb348c97df44 291 #define CAN_MODE_NORMAL (0x00000000U) /*!< Normal mode */
lypinator 0:bb348c97df44 292 #define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /*!< Loopback mode */
lypinator 0:bb348c97df44 293 #define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /*!< Silent mode */
lypinator 0:bb348c97df44 294 #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with silent mode */
lypinator 0:bb348c97df44 295 /**
lypinator 0:bb348c97df44 296 * @}
lypinator 0:bb348c97df44 297 */
lypinator 0:bb348c97df44 298
lypinator 0:bb348c97df44 299
lypinator 0:bb348c97df44 300 /** @defgroup CAN_synchronisation_jump_width CAN Synchronization Jump Width
lypinator 0:bb348c97df44 301 * @{
lypinator 0:bb348c97df44 302 */
lypinator 0:bb348c97df44 303 #define CAN_SJW_1TQ (0x00000000U) /*!< 1 time quantum */
lypinator 0:bb348c97df44 304 #define CAN_SJW_2TQ ((uint32_t)CAN_BTR_SJW_0) /*!< 2 time quantum */
lypinator 0:bb348c97df44 305 #define CAN_SJW_3TQ ((uint32_t)CAN_BTR_SJW_1) /*!< 3 time quantum */
lypinator 0:bb348c97df44 306 #define CAN_SJW_4TQ ((uint32_t)CAN_BTR_SJW) /*!< 4 time quantum */
lypinator 0:bb348c97df44 307 /**
lypinator 0:bb348c97df44 308 * @}
lypinator 0:bb348c97df44 309 */
lypinator 0:bb348c97df44 310
lypinator 0:bb348c97df44 311 /** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in Bit Segment 1
lypinator 0:bb348c97df44 312 * @{
lypinator 0:bb348c97df44 313 */
lypinator 0:bb348c97df44 314 #define CAN_BS1_1TQ (0x00000000U) /*!< 1 time quantum */
lypinator 0:bb348c97df44 315 #define CAN_BS1_2TQ ((uint32_t)CAN_BTR_TS1_0) /*!< 2 time quantum */
lypinator 0:bb348c97df44 316 #define CAN_BS1_3TQ ((uint32_t)CAN_BTR_TS1_1) /*!< 3 time quantum */
lypinator 0:bb348c97df44 317 #define CAN_BS1_4TQ ((uint32_t)(CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 4 time quantum */
lypinator 0:bb348c97df44 318 #define CAN_BS1_5TQ ((uint32_t)CAN_BTR_TS1_2) /*!< 5 time quantum */
lypinator 0:bb348c97df44 319 #define CAN_BS1_6TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 6 time quantum */
lypinator 0:bb348c97df44 320 #define CAN_BS1_7TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 7 time quantum */
lypinator 0:bb348c97df44 321 #define CAN_BS1_8TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 8 time quantum */
lypinator 0:bb348c97df44 322 #define CAN_BS1_9TQ ((uint32_t)CAN_BTR_TS1_3) /*!< 9 time quantum */
lypinator 0:bb348c97df44 323 #define CAN_BS1_10TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_0)) /*!< 10 time quantum */
lypinator 0:bb348c97df44 324 #define CAN_BS1_11TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1)) /*!< 11 time quantum */
lypinator 0:bb348c97df44 325 #define CAN_BS1_12TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 12 time quantum */
lypinator 0:bb348c97df44 326 #define CAN_BS1_13TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2)) /*!< 13 time quantum */
lypinator 0:bb348c97df44 327 #define CAN_BS1_14TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 14 time quantum */
lypinator 0:bb348c97df44 328 #define CAN_BS1_15TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 15 time quantum */
lypinator 0:bb348c97df44 329 #define CAN_BS1_16TQ ((uint32_t)CAN_BTR_TS1) /*!< 16 time quantum */
lypinator 0:bb348c97df44 330 /**
lypinator 0:bb348c97df44 331 * @}
lypinator 0:bb348c97df44 332 */
lypinator 0:bb348c97df44 333
lypinator 0:bb348c97df44 334 /** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in Bit Segment 2
lypinator 0:bb348c97df44 335 * @{
lypinator 0:bb348c97df44 336 */
lypinator 0:bb348c97df44 337 #define CAN_BS2_1TQ (0x00000000U) /*!< 1 time quantum */
lypinator 0:bb348c97df44 338 #define CAN_BS2_2TQ ((uint32_t)CAN_BTR_TS2_0) /*!< 2 time quantum */
lypinator 0:bb348c97df44 339 #define CAN_BS2_3TQ ((uint32_t)CAN_BTR_TS2_1) /*!< 3 time quantum */
lypinator 0:bb348c97df44 340 #define CAN_BS2_4TQ ((uint32_t)(CAN_BTR_TS2_1 | CAN_BTR_TS2_0)) /*!< 4 time quantum */
lypinator 0:bb348c97df44 341 #define CAN_BS2_5TQ ((uint32_t)CAN_BTR_TS2_2) /*!< 5 time quantum */
lypinator 0:bb348c97df44 342 #define CAN_BS2_6TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0)) /*!< 6 time quantum */
lypinator 0:bb348c97df44 343 #define CAN_BS2_7TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1)) /*!< 7 time quantum */
lypinator 0:bb348c97df44 344 #define CAN_BS2_8TQ ((uint32_t)CAN_BTR_TS2) /*!< 8 time quantum */
lypinator 0:bb348c97df44 345 /**
lypinator 0:bb348c97df44 346 * @}
lypinator 0:bb348c97df44 347 */
lypinator 0:bb348c97df44 348
lypinator 0:bb348c97df44 349 /** @defgroup CAN_filter_mode CAN Filter Mode
lypinator 0:bb348c97df44 350 * @{
lypinator 0:bb348c97df44 351 */
lypinator 0:bb348c97df44 352 #define CAN_FILTERMODE_IDMASK (0x00000000U) /*!< Identifier mask mode */
lypinator 0:bb348c97df44 353 #define CAN_FILTERMODE_IDLIST (0x00000001U) /*!< Identifier list mode */
lypinator 0:bb348c97df44 354 /**
lypinator 0:bb348c97df44 355 * @}
lypinator 0:bb348c97df44 356 */
lypinator 0:bb348c97df44 357
lypinator 0:bb348c97df44 358 /** @defgroup CAN_filter_scale CAN Filter Scale
lypinator 0:bb348c97df44 359 * @{
lypinator 0:bb348c97df44 360 */
lypinator 0:bb348c97df44 361 #define CAN_FILTERSCALE_16BIT (0x00000000U) /*!< Two 16-bit filters */
lypinator 0:bb348c97df44 362 #define CAN_FILTERSCALE_32BIT (0x00000001U) /*!< One 32-bit filter */
lypinator 0:bb348c97df44 363 /**
lypinator 0:bb348c97df44 364 * @}
lypinator 0:bb348c97df44 365 */
lypinator 0:bb348c97df44 366
lypinator 0:bb348c97df44 367 /** @defgroup CAN_filter_FIFO CAN Filter FIFO
lypinator 0:bb348c97df44 368 * @{
lypinator 0:bb348c97df44 369 */
lypinator 0:bb348c97df44 370 #define CAN_FILTER_FIFO0 (0x00000000U) /*!< Filter FIFO 0 assignment for filter x */
lypinator 0:bb348c97df44 371 #define CAN_FILTER_FIFO1 (0x00000001U) /*!< Filter FIFO 1 assignment for filter x */
lypinator 0:bb348c97df44 372 /**
lypinator 0:bb348c97df44 373 * @}
lypinator 0:bb348c97df44 374 */
lypinator 0:bb348c97df44 375
lypinator 0:bb348c97df44 376 /** @defgroup CAN_identifier_type CAN Identifier Type
lypinator 0:bb348c97df44 377 * @{
lypinator 0:bb348c97df44 378 */
lypinator 0:bb348c97df44 379 #define CAN_ID_STD (0x00000000U) /*!< Standard Id */
lypinator 0:bb348c97df44 380 #define CAN_ID_EXT (0x00000004U) /*!< Extended Id */
lypinator 0:bb348c97df44 381 /**
lypinator 0:bb348c97df44 382 * @}
lypinator 0:bb348c97df44 383 */
lypinator 0:bb348c97df44 384
lypinator 0:bb348c97df44 385 /** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request
lypinator 0:bb348c97df44 386 * @{
lypinator 0:bb348c97df44 387 */
lypinator 0:bb348c97df44 388 #define CAN_RTR_DATA (0x00000000U) /*!< Data frame */
lypinator 0:bb348c97df44 389 #define CAN_RTR_REMOTE (0x00000002U) /*!< Remote frame */
lypinator 0:bb348c97df44 390 /**
lypinator 0:bb348c97df44 391 * @}
lypinator 0:bb348c97df44 392 */
lypinator 0:bb348c97df44 393
lypinator 0:bb348c97df44 394 /** @defgroup CAN_receive_FIFO_number CAN Receive FIFO Number
lypinator 0:bb348c97df44 395 * @{
lypinator 0:bb348c97df44 396 */
lypinator 0:bb348c97df44 397 #define CAN_RX_FIFO0 (0x00000000U) /*!< CAN receive FIFO 0 */
lypinator 0:bb348c97df44 398 #define CAN_RX_FIFO1 (0x00000001U) /*!< CAN receive FIFO 1 */
lypinator 0:bb348c97df44 399 /**
lypinator 0:bb348c97df44 400 * @}
lypinator 0:bb348c97df44 401 */
lypinator 0:bb348c97df44 402
lypinator 0:bb348c97df44 403 /** @defgroup CAN_Tx_Mailboxes CAN Tx Mailboxes
lypinator 0:bb348c97df44 404 * @{
lypinator 0:bb348c97df44 405 */
lypinator 0:bb348c97df44 406 #define CAN_TX_MAILBOX0 (0x00000001U) /*!< Tx Mailbox 0 */
lypinator 0:bb348c97df44 407 #define CAN_TX_MAILBOX1 (0x00000002U) /*!< Tx Mailbox 1 */
lypinator 0:bb348c97df44 408 #define CAN_TX_MAILBOX2 (0x00000004U) /*!< Tx Mailbox 2 */
lypinator 0:bb348c97df44 409 /**
lypinator 0:bb348c97df44 410 * @}
lypinator 0:bb348c97df44 411 */
lypinator 0:bb348c97df44 412
lypinator 0:bb348c97df44 413 /** @defgroup CAN_flags CAN Flags
lypinator 0:bb348c97df44 414 * @{
lypinator 0:bb348c97df44 415 */
lypinator 0:bb348c97df44 416 /* Transmit Flags */
lypinator 0:bb348c97df44 417 #define CAN_FLAG_RQCP0 (0x00000500U) /*!< Request complete MailBox 0 flag */
lypinator 0:bb348c97df44 418 #define CAN_FLAG_TXOK0 (0x00000501U) /*!< Transmission OK MailBox 0 flag */
lypinator 0:bb348c97df44 419 #define CAN_FLAG_ALST0 (0x00000502U) /*!< Arbitration Lost MailBox 0 flag */
lypinator 0:bb348c97df44 420 #define CAN_FLAG_TERR0 (0x00000503U) /*!< Transmission error MailBox 0 flag */
lypinator 0:bb348c97df44 421 #define CAN_FLAG_RQCP1 (0x00000508U) /*!< Request complete MailBox1 flag */
lypinator 0:bb348c97df44 422 #define CAN_FLAG_TXOK1 (0x00000509U) /*!< Transmission OK MailBox 1 flag */
lypinator 0:bb348c97df44 423 #define CAN_FLAG_ALST1 (0x0000050AU) /*!< Arbitration Lost MailBox 1 flag */
lypinator 0:bb348c97df44 424 #define CAN_FLAG_TERR1 (0x0000050BU) /*!< Transmission error MailBox 1 flag */
lypinator 0:bb348c97df44 425 #define CAN_FLAG_RQCP2 (0x00000510U) /*!< Request complete MailBox2 flag */
lypinator 0:bb348c97df44 426 #define CAN_FLAG_TXOK2 (0x00000511U) /*!< Transmission OK MailBox 2 flag */
lypinator 0:bb348c97df44 427 #define CAN_FLAG_ALST2 (0x00000512U) /*!< Arbitration Lost MailBox 2 flag */
lypinator 0:bb348c97df44 428 #define CAN_FLAG_TERR2 (0x00000513U) /*!< Transmission error MailBox 2 flag */
lypinator 0:bb348c97df44 429 #define CAN_FLAG_TME0 (0x0000051AU) /*!< Transmit mailbox 0 empty flag */
lypinator 0:bb348c97df44 430 #define CAN_FLAG_TME1 (0x0000051BU) /*!< Transmit mailbox 1 empty flag */
lypinator 0:bb348c97df44 431 #define CAN_FLAG_TME2 (0x0000051CU) /*!< Transmit mailbox 2 empty flag */
lypinator 0:bb348c97df44 432 #define CAN_FLAG_LOW0 (0x0000051DU) /*!< Lowest priority mailbox 0 flag */
lypinator 0:bb348c97df44 433 #define CAN_FLAG_LOW1 (0x0000051EU) /*!< Lowest priority mailbox 1 flag */
lypinator 0:bb348c97df44 434 #define CAN_FLAG_LOW2 (0x0000051FU) /*!< Lowest priority mailbox 2 flag */
lypinator 0:bb348c97df44 435
lypinator 0:bb348c97df44 436 /* Receive Flags */
lypinator 0:bb348c97df44 437 #define CAN_FLAG_FF0 (0x00000203U) /*!< RX FIFO 0 Full flag */
lypinator 0:bb348c97df44 438 #define CAN_FLAG_FOV0 (0x00000204U) /*!< RX FIFO 0 Overrun flag */
lypinator 0:bb348c97df44 439 #define CAN_FLAG_FF1 (0x00000403U) /*!< RX FIFO 1 Full flag */
lypinator 0:bb348c97df44 440 #define CAN_FLAG_FOV1 (0x00000404U) /*!< RX FIFO 1 Overrun flag */
lypinator 0:bb348c97df44 441
lypinator 0:bb348c97df44 442 /* Operating Mode Flags */
lypinator 0:bb348c97df44 443 #define CAN_FLAG_INAK (0x00000100U) /*!< Initialization acknowledge flag */
lypinator 0:bb348c97df44 444 #define CAN_FLAG_SLAK (0x00000101U) /*!< Sleep acknowledge flag */
lypinator 0:bb348c97df44 445 #define CAN_FLAG_ERRI (0x00000102U) /*!< Error flag */
lypinator 0:bb348c97df44 446 #define CAN_FLAG_WKU (0x00000103U) /*!< Wake up interrupt flag */
lypinator 0:bb348c97df44 447 #define CAN_FLAG_SLAKI (0x00000104U) /*!< Sleep acknowledge interrupt flag */
lypinator 0:bb348c97df44 448
lypinator 0:bb348c97df44 449 /* Error Flags */
lypinator 0:bb348c97df44 450 #define CAN_FLAG_EWG (0x00000300U) /*!< Error warning flag */
lypinator 0:bb348c97df44 451 #define CAN_FLAG_EPV (0x00000301U) /*!< Error passive flag */
lypinator 0:bb348c97df44 452 #define CAN_FLAG_BOF (0x00000302U) /*!< Bus-Off flag */
lypinator 0:bb348c97df44 453 /**
lypinator 0:bb348c97df44 454 * @}
lypinator 0:bb348c97df44 455 */
lypinator 0:bb348c97df44 456
lypinator 0:bb348c97df44 457
lypinator 0:bb348c97df44 458 /** @defgroup CAN_Interrupts CAN Interrupts
lypinator 0:bb348c97df44 459 * @{
lypinator 0:bb348c97df44 460 */
lypinator 0:bb348c97df44 461 /* Transmit Interrupt */
lypinator 0:bb348c97df44 462 #define CAN_IT_TX_MAILBOX_EMPTY ((uint32_t)CAN_IER_TMEIE) /*!< Transmit mailbox empty interrupt */
lypinator 0:bb348c97df44 463
lypinator 0:bb348c97df44 464 /* Receive Interrupts */
lypinator 0:bb348c97df44 465 #define CAN_IT_RX_FIFO0_MSG_PENDING ((uint32_t)CAN_IER_FMPIE0) /*!< FIFO 0 message pending interrupt */
lypinator 0:bb348c97df44 466 #define CAN_IT_RX_FIFO0_FULL ((uint32_t)CAN_IER_FFIE0) /*!< FIFO 0 full interrupt */
lypinator 0:bb348c97df44 467 #define CAN_IT_RX_FIFO0_OVERRUN ((uint32_t)CAN_IER_FOVIE0) /*!< FIFO 0 overrun interrupt */
lypinator 0:bb348c97df44 468 #define CAN_IT_RX_FIFO1_MSG_PENDING ((uint32_t)CAN_IER_FMPIE1) /*!< FIFO 1 message pending interrupt */
lypinator 0:bb348c97df44 469 #define CAN_IT_RX_FIFO1_FULL ((uint32_t)CAN_IER_FFIE1) /*!< FIFO 1 full interrupt */
lypinator 0:bb348c97df44 470 #define CAN_IT_RX_FIFO1_OVERRUN ((uint32_t)CAN_IER_FOVIE1) /*!< FIFO 1 overrun interrupt */
lypinator 0:bb348c97df44 471
lypinator 0:bb348c97df44 472 /* Operating Mode Interrupts */
lypinator 0:bb348c97df44 473 #define CAN_IT_WAKEUP ((uint32_t)CAN_IER_WKUIE) /*!< Wake-up interrupt */
lypinator 0:bb348c97df44 474 #define CAN_IT_SLEEP_ACK ((uint32_t)CAN_IER_SLKIE) /*!< Sleep acknowledge interrupt */
lypinator 0:bb348c97df44 475
lypinator 0:bb348c97df44 476 /* Error Interrupts */
lypinator 0:bb348c97df44 477 #define CAN_IT_ERROR_WARNING ((uint32_t)CAN_IER_EWGIE) /*!< Error warning interrupt */
lypinator 0:bb348c97df44 478 #define CAN_IT_ERROR_PASSIVE ((uint32_t)CAN_IER_EPVIE) /*!< Error passive interrupt */
lypinator 0:bb348c97df44 479 #define CAN_IT_BUSOFF ((uint32_t)CAN_IER_BOFIE) /*!< Bus-off interrupt */
lypinator 0:bb348c97df44 480 #define CAN_IT_LAST_ERROR_CODE ((uint32_t)CAN_IER_LECIE) /*!< Last error code interrupt */
lypinator 0:bb348c97df44 481 #define CAN_IT_ERROR ((uint32_t)CAN_IER_ERRIE) /*!< Error Interrupt */
lypinator 0:bb348c97df44 482 /**
lypinator 0:bb348c97df44 483 * @}
lypinator 0:bb348c97df44 484 */
lypinator 0:bb348c97df44 485
lypinator 0:bb348c97df44 486 /**
lypinator 0:bb348c97df44 487 * @}
lypinator 0:bb348c97df44 488 */
lypinator 0:bb348c97df44 489
lypinator 0:bb348c97df44 490 /* Exported macros -----------------------------------------------------------*/
lypinator 0:bb348c97df44 491 /** @defgroup CAN_Exported_Macros CAN Exported Macros
lypinator 0:bb348c97df44 492 * @{
lypinator 0:bb348c97df44 493 */
lypinator 0:bb348c97df44 494
lypinator 0:bb348c97df44 495 /** @brief Reset CAN handle state
lypinator 0:bb348c97df44 496 * @param __HANDLE__ CAN handle.
lypinator 0:bb348c97df44 497 * @retval None
lypinator 0:bb348c97df44 498 */
lypinator 0:bb348c97df44 499 #define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CAN_STATE_RESET)
lypinator 0:bb348c97df44 500
lypinator 0:bb348c97df44 501 /**
lypinator 0:bb348c97df44 502 * @brief Enable the specified CAN interrupts.
lypinator 0:bb348c97df44 503 * @param __HANDLE__ CAN handle.
lypinator 0:bb348c97df44 504 * @param __INTERRUPT__ CAN Interrupt sources to enable.
lypinator 0:bb348c97df44 505 * This parameter can be any combination of @arg CAN_Interrupts
lypinator 0:bb348c97df44 506 * @retval None
lypinator 0:bb348c97df44 507 */
lypinator 0:bb348c97df44 508 #define __HAL_CAN_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) |= (__INTERRUPT__))
lypinator 0:bb348c97df44 509
lypinator 0:bb348c97df44 510 /**
lypinator 0:bb348c97df44 511 * @brief Disable the specified CAN interrupts.
lypinator 0:bb348c97df44 512 * @param __HANDLE__ CAN handle.
lypinator 0:bb348c97df44 513 * @param __INTERRUPT__ CAN Interrupt sources to disable.
lypinator 0:bb348c97df44 514 * This parameter can be any combination of @arg CAN_Interrupts
lypinator 0:bb348c97df44 515 * @retval None
lypinator 0:bb348c97df44 516 */
lypinator 0:bb348c97df44 517 #define __HAL_CAN_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) &= ~(__INTERRUPT__))
lypinator 0:bb348c97df44 518
lypinator 0:bb348c97df44 519 /** @brief Check if the specified CAN interrupt source is enabled or disabled.
lypinator 0:bb348c97df44 520 * @param __HANDLE__ specifies the CAN Handle.
lypinator 0:bb348c97df44 521 * @param __INTERRUPT__ specifies the CAN interrupt source to check.
lypinator 0:bb348c97df44 522 * This parameter can be a value of @arg CAN_Interrupts
lypinator 0:bb348c97df44 523 * @retval The state of __IT__ (TRUE or FALSE).
lypinator 0:bb348c97df44 524 */
lypinator 0:bb348c97df44 525 #define __HAL_CAN_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) & (__INTERRUPT__))
lypinator 0:bb348c97df44 526
lypinator 0:bb348c97df44 527 /** @brief Check whether the specified CAN flag is set or not.
lypinator 0:bb348c97df44 528 * @param __HANDLE__ specifies the CAN Handle.
lypinator 0:bb348c97df44 529 * @param __FLAG__ specifies the flag to check.
lypinator 0:bb348c97df44 530 * This parameter can be one of @arg CAN_flags
lypinator 0:bb348c97df44 531 * @retval The state of __FLAG__ (TRUE or FALSE).
lypinator 0:bb348c97df44 532 */
lypinator 0:bb348c97df44 533 #define __HAL_CAN_GET_FLAG(__HANDLE__, __FLAG__) \
lypinator 0:bb348c97df44 534 ((((__FLAG__) >> 8U) == 5U)? ((((__HANDLE__)->Instance->TSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 535 (((__FLAG__) >> 8U) == 2U)? ((((__HANDLE__)->Instance->RF0R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 536 (((__FLAG__) >> 8U) == 4U)? ((((__HANDLE__)->Instance->RF1R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 537 (((__FLAG__) >> 8U) == 1U)? ((((__HANDLE__)->Instance->MSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 538 (((__FLAG__) >> 8U) == 3U)? ((((__HANDLE__)->Instance->ESR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U)
lypinator 0:bb348c97df44 539
lypinator 0:bb348c97df44 540 /** @brief Clear the specified CAN pending flag.
lypinator 0:bb348c97df44 541 * @param __HANDLE__ specifies the CAN Handle.
lypinator 0:bb348c97df44 542 * @param __FLAG__ specifies the flag to check.
lypinator 0:bb348c97df44 543 * This parameter can be one of the following values:
lypinator 0:bb348c97df44 544 * @arg CAN_FLAG_RQCP0: Request complete MailBox 0 Flag
lypinator 0:bb348c97df44 545 * @arg CAN_FLAG_TXOK0: Transmission OK MailBox 0 Flag
lypinator 0:bb348c97df44 546 * @arg CAN_FLAG_ALST0: Arbitration Lost MailBox 0 Flag
lypinator 0:bb348c97df44 547 * @arg CAN_FLAG_TERR0: Transmission error MailBox 0 Flag
lypinator 0:bb348c97df44 548 * @arg CAN_FLAG_RQCP1: Request complete MailBox 1 Flag
lypinator 0:bb348c97df44 549 * @arg CAN_FLAG_TXOK1: Transmission OK MailBox 1 Flag
lypinator 0:bb348c97df44 550 * @arg CAN_FLAG_ALST1: Arbitration Lost MailBox 1 Flag
lypinator 0:bb348c97df44 551 * @arg CAN_FLAG_TERR1: Transmission error MailBox 1 Flag
lypinator 0:bb348c97df44 552 * @arg CAN_FLAG_RQCP2: Request complete MailBox 2 Flag
lypinator 0:bb348c97df44 553 * @arg CAN_FLAG_TXOK2: Transmission OK MailBox 2 Flag
lypinator 0:bb348c97df44 554 * @arg CAN_FLAG_ALST2: Arbitration Lost MailBox 2 Flag
lypinator 0:bb348c97df44 555 * @arg CAN_FLAG_TERR2: Transmission error MailBox 2 Flag
lypinator 0:bb348c97df44 556 * @arg CAN_FLAG_FF0: RX FIFO 0 Full Flag
lypinator 0:bb348c97df44 557 * @arg CAN_FLAG_FOV0: RX FIFO 0 Overrun Flag
lypinator 0:bb348c97df44 558 * @arg CAN_FLAG_FF1: RX FIFO 1 Full Flag
lypinator 0:bb348c97df44 559 * @arg CAN_FLAG_FOV1: RX FIFO 1 Overrun Flag
lypinator 0:bb348c97df44 560 * @arg CAN_FLAG_WKUI: Wake up Interrupt Flag
lypinator 0:bb348c97df44 561 * @arg CAN_FLAG_SLAKI: Sleep acknowledge Interrupt Flag
lypinator 0:bb348c97df44 562 * @retval None
lypinator 0:bb348c97df44 563 */
lypinator 0:bb348c97df44 564 #define __HAL_CAN_CLEAR_FLAG(__HANDLE__, __FLAG__) \
lypinator 0:bb348c97df44 565 ((((__FLAG__) >> 8U) == 5U)? (((__HANDLE__)->Instance->TSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 566 (((__FLAG__) >> 8U) == 2U)? (((__HANDLE__)->Instance->RF0R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 567 (((__FLAG__) >> 8U) == 4U)? (((__HANDLE__)->Instance->RF1R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
lypinator 0:bb348c97df44 568 (((__FLAG__) >> 8U) == 1U)? (((__HANDLE__)->Instance->MSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U)
lypinator 0:bb348c97df44 569
lypinator 0:bb348c97df44 570 /**
lypinator 0:bb348c97df44 571 * @}
lypinator 0:bb348c97df44 572 */
lypinator 0:bb348c97df44 573
lypinator 0:bb348c97df44 574 /* Exported functions --------------------------------------------------------*/
lypinator 0:bb348c97df44 575 /** @addtogroup CAN_Exported_Functions CAN Exported Functions
lypinator 0:bb348c97df44 576 * @{
lypinator 0:bb348c97df44 577 */
lypinator 0:bb348c97df44 578
lypinator 0:bb348c97df44 579 /** @addtogroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions
lypinator 0:bb348c97df44 580 * @brief Initialization and Configuration functions
lypinator 0:bb348c97df44 581 * @{
lypinator 0:bb348c97df44 582 */
lypinator 0:bb348c97df44 583
lypinator 0:bb348c97df44 584 /* Initialization and de-initialization functions *****************************/
lypinator 0:bb348c97df44 585 HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 586 HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 587 void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 588 void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 589
lypinator 0:bb348c97df44 590 /**
lypinator 0:bb348c97df44 591 * @}
lypinator 0:bb348c97df44 592 */
lypinator 0:bb348c97df44 593
lypinator 0:bb348c97df44 594 /** @addtogroup CAN_Exported_Functions_Group2 Configuration functions
lypinator 0:bb348c97df44 595 * @brief Configuration functions
lypinator 0:bb348c97df44 596 * @{
lypinator 0:bb348c97df44 597 */
lypinator 0:bb348c97df44 598
lypinator 0:bb348c97df44 599 /* Configuration functions ****************************************************/
lypinator 0:bb348c97df44 600 HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef *hcan, CAN_FilterTypeDef *sFilterConfig);
lypinator 0:bb348c97df44 601
lypinator 0:bb348c97df44 602 /**
lypinator 0:bb348c97df44 603 * @}
lypinator 0:bb348c97df44 604 */
lypinator 0:bb348c97df44 605
lypinator 0:bb348c97df44 606 /** @addtogroup CAN_Exported_Functions_Group3 Control functions
lypinator 0:bb348c97df44 607 * @brief Control functions
lypinator 0:bb348c97df44 608 * @{
lypinator 0:bb348c97df44 609 */
lypinator 0:bb348c97df44 610
lypinator 0:bb348c97df44 611 /* Control functions **********************************************************/
lypinator 0:bb348c97df44 612 HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 613 HAL_StatusTypeDef HAL_CAN_Stop(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 614 HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 615 HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 616 uint32_t HAL_CAN_IsSleepActive(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 617 HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, CAN_TxHeaderTypeDef *pHeader, uint8_t aData[], uint32_t *pTxMailbox);
lypinator 0:bb348c97df44 618 HAL_StatusTypeDef HAL_CAN_AbortTxRequest(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes);
lypinator 0:bb348c97df44 619 uint32_t HAL_CAN_GetTxMailboxesFreeLevel(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 620 uint32_t HAL_CAN_IsTxMessagePending(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes);
lypinator 0:bb348c97df44 621 uint32_t HAL_CAN_GetTxTimestamp(CAN_HandleTypeDef *hcan, uint32_t TxMailbox);
lypinator 0:bb348c97df44 622 HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]);
lypinator 0:bb348c97df44 623 uint32_t HAL_CAN_GetRxFifoFillLevel(CAN_HandleTypeDef *hcan, uint32_t RxFifo);
lypinator 0:bb348c97df44 624
lypinator 0:bb348c97df44 625 /**
lypinator 0:bb348c97df44 626 * @}
lypinator 0:bb348c97df44 627 */
lypinator 0:bb348c97df44 628
lypinator 0:bb348c97df44 629 /** @addtogroup CAN_Exported_Functions_Group4 Interrupts management
lypinator 0:bb348c97df44 630 * @brief Interrupts management
lypinator 0:bb348c97df44 631 * @{
lypinator 0:bb348c97df44 632 */
lypinator 0:bb348c97df44 633 /* Interrupts management ******************************************************/
lypinator 0:bb348c97df44 634 HAL_StatusTypeDef HAL_CAN_ActivateNotification(CAN_HandleTypeDef *hcan, uint32_t ActiveITs);
lypinator 0:bb348c97df44 635 HAL_StatusTypeDef HAL_CAN_DeactivateNotification(CAN_HandleTypeDef *hcan, uint32_t InactiveITs);
lypinator 0:bb348c97df44 636 void HAL_CAN_IRQHandler(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 637
lypinator 0:bb348c97df44 638 /**
lypinator 0:bb348c97df44 639 * @}
lypinator 0:bb348c97df44 640 */
lypinator 0:bb348c97df44 641
lypinator 0:bb348c97df44 642 /** @addtogroup CAN_Exported_Functions_Group5 Callback functions
lypinator 0:bb348c97df44 643 * @brief Callback functions
lypinator 0:bb348c97df44 644 * @{
lypinator 0:bb348c97df44 645 */
lypinator 0:bb348c97df44 646 /* Callbacks functions ********************************************************/
lypinator 0:bb348c97df44 647
lypinator 0:bb348c97df44 648 void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 649 void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 650 void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 651 void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 652 void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 653 void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 654 void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 655 void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 656 void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 657 void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 658 void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 659 void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 660 void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 661
lypinator 0:bb348c97df44 662 /**
lypinator 0:bb348c97df44 663 * @}
lypinator 0:bb348c97df44 664 */
lypinator 0:bb348c97df44 665
lypinator 0:bb348c97df44 666 /** @addtogroup CAN_Exported_Functions_Group6 Peripheral State and Error functions
lypinator 0:bb348c97df44 667 * @brief CAN Peripheral State functions
lypinator 0:bb348c97df44 668 * @{
lypinator 0:bb348c97df44 669 */
lypinator 0:bb348c97df44 670 /* Peripheral State and Error functions ***************************************/
lypinator 0:bb348c97df44 671 HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 672 uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 673 HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan);
lypinator 0:bb348c97df44 674
lypinator 0:bb348c97df44 675 /**
lypinator 0:bb348c97df44 676 * @}
lypinator 0:bb348c97df44 677 */
lypinator 0:bb348c97df44 678
lypinator 0:bb348c97df44 679 /**
lypinator 0:bb348c97df44 680 * @}
lypinator 0:bb348c97df44 681 */
lypinator 0:bb348c97df44 682
lypinator 0:bb348c97df44 683 /* Private types -------------------------------------------------------------*/
lypinator 0:bb348c97df44 684 /** @defgroup CAN_Private_Types CAN Private Types
lypinator 0:bb348c97df44 685 * @{
lypinator 0:bb348c97df44 686 */
lypinator 0:bb348c97df44 687
lypinator 0:bb348c97df44 688 /**
lypinator 0:bb348c97df44 689 * @}
lypinator 0:bb348c97df44 690 */
lypinator 0:bb348c97df44 691
lypinator 0:bb348c97df44 692 /* Private variables ---------------------------------------------------------*/
lypinator 0:bb348c97df44 693 /** @defgroup CAN_Private_Variables CAN Private Variables
lypinator 0:bb348c97df44 694 * @{
lypinator 0:bb348c97df44 695 */
lypinator 0:bb348c97df44 696
lypinator 0:bb348c97df44 697 /**
lypinator 0:bb348c97df44 698 * @}
lypinator 0:bb348c97df44 699 */
lypinator 0:bb348c97df44 700
lypinator 0:bb348c97df44 701 /* Private constants ---------------------------------------------------------*/
lypinator 0:bb348c97df44 702 /** @defgroup CAN_Private_Constants CAN Private Constants
lypinator 0:bb348c97df44 703 * @{
lypinator 0:bb348c97df44 704 */
lypinator 0:bb348c97df44 705 #define CAN_FLAG_MASK (0x000000FFU)
lypinator 0:bb348c97df44 706 /**
lypinator 0:bb348c97df44 707 * @}
lypinator 0:bb348c97df44 708 */
lypinator 0:bb348c97df44 709
lypinator 0:bb348c97df44 710 /* Private Macros -----------------------------------------------------------*/
lypinator 0:bb348c97df44 711 /** @defgroup CAN_Private_Macros CAN Private Macros
lypinator 0:bb348c97df44 712 * @{
lypinator 0:bb348c97df44 713 */
lypinator 0:bb348c97df44 714
lypinator 0:bb348c97df44 715 #define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \
lypinator 0:bb348c97df44 716 ((MODE) == CAN_MODE_LOOPBACK)|| \
lypinator 0:bb348c97df44 717 ((MODE) == CAN_MODE_SILENT) || \
lypinator 0:bb348c97df44 718 ((MODE) == CAN_MODE_SILENT_LOOPBACK))
lypinator 0:bb348c97df44 719 #define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ) || \
lypinator 0:bb348c97df44 720 ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ))
lypinator 0:bb348c97df44 721 #define IS_CAN_BS1(BS1) (((BS1) == CAN_BS1_1TQ) || ((BS1) == CAN_BS1_2TQ) || \
lypinator 0:bb348c97df44 722 ((BS1) == CAN_BS1_3TQ) || ((BS1) == CAN_BS1_4TQ) || \
lypinator 0:bb348c97df44 723 ((BS1) == CAN_BS1_5TQ) || ((BS1) == CAN_BS1_6TQ) || \
lypinator 0:bb348c97df44 724 ((BS1) == CAN_BS1_7TQ) || ((BS1) == CAN_BS1_8TQ) || \
lypinator 0:bb348c97df44 725 ((BS1) == CAN_BS1_9TQ) || ((BS1) == CAN_BS1_10TQ)|| \
lypinator 0:bb348c97df44 726 ((BS1) == CAN_BS1_11TQ)|| ((BS1) == CAN_BS1_12TQ)|| \
lypinator 0:bb348c97df44 727 ((BS1) == CAN_BS1_13TQ)|| ((BS1) == CAN_BS1_14TQ)|| \
lypinator 0:bb348c97df44 728 ((BS1) == CAN_BS1_15TQ)|| ((BS1) == CAN_BS1_16TQ))
lypinator 0:bb348c97df44 729 #define IS_CAN_BS2(BS2) (((BS2) == CAN_BS2_1TQ) || ((BS2) == CAN_BS2_2TQ) || \
lypinator 0:bb348c97df44 730 ((BS2) == CAN_BS2_3TQ) || ((BS2) == CAN_BS2_4TQ) || \
lypinator 0:bb348c97df44 731 ((BS2) == CAN_BS2_5TQ) || ((BS2) == CAN_BS2_6TQ) || \
lypinator 0:bb348c97df44 732 ((BS2) == CAN_BS2_7TQ) || ((BS2) == CAN_BS2_8TQ))
lypinator 0:bb348c97df44 733 #define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 1024U))
lypinator 0:bb348c97df44 734 #define IS_CAN_FILTER_ID_HALFWORD(HALFWORD) ((HALFWORD) <= 0xFFFFU)
lypinator 0:bb348c97df44 735 #define IS_CAN_FILTER_BANK_DUAL(BANK) ((BANK) <= 27U)
lypinator 0:bb348c97df44 736 #define IS_CAN_FILTER_BANK_SINGLE(BANK) ((BANK) <= 13U)
lypinator 0:bb348c97df44 737 #define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \
lypinator 0:bb348c97df44 738 ((MODE) == CAN_FILTERMODE_IDLIST))
lypinator 0:bb348c97df44 739 #define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \
lypinator 0:bb348c97df44 740 ((SCALE) == CAN_FILTERSCALE_32BIT))
lypinator 0:bb348c97df44 741 #define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \
lypinator 0:bb348c97df44 742 ((FIFO) == CAN_FILTER_FIFO1))
lypinator 0:bb348c97df44 743 #define IS_CAN_TX_MAILBOX(TRANSMITMAILBOX) (((TRANSMITMAILBOX) == CAN_TX_MAILBOX0 ) || \
lypinator 0:bb348c97df44 744 ((TRANSMITMAILBOX) == CAN_TX_MAILBOX1 ) || \
lypinator 0:bb348c97df44 745 ((TRANSMITMAILBOX) == CAN_TX_MAILBOX2 ))
lypinator 0:bb348c97df44 746 #define IS_CAN_TX_MAILBOX_LIST(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | CAN_TX_MAILBOX2))
lypinator 0:bb348c97df44 747 #define IS_CAN_STDID(STDID) ((STDID) <= 0x7FFU)
lypinator 0:bb348c97df44 748 #define IS_CAN_EXTID(EXTID) ((EXTID) <= 0x1FFFFFFFU)
lypinator 0:bb348c97df44 749 #define IS_CAN_DLC(DLC) ((DLC) <= 8U)
lypinator 0:bb348c97df44 750 #define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \
lypinator 0:bb348c97df44 751 ((IDTYPE) == CAN_ID_EXT))
lypinator 0:bb348c97df44 752 #define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE))
lypinator 0:bb348c97df44 753 #define IS_CAN_RX_FIFO(FIFO) (((FIFO) == CAN_RX_FIFO0) || ((FIFO) == CAN_RX_FIFO1))
lypinator 0:bb348c97df44 754 #define IS_CAN_IT(IT) ((IT) <= (CAN_IT_TX_MAILBOX_EMPTY | CAN_IT_RX_FIFO0_MSG_PENDING | \
lypinator 0:bb348c97df44 755 CAN_IT_RX_FIFO0_FULL | CAN_IT_RX_FIFO0_OVERRUN | \
lypinator 0:bb348c97df44 756 CAN_IT_RX_FIFO1_MSG_PENDING | CAN_IT_RX_FIFO1_FULL | \
lypinator 0:bb348c97df44 757 CAN_IT_RX_FIFO1_OVERRUN | CAN_IT_WAKEUP | \
lypinator 0:bb348c97df44 758 CAN_IT_SLEEP_ACK | CAN_IT_ERROR_WARNING | \
lypinator 0:bb348c97df44 759 CAN_IT_ERROR_PASSIVE | CAN_IT_BUSOFF | \
lypinator 0:bb348c97df44 760 CAN_IT_LAST_ERROR_CODE | CAN_IT_ERROR))
lypinator 0:bb348c97df44 761
lypinator 0:bb348c97df44 762 /**
lypinator 0:bb348c97df44 763 * @}
lypinator 0:bb348c97df44 764 */
lypinator 0:bb348c97df44 765 /* End of private macros -----------------------------------------------------*/
lypinator 0:bb348c97df44 766
lypinator 0:bb348c97df44 767 /**
lypinator 0:bb348c97df44 768 * @}
lypinator 0:bb348c97df44 769 */
lypinator 0:bb348c97df44 770
lypinator 0:bb348c97df44 771
lypinator 0:bb348c97df44 772 #endif /* CAN1 */
lypinator 0:bb348c97df44 773 /**
lypinator 0:bb348c97df44 774 * @}
lypinator 0:bb348c97df44 775 */
lypinator 0:bb348c97df44 776
lypinator 0:bb348c97df44 777 #ifdef __cplusplus
lypinator 0:bb348c97df44 778 }
lypinator 0:bb348c97df44 779 #endif
lypinator 0:bb348c97df44 780
lypinator 0:bb348c97df44 781 #endif /* STM32F4xx_HAL_CAN_H */
lypinator 0:bb348c97df44 782
lypinator 0:bb348c97df44 783
lypinator 0:bb348c97df44 784 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/