mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Aug 20 10:45:13 2015 +0100
Revision:
613:bc40b8d2aec4
Parent:
532:fe11edbda85c
Synchronized with git revision 92ca8c7b60a283b6bb60eb65b183dac1599f0ade

Full URL: https://github.com/mbedmicro/mbed/commit/92ca8c7b60a283b6bb60eb65b183dac1599f0ade/

Nordic: update application start address in GCC linker script

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 235:685d5f11838f 1 /**
mbed_official 235:685d5f11838f 2 ******************************************************************************
mbed_official 235:685d5f11838f 3 * @file stm32f4xx_hal_can.h
mbed_official 235:685d5f11838f 4 * @author MCD Application Team
mbed_official 613:bc40b8d2aec4 5 * @version V1.3.2
mbed_official 613:bc40b8d2aec4 6 * @date 26-June-2015
mbed_official 235:685d5f11838f 7 * @brief Header file of CAN HAL module.
mbed_official 235:685d5f11838f 8 ******************************************************************************
mbed_official 235:685d5f11838f 9 * @attention
mbed_official 235:685d5f11838f 10 *
mbed_official 532:fe11edbda85c 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 235:685d5f11838f 12 *
mbed_official 235:685d5f11838f 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 235:685d5f11838f 14 * are permitted provided that the following conditions are met:
mbed_official 235:685d5f11838f 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 235:685d5f11838f 16 * this list of conditions and the following disclaimer.
mbed_official 235:685d5f11838f 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 235:685d5f11838f 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 235:685d5f11838f 19 * and/or other materials provided with the distribution.
mbed_official 235:685d5f11838f 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 235:685d5f11838f 21 * may be used to endorse or promote products derived from this software
mbed_official 235:685d5f11838f 22 * without specific prior written permission.
mbed_official 235:685d5f11838f 23 *
mbed_official 235:685d5f11838f 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 235:685d5f11838f 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 235:685d5f11838f 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 235:685d5f11838f 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 235:685d5f11838f 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 235:685d5f11838f 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 235:685d5f11838f 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 235:685d5f11838f 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 235:685d5f11838f 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 235:685d5f11838f 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 235:685d5f11838f 34 *
mbed_official 235:685d5f11838f 35 ******************************************************************************
mbed_official 235:685d5f11838f 36 */
mbed_official 235:685d5f11838f 37
mbed_official 235:685d5f11838f 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 235:685d5f11838f 39 #ifndef __STM32F4xx_HAL_CAN_H
mbed_official 235:685d5f11838f 40 #define __STM32F4xx_HAL_CAN_H
mbed_official 235:685d5f11838f 41
mbed_official 235:685d5f11838f 42 #ifdef __cplusplus
mbed_official 235:685d5f11838f 43 extern "C" {
mbed_official 235:685d5f11838f 44 #endif
mbed_official 235:685d5f11838f 45
mbed_official 532:fe11edbda85c 46 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
mbed_official 532:fe11edbda85c 47 defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
mbed_official 532:fe11edbda85c 48 defined(STM32F446xx)
mbed_official 235:685d5f11838f 49 /* Includes ------------------------------------------------------------------*/
mbed_official 235:685d5f11838f 50 #include "stm32f4xx_hal_def.h"
mbed_official 235:685d5f11838f 51
mbed_official 235:685d5f11838f 52 /** @addtogroup STM32F4xx_HAL_Driver
mbed_official 235:685d5f11838f 53 * @{
mbed_official 235:685d5f11838f 54 */
mbed_official 235:685d5f11838f 55
mbed_official 235:685d5f11838f 56 /** @addtogroup CAN
mbed_official 235:685d5f11838f 57 * @{
mbed_official 235:685d5f11838f 58 */
mbed_official 235:685d5f11838f 59
mbed_official 235:685d5f11838f 60 /* Exported types ------------------------------------------------------------*/
mbed_official 532:fe11edbda85c 61 /** @defgroup CAN_Exported_Types CAN Exported Types
mbed_official 532:fe11edbda85c 62 * @{
mbed_official 532:fe11edbda85c 63 */
mbed_official 235:685d5f11838f 64
mbed_official 532:fe11edbda85c 65 /**
mbed_official 532:fe11edbda85c 66 * @brief HAL State structures definition
mbed_official 532:fe11edbda85c 67 */
mbed_official 235:685d5f11838f 68 typedef enum
mbed_official 235:685d5f11838f 69 {
mbed_official 235:685d5f11838f 70 HAL_CAN_STATE_RESET = 0x00, /*!< CAN not yet initialized or disabled */
mbed_official 532:fe11edbda85c 71 HAL_CAN_STATE_READY = 0x01, /*!< CAN initialized and ready for use */
mbed_official 532:fe11edbda85c 72 HAL_CAN_STATE_BUSY = 0x02, /*!< CAN process is ongoing */
mbed_official 532:fe11edbda85c 73 HAL_CAN_STATE_BUSY_TX = 0x12, /*!< CAN process is ongoing */
mbed_official 532:fe11edbda85c 74 HAL_CAN_STATE_BUSY_RX = 0x22, /*!< CAN process is ongoing */
mbed_official 235:685d5f11838f 75 HAL_CAN_STATE_BUSY_TX_RX = 0x32, /*!< CAN process is ongoing */
mbed_official 235:685d5f11838f 76 HAL_CAN_STATE_TIMEOUT = 0x03, /*!< Timeout state */
mbed_official 532:fe11edbda85c 77 HAL_CAN_STATE_ERROR = 0x04 /*!< CAN error state */
mbed_official 235:685d5f11838f 78
mbed_official 235:685d5f11838f 79 }HAL_CAN_StateTypeDef;
mbed_official 235:685d5f11838f 80
mbed_official 532:fe11edbda85c 81 /**
mbed_official 235:685d5f11838f 82 * @brief CAN init structure definition
mbed_official 235:685d5f11838f 83 */
mbed_official 235:685d5f11838f 84 typedef struct
mbed_official 235:685d5f11838f 85 {
mbed_official 532:fe11edbda85c 86 uint32_t Prescaler; /*!< Specifies the length of a time quantum.
mbed_official 235:685d5f11838f 87 This parameter must be a number between Min_Data = 1 and Max_Data = 1024 */
mbed_official 532:fe11edbda85c 88
mbed_official 235:685d5f11838f 89 uint32_t Mode; /*!< Specifies the CAN operating mode.
mbed_official 235:685d5f11838f 90 This parameter can be a value of @ref CAN_operating_mode */
mbed_official 235:685d5f11838f 91
mbed_official 532:fe11edbda85c 92 uint32_t SJW; /*!< Specifies the maximum number of time quanta
mbed_official 532:fe11edbda85c 93 the CAN hardware is allowed to lengthen or
mbed_official 235:685d5f11838f 94 shorten a bit to perform resynchronization.
mbed_official 235:685d5f11838f 95 This parameter can be a value of @ref CAN_synchronisation_jump_width */
mbed_official 235:685d5f11838f 96
mbed_official 532:fe11edbda85c 97 uint32_t BS1; /*!< Specifies the number of time quanta in Bit Segment 1.
mbed_official 235:685d5f11838f 98 This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */
mbed_official 532:fe11edbda85c 99
mbed_official 235:685d5f11838f 100 uint32_t BS2; /*!< Specifies the number of time quanta in Bit Segment 2.
mbed_official 235:685d5f11838f 101 This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */
mbed_official 532:fe11edbda85c 102
mbed_official 235:685d5f11838f 103 uint32_t TTCM; /*!< Enable or disable the time triggered communication mode.
mbed_official 235:685d5f11838f 104 This parameter can be set to ENABLE or DISABLE. */
mbed_official 532:fe11edbda85c 105
mbed_official 235:685d5f11838f 106 uint32_t ABOM; /*!< Enable or disable the automatic bus-off management.
mbed_official 235:685d5f11838f 107 This parameter can be set to ENABLE or DISABLE */
mbed_official 235:685d5f11838f 108
mbed_official 532:fe11edbda85c 109 uint32_t AWUM; /*!< Enable or disable the automatic wake-up mode.
mbed_official 235:685d5f11838f 110 This parameter can be set to ENABLE or DISABLE */
mbed_official 235:685d5f11838f 111
mbed_official 235:685d5f11838f 112 uint32_t NART; /*!< Enable or disable the non-automatic retransmission mode.
mbed_official 235:685d5f11838f 113 This parameter can be set to ENABLE or DISABLE */
mbed_official 235:685d5f11838f 114
mbed_official 235:685d5f11838f 115 uint32_t RFLM; /*!< Enable or disable the receive FIFO Locked mode.
mbed_official 235:685d5f11838f 116 This parameter can be set to ENABLE or DISABLE */
mbed_official 235:685d5f11838f 117
mbed_official 235:685d5f11838f 118 uint32_t TXFP; /*!< Enable or disable the transmit FIFO priority.
mbed_official 235:685d5f11838f 119 This parameter can be set to ENABLE or DISABLE */
mbed_official 235:685d5f11838f 120 }CAN_InitTypeDef;
mbed_official 235:685d5f11838f 121
mbed_official 532:fe11edbda85c 122 /**
mbed_official 235:685d5f11838f 123 * @brief CAN filter configuration structure definition
mbed_official 235:685d5f11838f 124 */
mbed_official 235:685d5f11838f 125 typedef struct
mbed_official 235:685d5f11838f 126 {
mbed_official 235:685d5f11838f 127 uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit
mbed_official 235:685d5f11838f 128 configuration, first one for a 16-bit configuration).
mbed_official 532:fe11edbda85c 129 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
mbed_official 532:fe11edbda85c 130
mbed_official 235:685d5f11838f 131 uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit
mbed_official 235:685d5f11838f 132 configuration, second one for a 16-bit configuration).
mbed_official 532:fe11edbda85c 133 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
mbed_official 235:685d5f11838f 134
mbed_official 235:685d5f11838f 135 uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number,
mbed_official 235:685d5f11838f 136 according to the mode (MSBs for a 32-bit configuration,
mbed_official 235:685d5f11838f 137 first one for a 16-bit configuration).
mbed_official 532:fe11edbda85c 138 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
mbed_official 235:685d5f11838f 139
mbed_official 235:685d5f11838f 140 uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number,
mbed_official 235:685d5f11838f 141 according to the mode (LSBs for a 32-bit configuration,
mbed_official 235:685d5f11838f 142 second one for a 16-bit configuration).
mbed_official 532:fe11edbda85c 143 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
mbed_official 235:685d5f11838f 144
mbed_official 235:685d5f11838f 145 uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1) which will be assigned to the filter.
mbed_official 235:685d5f11838f 146 This parameter can be a value of @ref CAN_filter_FIFO */
mbed_official 532:fe11edbda85c 147
mbed_official 532:fe11edbda85c 148 uint32_t FilterNumber; /*!< Specifies the filter which will be initialized.
mbed_official 235:685d5f11838f 149 This parameter must be a number between Min_Data = 0 and Max_Data = 27 */
mbed_official 235:685d5f11838f 150
mbed_official 235:685d5f11838f 151 uint32_t FilterMode; /*!< Specifies the filter mode to be initialized.
mbed_official 235:685d5f11838f 152 This parameter can be a value of @ref CAN_filter_mode */
mbed_official 235:685d5f11838f 153
mbed_official 235:685d5f11838f 154 uint32_t FilterScale; /*!< Specifies the filter scale.
mbed_official 235:685d5f11838f 155 This parameter can be a value of @ref CAN_filter_scale */
mbed_official 235:685d5f11838f 156
mbed_official 235:685d5f11838f 157 uint32_t FilterActivation; /*!< Enable or disable the filter.
mbed_official 235:685d5f11838f 158 This parameter can be set to ENABLE or DISABLE. */
mbed_official 532:fe11edbda85c 159
mbed_official 235:685d5f11838f 160 uint32_t BankNumber; /*!< Select the start slave bank filter.
mbed_official 532:fe11edbda85c 161 This parameter must be a number between Min_Data = 0 and Max_Data = 28 */
mbed_official 532:fe11edbda85c 162
mbed_official 235:685d5f11838f 163 }CAN_FilterConfTypeDef;
mbed_official 235:685d5f11838f 164
mbed_official 532:fe11edbda85c 165 /**
mbed_official 532:fe11edbda85c 166 * @brief CAN Tx message structure definition
mbed_official 235:685d5f11838f 167 */
mbed_official 235:685d5f11838f 168 typedef struct
mbed_official 235:685d5f11838f 169 {
mbed_official 235:685d5f11838f 170 uint32_t StdId; /*!< Specifies the standard identifier.
mbed_official 532:fe11edbda85c 171 This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF */
mbed_official 532:fe11edbda85c 172
mbed_official 235:685d5f11838f 173 uint32_t ExtId; /*!< Specifies the extended identifier.
mbed_official 532:fe11edbda85c 174 This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF */
mbed_official 532:fe11edbda85c 175
mbed_official 235:685d5f11838f 176 uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted.
mbed_official 532:fe11edbda85c 177 This parameter can be a value of @ref CAN_Identifier_Type */
mbed_official 235:685d5f11838f 178
mbed_official 235:685d5f11838f 179 uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted.
mbed_official 532:fe11edbda85c 180 This parameter can be a value of @ref CAN_remote_transmission_request */
mbed_official 235:685d5f11838f 181
mbed_official 235:685d5f11838f 182 uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted.
mbed_official 235:685d5f11838f 183 This parameter must be a number between Min_Data = 0 and Max_Data = 8 */
mbed_official 235:685d5f11838f 184
mbed_official 532:fe11edbda85c 185 uint8_t Data[8]; /*!< Contains the data to be transmitted.
mbed_official 235:685d5f11838f 186 This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF */
mbed_official 532:fe11edbda85c 187
mbed_official 235:685d5f11838f 188 }CanTxMsgTypeDef;
mbed_official 235:685d5f11838f 189
mbed_official 532:fe11edbda85c 190 /**
mbed_official 532:fe11edbda85c 191 * @brief CAN Rx message structure definition
mbed_official 235:685d5f11838f 192 */
mbed_official 235:685d5f11838f 193 typedef struct
mbed_official 235:685d5f11838f 194 {
mbed_official 235:685d5f11838f 195 uint32_t StdId; /*!< Specifies the standard identifier.
mbed_official 532:fe11edbda85c 196 This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF */
mbed_official 235:685d5f11838f 197
mbed_official 235:685d5f11838f 198 uint32_t ExtId; /*!< Specifies the extended identifier.
mbed_official 532:fe11edbda85c 199 This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF */
mbed_official 235:685d5f11838f 200
mbed_official 532:fe11edbda85c 201 uint32_t IDE; /*!< Specifies the type of identifier for the message that will be received.
mbed_official 532:fe11edbda85c 202 This parameter can be a value of @ref CAN_Identifier_Type */
mbed_official 235:685d5f11838f 203
mbed_official 235:685d5f11838f 204 uint32_t RTR; /*!< Specifies the type of frame for the received message.
mbed_official 235:685d5f11838f 205 This parameter can be a value of @ref CAN_remote_transmission_request */
mbed_official 235:685d5f11838f 206
mbed_official 235:685d5f11838f 207 uint32_t DLC; /*!< Specifies the length of the frame that will be received.
mbed_official 235:685d5f11838f 208 This parameter must be a number between Min_Data = 0 and Max_Data = 8 */
mbed_official 235:685d5f11838f 209
mbed_official 532:fe11edbda85c 210 uint8_t Data[8]; /*!< Contains the data to be received.
mbed_official 235:685d5f11838f 211 This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF */
mbed_official 235:685d5f11838f 212
mbed_official 235:685d5f11838f 213 uint32_t FMI; /*!< Specifies the index of the filter the message stored in the mailbox passes through.
mbed_official 235:685d5f11838f 214 This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF */
mbed_official 532:fe11edbda85c 215
mbed_official 532:fe11edbda85c 216 uint32_t FIFONumber; /*!< Specifies the receive FIFO number.
mbed_official 235:685d5f11838f 217 This parameter can be CAN_FIFO0 or CAN_FIFO1 */
mbed_official 532:fe11edbda85c 218
mbed_official 235:685d5f11838f 219 }CanRxMsgTypeDef;
mbed_official 235:685d5f11838f 220
mbed_official 532:fe11edbda85c 221 /**
mbed_official 532:fe11edbda85c 222 * @brief CAN handle Structure definition
mbed_official 532:fe11edbda85c 223 */
mbed_official 235:685d5f11838f 224 typedef struct
mbed_official 235:685d5f11838f 225 {
mbed_official 235:685d5f11838f 226 CAN_TypeDef *Instance; /*!< Register base address */
mbed_official 532:fe11edbda85c 227
mbed_official 235:685d5f11838f 228 CAN_InitTypeDef Init; /*!< CAN required parameters */
mbed_official 532:fe11edbda85c 229
mbed_official 235:685d5f11838f 230 CanTxMsgTypeDef* pTxMsg; /*!< Pointer to transmit structure */
mbed_official 235:685d5f11838f 231
mbed_official 235:685d5f11838f 232 CanRxMsgTypeDef* pRxMsg; /*!< Pointer to reception structure */
mbed_official 532:fe11edbda85c 233
mbed_official 235:685d5f11838f 234 __IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */
mbed_official 532:fe11edbda85c 235
mbed_official 235:685d5f11838f 236 HAL_LockTypeDef Lock; /*!< CAN locking object */
mbed_official 532:fe11edbda85c 237
mbed_official 235:685d5f11838f 238 __IO uint32_t ErrorCode; /*!< CAN Error code */
mbed_official 532:fe11edbda85c 239
mbed_official 235:685d5f11838f 240 }CAN_HandleTypeDef;
mbed_official 235:685d5f11838f 241
mbed_official 532:fe11edbda85c 242 /**
mbed_official 532:fe11edbda85c 243 * @}
mbed_official 532:fe11edbda85c 244 */
mbed_official 235:685d5f11838f 245
mbed_official 532:fe11edbda85c 246 /* Exported constants --------------------------------------------------------*/
mbed_official 532:fe11edbda85c 247 /** @defgroup CAN_Exported_Constants CAN Exported Constants
mbed_official 235:685d5f11838f 248 * @{
mbed_official 235:685d5f11838f 249 */
mbed_official 235:685d5f11838f 250
mbed_official 532:fe11edbda85c 251 /** @defgroup HAL_CAN_Error_Code HAL CAN Error Code
mbed_official 235:685d5f11838f 252 * @{
mbed_official 235:685d5f11838f 253 */
mbed_official 235:685d5f11838f 254 #define HAL_CAN_ERROR_NONE 0x00 /*!< No error */
mbed_official 532:fe11edbda85c 255 #define HAL_CAN_ERROR_EWG 0x01 /*!< EWG error */
mbed_official 235:685d5f11838f 256 #define HAL_CAN_ERROR_EPV 0x02 /*!< EPV error */
mbed_official 235:685d5f11838f 257 #define HAL_CAN_ERROR_BOF 0x04 /*!< BOF error */
mbed_official 235:685d5f11838f 258 #define HAL_CAN_ERROR_STF 0x08 /*!< Stuff error */
mbed_official 235:685d5f11838f 259 #define HAL_CAN_ERROR_FOR 0x10 /*!< Form error */
mbed_official 235:685d5f11838f 260 #define HAL_CAN_ERROR_ACK 0x20 /*!< Acknowledgment error */
mbed_official 235:685d5f11838f 261 #define HAL_CAN_ERROR_BR 0x40 /*!< Bit recessive */
mbed_official 235:685d5f11838f 262 #define HAL_CAN_ERROR_BD 0x80 /*!< LEC dominant */
mbed_official 235:685d5f11838f 263 #define HAL_CAN_ERROR_CRC 0x100 /*!< LEC transfer error */
mbed_official 235:685d5f11838f 264 /**
mbed_official 235:685d5f11838f 265 * @}
mbed_official 532:fe11edbda85c 266 */
mbed_official 235:685d5f11838f 267
mbed_official 532:fe11edbda85c 268 /** @defgroup CAN_InitStatus CAN InitStatus
mbed_official 235:685d5f11838f 269 * @{
mbed_official 235:685d5f11838f 270 */
mbed_official 235:685d5f11838f 271 #define CAN_INITSTATUS_FAILED ((uint8_t)0x00) /*!< CAN initialization failed */
mbed_official 235:685d5f11838f 272 #define CAN_INITSTATUS_SUCCESS ((uint8_t)0x01) /*!< CAN initialization OK */
mbed_official 235:685d5f11838f 273 /**
mbed_official 235:685d5f11838f 274 * @}
mbed_official 235:685d5f11838f 275 */
mbed_official 235:685d5f11838f 276
mbed_official 532:fe11edbda85c 277 /** @defgroup CAN_operating_mode CAN Operating Mode
mbed_official 235:685d5f11838f 278 * @{
mbed_official 235:685d5f11838f 279 */
mbed_official 235:685d5f11838f 280 #define CAN_MODE_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */
mbed_official 235:685d5f11838f 281 #define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /*!< Loopback mode */
mbed_official 235:685d5f11838f 282 #define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /*!< Silent mode */
mbed_official 235:685d5f11838f 283 #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with silent mode */
mbed_official 235:685d5f11838f 284 /**
mbed_official 235:685d5f11838f 285 * @}
mbed_official 235:685d5f11838f 286 */
mbed_official 235:685d5f11838f 287
mbed_official 532:fe11edbda85c 288 /** @defgroup CAN_synchronisation_jump_width CAN Synchronisation Jump Width
mbed_official 235:685d5f11838f 289 * @{
mbed_official 235:685d5f11838f 290 */
mbed_official 235:685d5f11838f 291 #define CAN_SJW_1TQ ((uint32_t)0x00000000) /*!< 1 time quantum */
mbed_official 235:685d5f11838f 292 #define CAN_SJW_2TQ ((uint32_t)CAN_BTR_SJW_0) /*!< 2 time quantum */
mbed_official 235:685d5f11838f 293 #define CAN_SJW_3TQ ((uint32_t)CAN_BTR_SJW_1) /*!< 3 time quantum */
mbed_official 235:685d5f11838f 294 #define CAN_SJW_4TQ ((uint32_t)CAN_BTR_SJW) /*!< 4 time quantum */
mbed_official 235:685d5f11838f 295 /**
mbed_official 235:685d5f11838f 296 * @}
mbed_official 235:685d5f11838f 297 */
mbed_official 235:685d5f11838f 298
mbed_official 532:fe11edbda85c 299 /** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in bit segment 1
mbed_official 235:685d5f11838f 300 * @{
mbed_official 235:685d5f11838f 301 */
mbed_official 235:685d5f11838f 302 #define CAN_BS1_1TQ ((uint32_t)0x00000000) /*!< 1 time quantum */
mbed_official 235:685d5f11838f 303 #define CAN_BS1_2TQ ((uint32_t)CAN_BTR_TS1_0) /*!< 2 time quantum */
mbed_official 235:685d5f11838f 304 #define CAN_BS1_3TQ ((uint32_t)CAN_BTR_TS1_1) /*!< 3 time quantum */
mbed_official 235:685d5f11838f 305 #define CAN_BS1_4TQ ((uint32_t)(CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 4 time quantum */
mbed_official 235:685d5f11838f 306 #define CAN_BS1_5TQ ((uint32_t)CAN_BTR_TS1_2) /*!< 5 time quantum */
mbed_official 235:685d5f11838f 307 #define CAN_BS1_6TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 6 time quantum */
mbed_official 235:685d5f11838f 308 #define CAN_BS1_7TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 7 time quantum */
mbed_official 235:685d5f11838f 309 #define CAN_BS1_8TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 8 time quantum */
mbed_official 235:685d5f11838f 310 #define CAN_BS1_9TQ ((uint32_t)CAN_BTR_TS1_3) /*!< 9 time quantum */
mbed_official 235:685d5f11838f 311 #define CAN_BS1_10TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_0)) /*!< 10 time quantum */
mbed_official 235:685d5f11838f 312 #define CAN_BS1_11TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1)) /*!< 11 time quantum */
mbed_official 235:685d5f11838f 313 #define CAN_BS1_12TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 12 time quantum */
mbed_official 235:685d5f11838f 314 #define CAN_BS1_13TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2)) /*!< 13 time quantum */
mbed_official 235:685d5f11838f 315 #define CAN_BS1_14TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 14 time quantum */
mbed_official 235:685d5f11838f 316 #define CAN_BS1_15TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 15 time quantum */
mbed_official 235:685d5f11838f 317 #define CAN_BS1_16TQ ((uint32_t)CAN_BTR_TS1) /*!< 16 time quantum */
mbed_official 235:685d5f11838f 318 /**
mbed_official 235:685d5f11838f 319 * @}
mbed_official 235:685d5f11838f 320 */
mbed_official 235:685d5f11838f 321
mbed_official 532:fe11edbda85c 322 /** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in bit segment 2
mbed_official 235:685d5f11838f 323 * @{
mbed_official 235:685d5f11838f 324 */
mbed_official 235:685d5f11838f 325 #define CAN_BS2_1TQ ((uint32_t)0x00000000) /*!< 1 time quantum */
mbed_official 235:685d5f11838f 326 #define CAN_BS2_2TQ ((uint32_t)CAN_BTR_TS2_0) /*!< 2 time quantum */
mbed_official 235:685d5f11838f 327 #define CAN_BS2_3TQ ((uint32_t)CAN_BTR_TS2_1) /*!< 3 time quantum */
mbed_official 235:685d5f11838f 328 #define CAN_BS2_4TQ ((uint32_t)(CAN_BTR_TS2_1 | CAN_BTR_TS2_0)) /*!< 4 time quantum */
mbed_official 235:685d5f11838f 329 #define CAN_BS2_5TQ ((uint32_t)CAN_BTR_TS2_2) /*!< 5 time quantum */
mbed_official 235:685d5f11838f 330 #define CAN_BS2_6TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0)) /*!< 6 time quantum */
mbed_official 235:685d5f11838f 331 #define CAN_BS2_7TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1)) /*!< 7 time quantum */
mbed_official 235:685d5f11838f 332 #define CAN_BS2_8TQ ((uint32_t)CAN_BTR_TS2) /*!< 8 time quantum */
mbed_official 235:685d5f11838f 333 /**
mbed_official 235:685d5f11838f 334 * @}
mbed_official 235:685d5f11838f 335 */
mbed_official 235:685d5f11838f 336
mbed_official 532:fe11edbda85c 337 /** @defgroup CAN_filter_mode CAN Filter Mode
mbed_official 235:685d5f11838f 338 * @{
mbed_official 235:685d5f11838f 339 */
mbed_official 235:685d5f11838f 340 #define CAN_FILTERMODE_IDMASK ((uint8_t)0x00) /*!< Identifier mask mode */
mbed_official 235:685d5f11838f 341 #define CAN_FILTERMODE_IDLIST ((uint8_t)0x01) /*!< Identifier list mode */
mbed_official 235:685d5f11838f 342 /**
mbed_official 235:685d5f11838f 343 * @}
mbed_official 235:685d5f11838f 344 */
mbed_official 235:685d5f11838f 345
mbed_official 532:fe11edbda85c 346 /** @defgroup CAN_filter_scale CAN Filter Scale
mbed_official 235:685d5f11838f 347 * @{
mbed_official 235:685d5f11838f 348 */
mbed_official 235:685d5f11838f 349 #define CAN_FILTERSCALE_16BIT ((uint8_t)0x00) /*!< Two 16-bit filters */
mbed_official 235:685d5f11838f 350 #define CAN_FILTERSCALE_32BIT ((uint8_t)0x01) /*!< One 32-bit filter */
mbed_official 235:685d5f11838f 351 /**
mbed_official 235:685d5f11838f 352 * @}
mbed_official 235:685d5f11838f 353 */
mbed_official 235:685d5f11838f 354
mbed_official 532:fe11edbda85c 355 /** @defgroup CAN_filter_FIFO CAN Filter FIFO
mbed_official 235:685d5f11838f 356 * @{
mbed_official 235:685d5f11838f 357 */
mbed_official 235:685d5f11838f 358 #define CAN_FILTER_FIFO0 ((uint8_t)0x00) /*!< Filter FIFO 0 assignment for filter x */
mbed_official 235:685d5f11838f 359 #define CAN_FILTER_FIFO1 ((uint8_t)0x01) /*!< Filter FIFO 1 assignment for filter x */
mbed_official 235:685d5f11838f 360 /**
mbed_official 235:685d5f11838f 361 * @}
mbed_official 235:685d5f11838f 362 */
mbed_official 235:685d5f11838f 363
mbed_official 532:fe11edbda85c 364 /** @defgroup CAN_Identifier_Type CAN Identifier Type
mbed_official 235:685d5f11838f 365 * @{
mbed_official 235:685d5f11838f 366 */
mbed_official 532:fe11edbda85c 367 #define CAN_ID_STD ((uint32_t)0x00000000) /*!< Standard Id */
mbed_official 532:fe11edbda85c 368 #define CAN_ID_EXT ((uint32_t)0x00000004) /*!< Extended Id */
mbed_official 235:685d5f11838f 369 /**
mbed_official 235:685d5f11838f 370 * @}
mbed_official 235:685d5f11838f 371 */
mbed_official 235:685d5f11838f 372
mbed_official 532:fe11edbda85c 373 /** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request
mbed_official 235:685d5f11838f 374 * @{
mbed_official 235:685d5f11838f 375 */
mbed_official 235:685d5f11838f 376 #define CAN_RTR_DATA ((uint32_t)0x00000000) /*!< Data frame */
mbed_official 235:685d5f11838f 377 #define CAN_RTR_REMOTE ((uint32_t)0x00000002) /*!< Remote frame */
mbed_official 235:685d5f11838f 378 /**
mbed_official 235:685d5f11838f 379 * @}
mbed_official 235:685d5f11838f 380 */
mbed_official 235:685d5f11838f 381
mbed_official 532:fe11edbda85c 382 /** @defgroup CAN_receive_FIFO_number_constants CAN Receive FIFO Number Constants
mbed_official 235:685d5f11838f 383 * @{
mbed_official 235:685d5f11838f 384 */
mbed_official 235:685d5f11838f 385 #define CAN_FIFO0 ((uint8_t)0x00) /*!< CAN FIFO 0 used to receive */
mbed_official 235:685d5f11838f 386 #define CAN_FIFO1 ((uint8_t)0x01) /*!< CAN FIFO 1 used to receive */
mbed_official 235:685d5f11838f 387 /**
mbed_official 235:685d5f11838f 388 * @}
mbed_official 235:685d5f11838f 389 */
mbed_official 235:685d5f11838f 390
mbed_official 532:fe11edbda85c 391 /** @defgroup CAN_flags CAN Flags
mbed_official 235:685d5f11838f 392 * @{
mbed_official 235:685d5f11838f 393 */
mbed_official 235:685d5f11838f 394 /* If the flag is 0x3XXXXXXX, it means that it can be used with CAN_GetFlagStatus()
mbed_official 235:685d5f11838f 395 and CAN_ClearFlag() functions. */
mbed_official 532:fe11edbda85c 396 /* If the flag is 0x1XXXXXXX, it means that it can only be used with
mbed_official 235:685d5f11838f 397 CAN_GetFlagStatus() function. */
mbed_official 235:685d5f11838f 398
mbed_official 235:685d5f11838f 399 /* Transmit Flags */
mbed_official 235:685d5f11838f 400 #define CAN_FLAG_RQCP0 ((uint32_t)0x00000500) /*!< Request MailBox0 flag */
mbed_official 235:685d5f11838f 401 #define CAN_FLAG_RQCP1 ((uint32_t)0x00000508) /*!< Request MailBox1 flag */
mbed_official 235:685d5f11838f 402 #define CAN_FLAG_RQCP2 ((uint32_t)0x00000510) /*!< Request MailBox2 flag */
mbed_official 235:685d5f11838f 403 #define CAN_FLAG_TXOK0 ((uint32_t)0x00000501) /*!< Transmission OK MailBox0 flag */
mbed_official 235:685d5f11838f 404 #define CAN_FLAG_TXOK1 ((uint32_t)0x00000509) /*!< Transmission OK MailBox1 flag */
mbed_official 235:685d5f11838f 405 #define CAN_FLAG_TXOK2 ((uint32_t)0x00000511) /*!< Transmission OK MailBox2 flag */
mbed_official 235:685d5f11838f 406 #define CAN_FLAG_TME0 ((uint32_t)0x0000051A) /*!< Transmit mailbox 0 empty flag */
mbed_official 235:685d5f11838f 407 #define CAN_FLAG_TME1 ((uint32_t)0x0000051B) /*!< Transmit mailbox 0 empty flag */
mbed_official 235:685d5f11838f 408 #define CAN_FLAG_TME2 ((uint32_t)0x0000051C) /*!< Transmit mailbox 0 empty flag */
mbed_official 235:685d5f11838f 409
mbed_official 235:685d5f11838f 410 /* Receive Flags */
mbed_official 235:685d5f11838f 411 #define CAN_FLAG_FF0 ((uint32_t)0x00000203) /*!< FIFO 0 Full flag */
mbed_official 235:685d5f11838f 412 #define CAN_FLAG_FOV0 ((uint32_t)0x00000204) /*!< FIFO 0 Overrun flag */
mbed_official 235:685d5f11838f 413
mbed_official 235:685d5f11838f 414 #define CAN_FLAG_FF1 ((uint32_t)0x00000403) /*!< FIFO 1 Full flag */
mbed_official 235:685d5f11838f 415 #define CAN_FLAG_FOV1 ((uint32_t)0x00000404) /*!< FIFO 1 Overrun flag */
mbed_official 235:685d5f11838f 416
mbed_official 235:685d5f11838f 417 /* Operating Mode Flags */
mbed_official 235:685d5f11838f 418 #define CAN_FLAG_WKU ((uint32_t)0x00000103) /*!< Wake up flag */
mbed_official 235:685d5f11838f 419 #define CAN_FLAG_SLAK ((uint32_t)0x00000101) /*!< Sleep acknowledge flag */
mbed_official 235:685d5f11838f 420 #define CAN_FLAG_SLAKI ((uint32_t)0x00000104) /*!< Sleep acknowledge flag */
mbed_official 532:fe11edbda85c 421 /* @note When SLAK interrupt is disabled (SLKIE=0), no polling on SLAKI is possible.
mbed_official 235:685d5f11838f 422 In this case the SLAK bit can be polled.*/
mbed_official 235:685d5f11838f 423
mbed_official 235:685d5f11838f 424 /* Error Flags */
mbed_official 235:685d5f11838f 425 #define CAN_FLAG_EWG ((uint32_t)0x00000300) /*!< Error warning flag */
mbed_official 235:685d5f11838f 426 #define CAN_FLAG_EPV ((uint32_t)0x00000301) /*!< Error passive flag */
mbed_official 235:685d5f11838f 427 #define CAN_FLAG_BOF ((uint32_t)0x00000302) /*!< Bus-Off flag */
mbed_official 235:685d5f11838f 428 /**
mbed_official 235:685d5f11838f 429 * @}
mbed_official 235:685d5f11838f 430 */
mbed_official 235:685d5f11838f 431
mbed_official 532:fe11edbda85c 432 /** @defgroup CAN_Interrupts CAN Interrupts
mbed_official 235:685d5f11838f 433 * @{
mbed_official 532:fe11edbda85c 434 */
mbed_official 235:685d5f11838f 435 #define CAN_IT_TME ((uint32_t)CAN_IER_TMEIE) /*!< Transmit mailbox empty interrupt */
mbed_official 235:685d5f11838f 436
mbed_official 235:685d5f11838f 437 /* Receive Interrupts */
mbed_official 235:685d5f11838f 438 #define CAN_IT_FMP0 ((uint32_t)CAN_IER_FMPIE0) /*!< FIFO 0 message pending interrupt */
mbed_official 235:685d5f11838f 439 #define CAN_IT_FF0 ((uint32_t)CAN_IER_FFIE0) /*!< FIFO 0 full interrupt */
mbed_official 235:685d5f11838f 440 #define CAN_IT_FOV0 ((uint32_t)CAN_IER_FOVIE0) /*!< FIFO 0 overrun interrupt */
mbed_official 235:685d5f11838f 441 #define CAN_IT_FMP1 ((uint32_t)CAN_IER_FMPIE1) /*!< FIFO 1 message pending interrupt */
mbed_official 235:685d5f11838f 442 #define CAN_IT_FF1 ((uint32_t)CAN_IER_FFIE1) /*!< FIFO 1 full interrupt */
mbed_official 235:685d5f11838f 443 #define CAN_IT_FOV1 ((uint32_t)CAN_IER_FOVIE1) /*!< FIFO 1 overrun interrupt */
mbed_official 235:685d5f11838f 444
mbed_official 235:685d5f11838f 445 /* Operating Mode Interrupts */
mbed_official 235:685d5f11838f 446 #define CAN_IT_WKU ((uint32_t)CAN_IER_WKUIE) /*!< Wake-up interrupt */
mbed_official 235:685d5f11838f 447 #define CAN_IT_SLK ((uint32_t)CAN_IER_SLKIE) /*!< Sleep acknowledge interrupt */
mbed_official 235:685d5f11838f 448
mbed_official 235:685d5f11838f 449 /* Error Interrupts */
mbed_official 235:685d5f11838f 450 #define CAN_IT_EWG ((uint32_t)CAN_IER_EWGIE) /*!< Error warning interrupt */
mbed_official 235:685d5f11838f 451 #define CAN_IT_EPV ((uint32_t)CAN_IER_EPVIE) /*!< Error passive interrupt */
mbed_official 235:685d5f11838f 452 #define CAN_IT_BOF ((uint32_t)CAN_IER_BOFIE) /*!< Bus-off interrupt */
mbed_official 235:685d5f11838f 453 #define CAN_IT_LEC ((uint32_t)CAN_IER_LECIE) /*!< Last error code interrupt */
mbed_official 235:685d5f11838f 454 #define CAN_IT_ERR ((uint32_t)CAN_IER_ERRIE) /*!< Error Interrupt */
mbed_official 235:685d5f11838f 455 /**
mbed_official 235:685d5f11838f 456 * @}
mbed_official 235:685d5f11838f 457 */
mbed_official 235:685d5f11838f 458
mbed_official 532:fe11edbda85c 459 /** @defgroup CAN_Mailboxes_Definition CAN Mailboxes Definition
mbed_official 532:fe11edbda85c 460 * @{
mbed_official 532:fe11edbda85c 461 */
mbed_official 235:685d5f11838f 462 #define CAN_TXMAILBOX_0 ((uint8_t)0x00)
mbed_official 235:685d5f11838f 463 #define CAN_TXMAILBOX_1 ((uint8_t)0x01)
mbed_official 235:685d5f11838f 464 #define CAN_TXMAILBOX_2 ((uint8_t)0x02)
mbed_official 532:fe11edbda85c 465 /**
mbed_official 532:fe11edbda85c 466 * @}
mbed_official 532:fe11edbda85c 467 */
mbed_official 235:685d5f11838f 468
mbed_official 235:685d5f11838f 469 /**
mbed_official 235:685d5f11838f 470 * @}
mbed_official 235:685d5f11838f 471 */
mbed_official 235:685d5f11838f 472
mbed_official 235:685d5f11838f 473 /* Exported macro ------------------------------------------------------------*/
mbed_official 532:fe11edbda85c 474 /** @defgroup CAN_Exported_Macros CAN Exported Macros
mbed_official 532:fe11edbda85c 475 * @{
mbed_official 532:fe11edbda85c 476 */
mbed_official 235:685d5f11838f 477
mbed_official 235:685d5f11838f 478 /** @brief Reset CAN handle state
mbed_official 235:685d5f11838f 479 * @param __HANDLE__: specifies the CAN Handle.
mbed_official 235:685d5f11838f 480 * @retval None
mbed_official 235:685d5f11838f 481 */
mbed_official 235:685d5f11838f 482 #define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CAN_STATE_RESET)
mbed_official 235:685d5f11838f 483
mbed_official 235:685d5f11838f 484 /**
mbed_official 235:685d5f11838f 485 * @brief Enable the specified CAN interrupts.
mbed_official 235:685d5f11838f 486 * @param __HANDLE__: CAN handle
mbed_official 235:685d5f11838f 487 * @param __INTERRUPT__: CAN Interrupt
mbed_official 235:685d5f11838f 488 * @retval None
mbed_official 235:685d5f11838f 489 */
mbed_official 235:685d5f11838f 490 #define __HAL_CAN_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) |= (__INTERRUPT__))
mbed_official 235:685d5f11838f 491
mbed_official 235:685d5f11838f 492 /**
mbed_official 235:685d5f11838f 493 * @brief Disable the specified CAN interrupts.
mbed_official 235:685d5f11838f 494 * @param __HANDLE__: CAN handle
mbed_official 235:685d5f11838f 495 * @param __INTERRUPT__: CAN Interrupt
mbed_official 235:685d5f11838f 496 * @retval None
mbed_official 235:685d5f11838f 497 */
mbed_official 235:685d5f11838f 498 #define __HAL_CAN_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) &= ~(__INTERRUPT__))
mbed_official 235:685d5f11838f 499
mbed_official 235:685d5f11838f 500 /**
mbed_official 235:685d5f11838f 501 * @brief Return the number of pending received messages.
mbed_official 235:685d5f11838f 502 * @param __HANDLE__: CAN handle
mbed_official 235:685d5f11838f 503 * @param __FIFONUMBER__: Receive FIFO number, CAN_FIFO0 or CAN_FIFO1.
mbed_official 235:685d5f11838f 504 * @retval The number of pending message.
mbed_official 235:685d5f11838f 505 */
mbed_official 235:685d5f11838f 506 #define __HAL_CAN_MSG_PENDING(__HANDLE__, __FIFONUMBER__) (((__FIFONUMBER__) == CAN_FIFO0)? \
mbed_official 235:685d5f11838f 507 ((uint8_t)((__HANDLE__)->Instance->RF0R&(uint32_t)0x03)) : ((uint8_t)((__HANDLE__)->Instance->RF1R&(uint32_t)0x03)))
mbed_official 235:685d5f11838f 508
mbed_official 235:685d5f11838f 509 /** @brief Check whether the specified CAN flag is set or not.
mbed_official 235:685d5f11838f 510 * @param __HANDLE__: CAN Handle
mbed_official 235:685d5f11838f 511 * @param __FLAG__: specifies the flag to check.
mbed_official 235:685d5f11838f 512 * This parameter can be one of the following values:
mbed_official 235:685d5f11838f 513 * @arg CAN_TSR_RQCP0: Request MailBox0 Flag
mbed_official 235:685d5f11838f 514 * @arg CAN_TSR_RQCP1: Request MailBox1 Flag
mbed_official 235:685d5f11838f 515 * @arg CAN_TSR_RQCP2: Request MailBox2 Flag
mbed_official 235:685d5f11838f 516 * @arg CAN_FLAG_TXOK0: Transmission OK MailBox0 Flag
mbed_official 235:685d5f11838f 517 * @arg CAN_FLAG_TXOK1: Transmission OK MailBox1 Flag
mbed_official 235:685d5f11838f 518 * @arg CAN_FLAG_TXOK2: Transmission OK MailBox2 Flag
mbed_official 235:685d5f11838f 519 * @arg CAN_FLAG_TME0: Transmit mailbox 0 empty Flag
mbed_official 235:685d5f11838f 520 * @arg CAN_FLAG_TME1: Transmit mailbox 1 empty Flag
mbed_official 235:685d5f11838f 521 * @arg CAN_FLAG_TME2: Transmit mailbox 2 empty Flag
mbed_official 235:685d5f11838f 522 * @arg CAN_FLAG_FMP0: FIFO 0 Message Pending Flag
mbed_official 235:685d5f11838f 523 * @arg CAN_FLAG_FF0: FIFO 0 Full Flag
mbed_official 235:685d5f11838f 524 * @arg CAN_FLAG_FOV0: FIFO 0 Overrun Flag
mbed_official 235:685d5f11838f 525 * @arg CAN_FLAG_FMP1: FIFO 1 Message Pending Flag
mbed_official 235:685d5f11838f 526 * @arg CAN_FLAG_FF1: FIFO 1 Full Flag
mbed_official 235:685d5f11838f 527 * @arg CAN_FLAG_FOV1: FIFO 1 Overrun Flag
mbed_official 235:685d5f11838f 528 * @arg CAN_FLAG_WKU: Wake up Flag
mbed_official 235:685d5f11838f 529 * @arg CAN_FLAG_SLAK: Sleep acknowledge Flag
mbed_official 235:685d5f11838f 530 * @arg CAN_FLAG_SLAKI: Sleep acknowledge Flag
mbed_official 235:685d5f11838f 531 * @arg CAN_FLAG_EWG: Error Warning Flag
mbed_official 235:685d5f11838f 532 * @arg CAN_FLAG_EPV: Error Passive Flag
mbed_official 235:685d5f11838f 533 * @arg CAN_FLAG_BOF: Bus-Off Flag
mbed_official 235:685d5f11838f 534 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 235:685d5f11838f 535 */
mbed_official 235:685d5f11838f 536 #define __HAL_CAN_GET_FLAG(__HANDLE__, __FLAG__) \
mbed_official 235:685d5f11838f 537 ((((__FLAG__) >> 8) == 5)? ((((__HANDLE__)->Instance->TSR) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 538 (((__FLAG__) >> 8) == 2)? ((((__HANDLE__)->Instance->RF0R) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 539 (((__FLAG__) >> 8) == 4)? ((((__HANDLE__)->Instance->RF1R) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 540 (((__FLAG__) >> 8) == 1)? ((((__HANDLE__)->Instance->MSR) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 541 ((((__HANDLE__)->Instance->ESR) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))))
mbed_official 235:685d5f11838f 542
mbed_official 235:685d5f11838f 543 /** @brief Clear the specified CAN pending flag.
mbed_official 235:685d5f11838f 544 * @param __HANDLE__: CAN Handle.
mbed_official 235:685d5f11838f 545 * @param __FLAG__: specifies the flag to check.
mbed_official 235:685d5f11838f 546 * This parameter can be one of the following values:
mbed_official 235:685d5f11838f 547 * @arg CAN_TSR_RQCP0: Request MailBox0 Flag
mbed_official 235:685d5f11838f 548 * @arg CAN_TSR_RQCP1: Request MailBox1 Flag
mbed_official 235:685d5f11838f 549 * @arg CAN_TSR_RQCP2: Request MailBox2 Flag
mbed_official 235:685d5f11838f 550 * @arg CAN_FLAG_TXOK0: Transmission OK MailBox0 Flag
mbed_official 235:685d5f11838f 551 * @arg CAN_FLAG_TXOK1: Transmission OK MailBox1 Flag
mbed_official 235:685d5f11838f 552 * @arg CAN_FLAG_TXOK2: Transmission OK MailBox2 Flag
mbed_official 235:685d5f11838f 553 * @arg CAN_FLAG_TME0: Transmit mailbox 0 empty Flag
mbed_official 235:685d5f11838f 554 * @arg CAN_FLAG_TME1: Transmit mailbox 1 empty Flag
mbed_official 235:685d5f11838f 555 * @arg CAN_FLAG_TME2: Transmit mailbox 2 empty Flag
mbed_official 235:685d5f11838f 556 * @arg CAN_FLAG_FMP0: FIFO 0 Message Pending Flag
mbed_official 235:685d5f11838f 557 * @arg CAN_FLAG_FF0: FIFO 0 Full Flag
mbed_official 235:685d5f11838f 558 * @arg CAN_FLAG_FOV0: FIFO 0 Overrun Flag
mbed_official 235:685d5f11838f 559 * @arg CAN_FLAG_FMP1: FIFO 1 Message Pending Flag
mbed_official 235:685d5f11838f 560 * @arg CAN_FLAG_FF1: FIFO 1 Full Flag
mbed_official 235:685d5f11838f 561 * @arg CAN_FLAG_FOV1: FIFO 1 Overrun Flag
mbed_official 235:685d5f11838f 562 * @arg CAN_FLAG_WKU: Wake up Flag
mbed_official 235:685d5f11838f 563 * @arg CAN_FLAG_SLAK: Sleep acknowledge Flag
mbed_official 235:685d5f11838f 564 * @arg CAN_FLAG_SLAKI: Sleep acknowledge Flag
mbed_official 235:685d5f11838f 565 * @arg CAN_FLAG_EWG: Error Warning Flag
mbed_official 235:685d5f11838f 566 * @arg CAN_FLAG_EPV: Error Passive Flag
mbed_official 235:685d5f11838f 567 * @arg CAN_FLAG_BOF: Bus-Off Flag
mbed_official 235:685d5f11838f 568 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 235:685d5f11838f 569 */
mbed_official 235:685d5f11838f 570 #define __HAL_CAN_CLEAR_FLAG(__HANDLE__, __FLAG__) \
mbed_official 235:685d5f11838f 571 ((((__FLAG__) >> 8) == 5)? (((__HANDLE__)->Instance->TSR) = ~((uint32_t)1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 572 (((__FLAG__) >> 8) == 2)? (((__HANDLE__)->Instance->RF0R) = ~((uint32_t)1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 573 (((__FLAG__) >> 8) == 4)? (((__HANDLE__)->Instance->RF1R) = ~((uint32_t)1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 574 (((__FLAG__) >> 8) == 1)? (((__HANDLE__)->Instance->MSR) = ~((uint32_t)1 << ((__FLAG__) & CAN_FLAG_MASK))): \
mbed_official 235:685d5f11838f 575 (((__HANDLE__)->Instance->ESR) = ~((uint32_t)1 << ((__FLAG__) & CAN_FLAG_MASK))))
mbed_official 235:685d5f11838f 576
mbed_official 235:685d5f11838f 577 /** @brief Check if the specified CAN interrupt source is enabled or disabled.
mbed_official 235:685d5f11838f 578 * @param __HANDLE__: CAN Handle
mbed_official 235:685d5f11838f 579 * @param __INTERRUPT__: specifies the CAN interrupt source to check.
mbed_official 235:685d5f11838f 580 * This parameter can be one of the following values:
mbed_official 235:685d5f11838f 581 * @arg CAN_IT_TME: Transmit mailbox empty interrupt enable
mbed_official 532:fe11edbda85c 582 * @arg CAN_IT_FMP0: FIFO0 message pending interrupt enable
mbed_official 235:685d5f11838f 583 * @arg CAN_IT_FMP1: FIFO1 message pending interrupt enable
mbed_official 235:685d5f11838f 584 * @retval The new state of __IT__ (TRUE or FALSE).
mbed_official 235:685d5f11838f 585 */
mbed_official 235:685d5f11838f 586 #define __HAL_CAN_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
mbed_official 235:685d5f11838f 587
mbed_official 235:685d5f11838f 588 /**
mbed_official 235:685d5f11838f 589 * @brief Check the transmission status of a CAN Frame.
mbed_official 235:685d5f11838f 590 * @param __HANDLE__: CAN Handle
mbed_official 235:685d5f11838f 591 * @param __TRANSMITMAILBOX__: the number of the mailbox that is used for transmission.
mbed_official 235:685d5f11838f 592 * @retval The new status of transmission (TRUE or FALSE).
mbed_official 235:685d5f11838f 593 */
mbed_official 235:685d5f11838f 594 #define __HAL_CAN_TRANSMIT_STATUS(__HANDLE__, __TRANSMITMAILBOX__)\
mbed_official 235:685d5f11838f 595 (((__TRANSMITMAILBOX__) == CAN_TXMAILBOX_0)? ((((__HANDLE__)->Instance->TSR) & (CAN_TSR_RQCP0 | CAN_TSR_TXOK0 | CAN_TSR_TME0)) == (CAN_TSR_RQCP0 | CAN_TSR_TXOK0 | CAN_TSR_TME0)) :\
mbed_official 235:685d5f11838f 596 ((__TRANSMITMAILBOX__) == CAN_TXMAILBOX_1)? ((((__HANDLE__)->Instance->TSR) & (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1)) == (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1)) :\
mbed_official 235:685d5f11838f 597 ((((__HANDLE__)->Instance->TSR) & (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2)) == (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2)))
mbed_official 235:685d5f11838f 598
mbed_official 235:685d5f11838f 599 /**
mbed_official 235:685d5f11838f 600 * @brief Release the specified receive FIFO.
mbed_official 235:685d5f11838f 601 * @param __HANDLE__: CAN handle
mbed_official 235:685d5f11838f 602 * @param __FIFONUMBER__: Receive FIFO number, CAN_FIFO0 or CAN_FIFO1.
mbed_official 235:685d5f11838f 603 * @retval None
mbed_official 235:685d5f11838f 604 */
mbed_official 235:685d5f11838f 605 #define __HAL_CAN_FIFO_RELEASE(__HANDLE__, __FIFONUMBER__) (((__FIFONUMBER__) == CAN_FIFO0)? \
mbed_official 532:fe11edbda85c 606 ((__HANDLE__)->Instance->RF0R |= CAN_RF0R_RFOM0) : ((__HANDLE__)->Instance->RF1R |= CAN_RF1R_RFOM1))
mbed_official 235:685d5f11838f 607
mbed_official 235:685d5f11838f 608 /**
mbed_official 235:685d5f11838f 609 * @brief Cancel a transmit request.
mbed_official 235:685d5f11838f 610 * @param __HANDLE__: CAN Handle
mbed_official 235:685d5f11838f 611 * @param __TRANSMITMAILBOX__: the number of the mailbox that is used for transmission.
mbed_official 235:685d5f11838f 612 * @retval None
mbed_official 235:685d5f11838f 613 */
mbed_official 235:685d5f11838f 614 #define __HAL_CAN_CANCEL_TRANSMIT(__HANDLE__, __TRANSMITMAILBOX__)\
mbed_official 235:685d5f11838f 615 (((__TRANSMITMAILBOX__) == CAN_TXMAILBOX_0)? ((__HANDLE__)->Instance->TSR |= CAN_TSR_ABRQ0) :\
mbed_official 235:685d5f11838f 616 ((__TRANSMITMAILBOX__) == CAN_TXMAILBOX_1)? ((__HANDLE__)->Instance->TSR |= CAN_TSR_ABRQ1) :\
mbed_official 235:685d5f11838f 617 ((__HANDLE__)->Instance->TSR |= CAN_TSR_ABRQ2))
mbed_official 235:685d5f11838f 618
mbed_official 235:685d5f11838f 619 /**
mbed_official 235:685d5f11838f 620 * @brief Enable or disable the DBG Freeze for CAN.
mbed_official 235:685d5f11838f 621 * @param __HANDLE__: CAN Handle
mbed_official 532:fe11edbda85c 622 * @param __NEWSTATE__: new state of the CAN peripheral.
mbed_official 235:685d5f11838f 623 * This parameter can be: ENABLE (CAN reception/transmission is frozen
mbed_official 532:fe11edbda85c 624 * during debug. Reception FIFOs can still be accessed/controlled normally)
mbed_official 235:685d5f11838f 625 * or DISABLE (CAN is working during debug).
mbed_official 235:685d5f11838f 626 * @retval None
mbed_official 235:685d5f11838f 627 */
mbed_official 235:685d5f11838f 628 #define __HAL_CAN_DBG_FREEZE(__HANDLE__, __NEWSTATE__) (((__NEWSTATE__) == ENABLE)? \
mbed_official 532:fe11edbda85c 629 ((__HANDLE__)->Instance->MCR |= CAN_MCR_DBF) : ((__HANDLE__)->Instance->MCR &= ~CAN_MCR_DBF))
mbed_official 532:fe11edbda85c 630
mbed_official 532:fe11edbda85c 631 /**
mbed_official 532:fe11edbda85c 632 * @}
mbed_official 532:fe11edbda85c 633 */
mbed_official 235:685d5f11838f 634
mbed_official 532:fe11edbda85c 635 /* Exported functions --------------------------------------------------------*/
mbed_official 532:fe11edbda85c 636 /** @addtogroup CAN_Exported_Functions
mbed_official 532:fe11edbda85c 637 * @{
mbed_official 532:fe11edbda85c 638 */
mbed_official 532:fe11edbda85c 639
mbed_official 532:fe11edbda85c 640 /** @addtogroup CAN_Exported_Functions_Group1
mbed_official 532:fe11edbda85c 641 * @{
mbed_official 532:fe11edbda85c 642 */
mbed_official 532:fe11edbda85c 643 /* Initialization/de-initialization functions ***********************************/
mbed_official 235:685d5f11838f 644 HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef* hcan);
mbed_official 235:685d5f11838f 645 HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef* hcan, CAN_FilterConfTypeDef* sFilterConfig);
mbed_official 235:685d5f11838f 646 HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef* hcan);
mbed_official 235:685d5f11838f 647 void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan);
mbed_official 235:685d5f11838f 648 void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan);
mbed_official 532:fe11edbda85c 649 /**
mbed_official 532:fe11edbda85c 650 * @}
mbed_official 532:fe11edbda85c 651 */
mbed_official 235:685d5f11838f 652
mbed_official 532:fe11edbda85c 653 /** @addtogroup CAN_Exported_Functions_Group2
mbed_official 532:fe11edbda85c 654 * @{
mbed_official 532:fe11edbda85c 655 */
mbed_official 235:685d5f11838f 656 /* I/O operation functions ******************************************************/
mbed_official 235:685d5f11838f 657 HAL_StatusTypeDef HAL_CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout);
mbed_official 235:685d5f11838f 658 HAL_StatusTypeDef HAL_CAN_Transmit_IT(CAN_HandleTypeDef *hcan);
mbed_official 235:685d5f11838f 659 HAL_StatusTypeDef HAL_CAN_Receive(CAN_HandleTypeDef *hcan, uint8_t FIFONumber, uint32_t Timeout);
mbed_official 235:685d5f11838f 660 HAL_StatusTypeDef HAL_CAN_Receive_IT(CAN_HandleTypeDef *hcan, uint8_t FIFONumber);
mbed_official 235:685d5f11838f 661 HAL_StatusTypeDef HAL_CAN_Sleep(CAN_HandleTypeDef *hcan);
mbed_official 235:685d5f11838f 662 HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan);
mbed_official 235:685d5f11838f 663 void HAL_CAN_IRQHandler(CAN_HandleTypeDef* hcan);
mbed_official 235:685d5f11838f 664 void HAL_CAN_TxCpltCallback(CAN_HandleTypeDef* hcan);
mbed_official 235:685d5f11838f 665 void HAL_CAN_RxCpltCallback(CAN_HandleTypeDef* hcan);
mbed_official 235:685d5f11838f 666 void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);
mbed_official 532:fe11edbda85c 667 /**
mbed_official 532:fe11edbda85c 668 * @}
mbed_official 532:fe11edbda85c 669 */
mbed_official 235:685d5f11838f 670
mbed_official 532:fe11edbda85c 671 /** @addtogroup CAN_Exported_Functions_Group3
mbed_official 532:fe11edbda85c 672 * @{
mbed_official 532:fe11edbda85c 673 */
mbed_official 532:fe11edbda85c 674 /* Peripheral State functions ***************************************************/
mbed_official 532:fe11edbda85c 675 uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan);
mbed_official 532:fe11edbda85c 676 HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef* hcan);
mbed_official 532:fe11edbda85c 677 /**
mbed_official 532:fe11edbda85c 678 * @}
mbed_official 532:fe11edbda85c 679 */
mbed_official 532:fe11edbda85c 680
mbed_official 532:fe11edbda85c 681 /**
mbed_official 532:fe11edbda85c 682 * @}
mbed_official 532:fe11edbda85c 683 */
mbed_official 532:fe11edbda85c 684
mbed_official 532:fe11edbda85c 685 /* Private types -------------------------------------------------------------*/
mbed_official 532:fe11edbda85c 686 /** @defgroup CAN_Private_Types CAN Private Types
mbed_official 532:fe11edbda85c 687 * @{
mbed_official 532:fe11edbda85c 688 */
mbed_official 532:fe11edbda85c 689
mbed_official 532:fe11edbda85c 690 /**
mbed_official 532:fe11edbda85c 691 * @}
mbed_official 532:fe11edbda85c 692 */
mbed_official 532:fe11edbda85c 693
mbed_official 532:fe11edbda85c 694 /* Private variables ---------------------------------------------------------*/
mbed_official 532:fe11edbda85c 695 /** @defgroup CAN_Private_Variables CAN Private Variables
mbed_official 532:fe11edbda85c 696 * @{
mbed_official 532:fe11edbda85c 697 */
mbed_official 532:fe11edbda85c 698
mbed_official 532:fe11edbda85c 699 /**
mbed_official 532:fe11edbda85c 700 * @}
mbed_official 532:fe11edbda85c 701 */
mbed_official 532:fe11edbda85c 702
mbed_official 532:fe11edbda85c 703 /* Private constants ---------------------------------------------------------*/
mbed_official 532:fe11edbda85c 704 /** @defgroup CAN_Private_Constants CAN Private Constants
mbed_official 532:fe11edbda85c 705 * @{
mbed_official 532:fe11edbda85c 706 */
mbed_official 532:fe11edbda85c 707 #define CAN_TXSTATUS_NOMAILBOX ((uint8_t)0x04) /*!< CAN cell did not provide CAN_TxStatus_NoMailBox */
mbed_official 532:fe11edbda85c 708 #define CAN_FLAG_MASK ((uint32_t)0x000000FF)
mbed_official 532:fe11edbda85c 709 /**
mbed_official 532:fe11edbda85c 710 * @}
mbed_official 532:fe11edbda85c 711 */
mbed_official 532:fe11edbda85c 712
mbed_official 532:fe11edbda85c 713 /* Private macros ------------------------------------------------------------*/
mbed_official 532:fe11edbda85c 714 /** @defgroup CAN_Private_Macros CAN Private Macros
mbed_official 532:fe11edbda85c 715 * @{
mbed_official 532:fe11edbda85c 716 */
mbed_official 532:fe11edbda85c 717 #define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \
mbed_official 532:fe11edbda85c 718 ((MODE) == CAN_MODE_LOOPBACK)|| \
mbed_official 532:fe11edbda85c 719 ((MODE) == CAN_MODE_SILENT) || \
mbed_official 532:fe11edbda85c 720 ((MODE) == CAN_MODE_SILENT_LOOPBACK))
mbed_official 532:fe11edbda85c 721 #define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ)|| \
mbed_official 532:fe11edbda85c 722 ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ))
mbed_official 532:fe11edbda85c 723 #define IS_CAN_BS1(BS1) ((BS1) <= CAN_BS1_16TQ)
mbed_official 532:fe11edbda85c 724 #define IS_CAN_BS2(BS2) ((BS2) <= CAN_BS2_8TQ)
mbed_official 532:fe11edbda85c 725 #define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1) && ((PRESCALER) <= 1024))
mbed_official 532:fe11edbda85c 726 #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27)
mbed_official 532:fe11edbda85c 727 #define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \
mbed_official 532:fe11edbda85c 728 ((MODE) == CAN_FILTERMODE_IDLIST))
mbed_official 532:fe11edbda85c 729 #define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \
mbed_official 532:fe11edbda85c 730 ((SCALE) == CAN_FILTERSCALE_32BIT))
mbed_official 532:fe11edbda85c 731 #define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \
mbed_official 532:fe11edbda85c 732 ((FIFO) == CAN_FILTER_FIFO1))
mbed_official 532:fe11edbda85c 733 #define IS_CAN_BANKNUMBER(BANKNUMBER) ((BANKNUMBER) <= 28)
mbed_official 532:fe11edbda85c 734
mbed_official 532:fe11edbda85c 735 #define IS_CAN_TRANSMITMAILBOX(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= ((uint8_t)0x02))
mbed_official 532:fe11edbda85c 736 #define IS_CAN_STDID(STDID) ((STDID) <= ((uint32_t)0x7FF))
mbed_official 532:fe11edbda85c 737 #define IS_CAN_EXTID(EXTID) ((EXTID) <= ((uint32_t)0x1FFFFFFF))
mbed_official 532:fe11edbda85c 738 #define IS_CAN_DLC(DLC) ((DLC) <= ((uint8_t)0x08))
mbed_official 532:fe11edbda85c 739
mbed_official 532:fe11edbda85c 740 #define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \
mbed_official 532:fe11edbda85c 741 ((IDTYPE) == CAN_ID_EXT))
mbed_official 532:fe11edbda85c 742 #define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE))
mbed_official 532:fe11edbda85c 743 #define IS_CAN_FIFO(FIFO) (((FIFO) == CAN_FIFO0) || ((FIFO) == CAN_FIFO1))
mbed_official 532:fe11edbda85c 744
mbed_official 532:fe11edbda85c 745 /**
mbed_official 532:fe11edbda85c 746 * @}
mbed_official 532:fe11edbda85c 747 */
mbed_official 532:fe11edbda85c 748
mbed_official 532:fe11edbda85c 749 /* Private functions ---------------------------------------------------------*/
mbed_official 532:fe11edbda85c 750 /** @defgroup CAN_Private_Functions CAN Private Functions
mbed_official 532:fe11edbda85c 751 * @{
mbed_official 532:fe11edbda85c 752 */
mbed_official 532:fe11edbda85c 753
mbed_official 532:fe11edbda85c 754 /**
mbed_official 532:fe11edbda85c 755 * @}
mbed_official 532:fe11edbda85c 756 */
mbed_official 532:fe11edbda85c 757
mbed_official 532:fe11edbda85c 758 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */
mbed_official 235:685d5f11838f 759
mbed_official 235:685d5f11838f 760 /**
mbed_official 235:685d5f11838f 761 * @}
mbed_official 235:685d5f11838f 762 */
mbed_official 235:685d5f11838f 763
mbed_official 235:685d5f11838f 764 /**
mbed_official 235:685d5f11838f 765 * @}
mbed_official 235:685d5f11838f 766 */
mbed_official 235:685d5f11838f 767
mbed_official 235:685d5f11838f 768 #ifdef __cplusplus
mbed_official 235:685d5f11838f 769 }
mbed_official 235:685d5f11838f 770 #endif
mbed_official 235:685d5f11838f 771
mbed_official 235:685d5f11838f 772 #endif /* __STM32F4xx_CAN_H */
mbed_official 235:685d5f11838f 773
mbed_official 235:685d5f11838f 774
mbed_official 235:685d5f11838f 775 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/