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 Apr 03 11:45:06 2014 +0100
Revision:
149:1fb5f62b92bd
Parent:
targets/hal/TARGET_Freescale/TARGET_KSDK_MCUS/TARGET_KSDK_CODE/hal/can/fsl_flexcan_hal.h@146:f64d43ff0c18
Child:
324:406fd2029f23
Synchronized with git revision 220c0bb39ceee40016e1e86350c058963d01ed42

Full URL: https://github.com/mbedmicro/mbed/commit/220c0bb39ceee40016e1e86350c058963d01ed42/

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 146:f64d43ff0c18 1 /*
mbed_official 146:f64d43ff0c18 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 146:f64d43ff0c18 3 * All rights reserved.
mbed_official 146:f64d43ff0c18 4 *
mbed_official 146:f64d43ff0c18 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 146:f64d43ff0c18 6 * are permitted provided that the following conditions are met:
mbed_official 146:f64d43ff0c18 7 *
mbed_official 146:f64d43ff0c18 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 146:f64d43ff0c18 9 * of conditions and the following disclaimer.
mbed_official 146:f64d43ff0c18 10 *
mbed_official 146:f64d43ff0c18 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 146:f64d43ff0c18 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 146:f64d43ff0c18 13 * other materials provided with the distribution.
mbed_official 146:f64d43ff0c18 14 *
mbed_official 146:f64d43ff0c18 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 146:f64d43ff0c18 16 * contributors may be used to endorse or promote products derived from this
mbed_official 146:f64d43ff0c18 17 * software without specific prior written permission.
mbed_official 146:f64d43ff0c18 18 *
mbed_official 146:f64d43ff0c18 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 146:f64d43ff0c18 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 146:f64d43ff0c18 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 146:f64d43ff0c18 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 146:f64d43ff0c18 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 146:f64d43ff0c18 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 146:f64d43ff0c18 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 146:f64d43ff0c18 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 146:f64d43ff0c18 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 146:f64d43ff0c18 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 146:f64d43ff0c18 29 */
mbed_official 146:f64d43ff0c18 30 #ifndef __FSL_FLEXCAN_HAL_H__
mbed_official 146:f64d43ff0c18 31 #define __FSL_FLEXCAN_HAL_H__
mbed_official 146:f64d43ff0c18 32
mbed_official 146:f64d43ff0c18 33 #include <assert.h>
mbed_official 146:f64d43ff0c18 34 #include <stdint.h>
mbed_official 146:f64d43ff0c18 35 #include <stdbool.h>
mbed_official 146:f64d43ff0c18 36 #include "fsl_flexcan_features.h"
mbed_official 146:f64d43ff0c18 37 #include "fsl_device_registers.h"
mbed_official 146:f64d43ff0c18 38
mbed_official 146:f64d43ff0c18 39 /*!
mbed_official 146:f64d43ff0c18 40 * @addtogroup flexcan_hal
mbed_official 146:f64d43ff0c18 41 * @{
mbed_official 146:f64d43ff0c18 42 */
mbed_official 146:f64d43ff0c18 43
mbed_official 146:f64d43ff0c18 44 /*******************************************************************************
mbed_official 146:f64d43ff0c18 45 * Definitions
mbed_official 146:f64d43ff0c18 46 ******************************************************************************/
mbed_official 146:f64d43ff0c18 47
mbed_official 146:f64d43ff0c18 48 /*! @brief FlexCAN constants*/
mbed_official 146:f64d43ff0c18 49 enum _flexcan_constants
mbed_official 146:f64d43ff0c18 50 {
mbed_official 146:f64d43ff0c18 51 kFlexCanMessageSize = 8, /*!< FlexCAN message buffer data size in bytes*/
mbed_official 146:f64d43ff0c18 52 };
mbed_official 146:f64d43ff0c18 53
mbed_official 146:f64d43ff0c18 54 /*! @brief The Status enum is used to report current status of the FlexCAN interface.*/
mbed_official 146:f64d43ff0c18 55 enum _flexcan_err_status
mbed_official 146:f64d43ff0c18 56 {
mbed_official 146:f64d43ff0c18 57 kFlexCan_RxWrn = 0x0080, /*!< Reached warning level for RX errors*/
mbed_official 146:f64d43ff0c18 58 kFlexCan_TxWrn = 0x0100, /*!< Reached warning level for TX errors*/
mbed_official 146:f64d43ff0c18 59 kFlexCan_StfErr = 0x0200, /*!< Stuffing Error*/
mbed_official 146:f64d43ff0c18 60 kFlexCan_FrmErr = 0x0400, /*!< Form Error*/
mbed_official 146:f64d43ff0c18 61 kFlexCan_CrcErr = 0x0800, /*!< Cyclic Redundancy Check Error*/
mbed_official 146:f64d43ff0c18 62 kFlexCan_AckErr = 0x1000, /*!< Received no ACK on transmission*/
mbed_official 146:f64d43ff0c18 63 kFlexCan_Bit0Err = 0x2000, /*!< Unable to send dominant bit*/
mbed_official 146:f64d43ff0c18 64 kFlexCan_Bit1Err = 0x4000, /*!< Unable to send recessive bit*/
mbed_official 146:f64d43ff0c18 65 };
mbed_official 146:f64d43ff0c18 66
mbed_official 146:f64d43ff0c18 67 /*! @brief FlexCAN status return codes*/
mbed_official 146:f64d43ff0c18 68 typedef enum _flexcan_status
mbed_official 146:f64d43ff0c18 69 {
mbed_official 146:f64d43ff0c18 70 kStatus_FLEXCAN_Success = 0,
mbed_official 146:f64d43ff0c18 71 kStatus_FLEXCAN_OutOfRange,
mbed_official 146:f64d43ff0c18 72 kStatus_FLEXCAN_UnknownProperty,
mbed_official 146:f64d43ff0c18 73 kStatus_FLEXCAN_InvalidArgument,
mbed_official 146:f64d43ff0c18 74 kStatus_FLEXCAN_Fail,
mbed_official 146:f64d43ff0c18 75 kStatus_FLEXCAN_TimeOut,
mbed_official 146:f64d43ff0c18 76 } flexcan_status_t;
mbed_official 146:f64d43ff0c18 77
mbed_official 146:f64d43ff0c18 78
mbed_official 146:f64d43ff0c18 79 /*! @brief FlexCAN operation modes*/
mbed_official 146:f64d43ff0c18 80 typedef enum _flexcan_operation_modes {
mbed_official 146:f64d43ff0c18 81 kFlexCanNormalMode, /*!< Normal mode or user mode*/
mbed_official 146:f64d43ff0c18 82 kFlexCanListenOnlyMode, /*!< Listen-only mode*/
mbed_official 146:f64d43ff0c18 83 kFlexCanLoopBackMode, /*!< Loop-back mode*/
mbed_official 146:f64d43ff0c18 84 kFlexCanFreezeMode, /*!< Freeze mode*/
mbed_official 146:f64d43ff0c18 85 kFlexCanDisableMode, /*!< Module disable mode*/
mbed_official 146:f64d43ff0c18 86 } flexcan_operation_modes_t;
mbed_official 146:f64d43ff0c18 87
mbed_official 146:f64d43ff0c18 88 /*! @brief FlexCAN message buffer CODE for Rx buffers*/
mbed_official 146:f64d43ff0c18 89 typedef enum _flexcan_mb_code_rx {
mbed_official 146:f64d43ff0c18 90 kFlexCanRX_Inactive = 0x0, /*!< MB is not active.*/
mbed_official 146:f64d43ff0c18 91 kFlexCanRX_Full = 0x2, /*!< MB is full.*/
mbed_official 146:f64d43ff0c18 92 kFlexCanRX_Empty = 0x4, /*!< MB is active and empty.*/
mbed_official 146:f64d43ff0c18 93 kFlexCanRX_Overrun = 0x6, /*!< MB is overwritten into a full buffer.*/
mbed_official 146:f64d43ff0c18 94 kFlexCanRX_Busy = 0x8, /*!< FlexCAN is updating the contents of the MB.*/
mbed_official 146:f64d43ff0c18 95 /*! The CPU must not access the MB.*/
mbed_official 146:f64d43ff0c18 96 kFlexCanRX_Ranswer = 0xA, /*!< A frame was configured to recognize a Remote Request Frame*/
mbed_official 146:f64d43ff0c18 97 /*! and transmit a Response Frame in return.*/
mbed_official 146:f64d43ff0c18 98 kFlexCanRX_NotUsed = 0xF, /*!< Not used*/
mbed_official 146:f64d43ff0c18 99 } flexcan_mb_code_rx_t;
mbed_official 146:f64d43ff0c18 100
mbed_official 146:f64d43ff0c18 101 /*! @brief FlexCAN message buffer CODE FOR Tx buffers*/
mbed_official 146:f64d43ff0c18 102 typedef enum _flexcan_mb_code_tx {
mbed_official 146:f64d43ff0c18 103 kFlexCanTX_Inactive = 0x08, /*!< MB is not active.*/
mbed_official 146:f64d43ff0c18 104 kFlexCanTX_Abort = 0x09, /*!< MB is aborted.*/
mbed_official 146:f64d43ff0c18 105 kFlexCanTX_Data = 0x0C, /*!< MB is a TX Data Frame(MB RTR must be 0).*/
mbed_official 146:f64d43ff0c18 106 kFlexCanTX_Remote = 0x1C, /*!< MB is a TX Remote Request Frame (MB RTR must be 1).*/
mbed_official 146:f64d43ff0c18 107 kFlexCanTX_Tanswer = 0x0E, /*!< MB is a TX Response Request Frame from.*/
mbed_official 146:f64d43ff0c18 108 /*! an incoming Remote Request Frame.*/
mbed_official 146:f64d43ff0c18 109 kFlexCanTX_NotUsed = 0xF, /*!< Not used*/
mbed_official 146:f64d43ff0c18 110 } flexcan_mb_code_tx_t;
mbed_official 146:f64d43ff0c18 111
mbed_official 146:f64d43ff0c18 112 /*! @brief FlexCAN message buffer transmission types*/
mbed_official 146:f64d43ff0c18 113 typedef enum _flexcan_mb_transmission_type {
mbed_official 146:f64d43ff0c18 114 kFlexCanMBStatusType_TX, /*!< Transmit MB*/
mbed_official 146:f64d43ff0c18 115 kFlexCanMBStatusType_TXRemote, /*!< Transmit remote request MB*/
mbed_official 146:f64d43ff0c18 116 kFlexCanMBStatusType_RX, /*!< Receive MB*/
mbed_official 146:f64d43ff0c18 117 kFlexCanMBStatusType_RXRemote, /*!< Receive remote request MB*/
mbed_official 146:f64d43ff0c18 118 kFlexCanMBStatusType_RXTXRemote, /*!< FlexCAN remote frame receives remote request and*/
mbed_official 146:f64d43ff0c18 119 /*! transmits MB.*/
mbed_official 146:f64d43ff0c18 120 } flexcan_mb_transmission_type_t;
mbed_official 146:f64d43ff0c18 121
mbed_official 146:f64d43ff0c18 122 typedef enum _flexcan_rx_fifo_id_element_format {
mbed_official 146:f64d43ff0c18 123 kFlexCanRxFifoIdElementFormat_A, /*!< One full ID (standard and extended) per ID Filter Table*/
mbed_official 146:f64d43ff0c18 124 /*! element.*/
mbed_official 146:f64d43ff0c18 125 kFlexCanRxFifoIdElementFormat_B, /*!< Two full standard IDs or two partial 14-bit (standard and*/
mbed_official 146:f64d43ff0c18 126 /*! extended) IDs per ID Filter Table element.*/
mbed_official 146:f64d43ff0c18 127 kFlexCanRxFifoIdElementFormat_C, /*!< Four partial 8-bit Standard IDs per ID Filter Table*/
mbed_official 146:f64d43ff0c18 128 /*! element.*/
mbed_official 146:f64d43ff0c18 129 kFlexCanRxFifoIdElementFormat_D, /*!< All frames rejected.*/
mbed_official 146:f64d43ff0c18 130 } flexcan_rx_fifo_id_element_format_t;
mbed_official 146:f64d43ff0c18 131
mbed_official 146:f64d43ff0c18 132 /*! @brief FlexCAN Rx FIFO filters number*/
mbed_official 146:f64d43ff0c18 133 typedef enum _flexcan_rx_fifo_id_filter_number {
mbed_official 146:f64d43ff0c18 134 kFlexCanRxFifoIDFilters_8 = 0x0, /*!< 8 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 135 kFlexCanRxFifoIDFilters_16 = 0x1, /*!< 16 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 136 kFlexCanRxFifoIDFilters_24 = 0x2, /*!< 24 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 137 kFlexCanRxFifoIDFilters_32 = 0x3, /*!< 32 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 138 kFlexCanRxFifoIDFilters_40 = 0x4, /*!< 40 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 139 kFlexCanRxFifoIDFilters_48 = 0x5, /*!< 48 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 140 kFlexCanRxFifoIDFilters_56 = 0x6, /*!< 56 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 141 kFlexCanRxFifoIDFilters_64 = 0x7, /*!< 64 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 142 kFlexCanRxFifoIDFilters_72 = 0x8, /*!< 72 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 143 kFlexCanRxFifoIDFilters_80 = 0x9, /*!< 80 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 144 kFlexCanRxFifoIDFilters_88 = 0xA, /*!< 88 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 145 kFlexCanRxFifoIDFilters_96 = 0xB, /*!< 96 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 146 kFlexCanRxFifoIDFilters_104 = 0xC, /*!< 104 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 147 kFlexCanRxFifoIDFilters_112 = 0xD, /*!< 112 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 148 kFlexCanRxFifoIDFilters_120 = 0xE, /*!< 120 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 149 kFlexCanRxFifoIDFilters_128 = 0xF /*!< 128 Rx FIFO Filters*/
mbed_official 146:f64d43ff0c18 150 } flexcan_rx_fifo_id_filter_num_t;
mbed_official 146:f64d43ff0c18 151
mbed_official 146:f64d43ff0c18 152 /*! @brief FlexCAN RX FIFO ID filter table structure*/
mbed_official 146:f64d43ff0c18 153 typedef struct FLEXCANIdTable {
mbed_official 146:f64d43ff0c18 154 bool is_remote_mb; /*!< Remote frame*/
mbed_official 146:f64d43ff0c18 155 bool is_extended_mb; /*!< Extended frame*/
mbed_official 146:f64d43ff0c18 156 uint32_t *id_filter; /*!< Rx FIFO ID filter elements*/
mbed_official 146:f64d43ff0c18 157 } flexcan_id_table_t;
mbed_official 146:f64d43ff0c18 158
mbed_official 146:f64d43ff0c18 159 /*! @brief FlexCAN RX mask type.*/
mbed_official 146:f64d43ff0c18 160 typedef enum _flexcan_rx_mask_type {
mbed_official 146:f64d43ff0c18 161 kFlexCanRxMask_Global, /*!< Rx global mask*/
mbed_official 146:f64d43ff0c18 162 kFlexCanRxMask_Individual, /*!< Rx individual mask*/
mbed_official 146:f64d43ff0c18 163 } flexcan_rx_mask_type_t;
mbed_official 146:f64d43ff0c18 164
mbed_official 146:f64d43ff0c18 165 /*! @brief FlexCAN MB ID type*/
mbed_official 146:f64d43ff0c18 166 typedef enum _flexcan_mb_id_type {
mbed_official 146:f64d43ff0c18 167 kFlexCanMbId_Std, /*!< Standard ID*/
mbed_official 146:f64d43ff0c18 168 kFlexCanMbId_Ext, /*!< Extended ID*/
mbed_official 146:f64d43ff0c18 169 } flexcan_mb_id_type_t;
mbed_official 146:f64d43ff0c18 170
mbed_official 146:f64d43ff0c18 171 /*! @brief FlexCAN clock source*/
mbed_official 146:f64d43ff0c18 172 typedef enum _flexcan_clk_source {
mbed_official 146:f64d43ff0c18 173 kFlexCanClkSource_Osc, /*!< Oscillator clock*/
mbed_official 146:f64d43ff0c18 174 kFlexCanClkSource_Ipbus, /*!< Peripheral clock*/
mbed_official 146:f64d43ff0c18 175 } flexcan_clk_source_t;
mbed_official 146:f64d43ff0c18 176
mbed_official 146:f64d43ff0c18 177 /*! @brief FlexCAN error interrupt types*/
mbed_official 146:f64d43ff0c18 178 typedef enum _flexcan_int_type {
mbed_official 146:f64d43ff0c18 179 kFlexCanInt_Buf, /*!< OR'd message buffers interrupt*/
mbed_official 146:f64d43ff0c18 180 kFlexCanInt_Err, /*!< Error interrupt*/
mbed_official 146:f64d43ff0c18 181 kFlexCanInt_Boff, /*!< Bus off interrupt*/
mbed_official 146:f64d43ff0c18 182 kFlexCanInt_Wakeup, /*!< Wakeup interrupt*/
mbed_official 146:f64d43ff0c18 183 kFlexCanInt_Txwarning, /*!< TX warning interrupt*/
mbed_official 146:f64d43ff0c18 184 kFlexCanInt_Rxwarning, /*!< RX warning interrupt*/
mbed_official 146:f64d43ff0c18 185 } flexcan_int_type_t;
mbed_official 146:f64d43ff0c18 186
mbed_official 146:f64d43ff0c18 187 /*! @brief FlexCAN bus error counters*/
mbed_official 146:f64d43ff0c18 188 typedef struct FLEXCANBerrCounter {
mbed_official 146:f64d43ff0c18 189 uint16_t txerr; /*!< Transmit error counter*/
mbed_official 146:f64d43ff0c18 190 uint16_t rxerr; /*!< Receive error counter*/
mbed_official 146:f64d43ff0c18 191 } flexcan_berr_counter_t;
mbed_official 146:f64d43ff0c18 192
mbed_official 146:f64d43ff0c18 193 /*! @brief FlexCAN MB code and status for transmitting*/
mbed_official 146:f64d43ff0c18 194 typedef struct FLEXCANMbCodeStatusTx {
mbed_official 146:f64d43ff0c18 195 flexcan_mb_code_tx_t code; /*!< MB code for Tx buffers*/
mbed_official 146:f64d43ff0c18 196 flexcan_mb_id_type_t msg_id_type; /*!< Type of message ID (standard or extended)*/
mbed_official 146:f64d43ff0c18 197 uint32_t data_length; /*!< Length of Data in Bytes*/
mbed_official 146:f64d43ff0c18 198 uint32_t substitute_remote; /*!< Substitute remote request (used only in*/
mbed_official 146:f64d43ff0c18 199 /*! extended format)*/
mbed_official 146:f64d43ff0c18 200 uint32_t remote_transmission; /*!< Remote transmission request*/
mbed_official 146:f64d43ff0c18 201 bool local_priority_enable; /*!< 1 if enable it; 0 if disable it*/
mbed_official 146:f64d43ff0c18 202 uint32_t local_priority_val; /*!< Local priority value [0..2]*/
mbed_official 146:f64d43ff0c18 203 } flexcan_mb_code_status_tx_t;
mbed_official 146:f64d43ff0c18 204
mbed_official 146:f64d43ff0c18 205 /*! @brief FlexCAN MB code and status for receiving*/
mbed_official 146:f64d43ff0c18 206 typedef struct FLEXCANMbCodeStatusRx {
mbed_official 146:f64d43ff0c18 207 flexcan_mb_code_rx_t code; /*!< MB code for Rx buffers*/
mbed_official 146:f64d43ff0c18 208 flexcan_mb_id_type_t msg_id_type; /*!< Type of message ID (standard or extended)*/
mbed_official 146:f64d43ff0c18 209 uint32_t data_length; /*!< Length of Data in Bytes*/
mbed_official 146:f64d43ff0c18 210 uint32_t substitute_remote; /*!< Substitute remote request (used only in*/
mbed_official 146:f64d43ff0c18 211 /*! extended format)*/
mbed_official 146:f64d43ff0c18 212 uint32_t remote_transmission; /*!< Remote transmission request*/
mbed_official 146:f64d43ff0c18 213 bool local_priority_enable; /*!< 1 if enable it; 0 if disable it*/
mbed_official 146:f64d43ff0c18 214 uint32_t local_priority_val; /*!< Local priority value [0..2]*/
mbed_official 146:f64d43ff0c18 215 } flexcan_mb_code_status_rx_t;
mbed_official 146:f64d43ff0c18 216
mbed_official 146:f64d43ff0c18 217 /*! @brief FlexCAN Rx FIFO configuration*/
mbed_official 146:f64d43ff0c18 218 typedef struct FLEXCANRxFifoConfig {
mbed_official 146:f64d43ff0c18 219 flexcan_mb_id_type_t msg_id_type; /*!< Type of message ID*/
mbed_official 146:f64d43ff0c18 220 /*! (standard or extended)*/
mbed_official 146:f64d43ff0c18 221 uint32_t data_length; /*!< Length of Data in Bytes*/
mbed_official 146:f64d43ff0c18 222 uint32_t substitute_remote; /*!< Substitute remote request (used*/
mbed_official 146:f64d43ff0c18 223 /*! only in extended format)*/
mbed_official 146:f64d43ff0c18 224 uint32_t remote_transmission; /*!< Remote transmission request*/
mbed_official 146:f64d43ff0c18 225 flexcan_rx_fifo_id_element_format_t id_filter_number; /*!< The number of Rx FIFO ID filters*/
mbed_official 146:f64d43ff0c18 226 } flexcan_rx_fifo_config_t;
mbed_official 146:f64d43ff0c18 227
mbed_official 146:f64d43ff0c18 228 /*! @brief FlexCAN message buffer structure*/
mbed_official 146:f64d43ff0c18 229 typedef struct FLEXCANMb {
mbed_official 146:f64d43ff0c18 230 uint32_t cs; /*!< Code and Status*/
mbed_official 146:f64d43ff0c18 231 uint32_t msg_id; /*!< Message Buffer ID*/
mbed_official 146:f64d43ff0c18 232 uint8_t data[kFlexCanMessageSize]; /*!< Bytes of the FlexCAN message*/
mbed_official 146:f64d43ff0c18 233 } flexcan_mb_t;
mbed_official 146:f64d43ff0c18 234
mbed_official 146:f64d43ff0c18 235 /*! @brief FlexCAN configuration*/
mbed_official 146:f64d43ff0c18 236 typedef struct FLEXCANUserConfig {
mbed_official 146:f64d43ff0c18 237 uint32_t num_mb; /*!< The number of Message Buffers needed*/
mbed_official 146:f64d43ff0c18 238 uint32_t max_num_mb; /*!< The maximum number of Message Buffers*/
mbed_official 146:f64d43ff0c18 239 flexcan_rx_fifo_id_filter_num_t num_id_filters; /*!< The number of Rx FIFO ID filters needed*/
mbed_official 146:f64d43ff0c18 240 bool is_rx_fifo_needed; /*!< 1 if needed; 0 if not*/
mbed_official 146:f64d43ff0c18 241 bool is_rx_mb_needed; /*!< 1 if needed; 0 if not*/
mbed_official 146:f64d43ff0c18 242 } flexcan_user_config_t;
mbed_official 146:f64d43ff0c18 243
mbed_official 146:f64d43ff0c18 244 /*! @brief FlexCAN timing related structures*/
mbed_official 146:f64d43ff0c18 245 typedef struct FLEXCANTimeSegment {
mbed_official 146:f64d43ff0c18 246 uint32_t propseg; /*!< Propagation segment*/
mbed_official 146:f64d43ff0c18 247 uint32_t pseg1; /*!< Phase segment 1*/
mbed_official 146:f64d43ff0c18 248 uint32_t pseg2; /*!< Phase segment 2*/
mbed_official 146:f64d43ff0c18 249 uint32_t pre_divider; /*!< Clock pre divider*/
mbed_official 146:f64d43ff0c18 250 uint32_t rjw; /*!< Resync jump width*/
mbed_official 146:f64d43ff0c18 251 } flexcan_time_segment_t;
mbed_official 146:f64d43ff0c18 252
mbed_official 146:f64d43ff0c18 253
mbed_official 146:f64d43ff0c18 254 /*******************************************************************************
mbed_official 146:f64d43ff0c18 255 * API
mbed_official 146:f64d43ff0c18 256 ******************************************************************************/
mbed_official 146:f64d43ff0c18 257
mbed_official 146:f64d43ff0c18 258 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 259 extern "C" {
mbed_official 146:f64d43ff0c18 260 #endif
mbed_official 146:f64d43ff0c18 261
mbed_official 146:f64d43ff0c18 262 /*!
mbed_official 146:f64d43ff0c18 263 * @name Configuration
mbed_official 146:f64d43ff0c18 264 * @{
mbed_official 146:f64d43ff0c18 265 */
mbed_official 146:f64d43ff0c18 266
mbed_official 146:f64d43ff0c18 267 /*!
mbed_official 146:f64d43ff0c18 268 * @brief Enables FlexCAN controller.
mbed_official 146:f64d43ff0c18 269 *
mbed_official 146:f64d43ff0c18 270 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 271 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 272 */
mbed_official 146:f64d43ff0c18 273 flexcan_status_t flexcan_hal_enable(uint8_t instance);
mbed_official 146:f64d43ff0c18 274
mbed_official 146:f64d43ff0c18 275 /*!
mbed_official 146:f64d43ff0c18 276 * @brief Disables FlexCAN controller.
mbed_official 146:f64d43ff0c18 277 *
mbed_official 146:f64d43ff0c18 278 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 279 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 280 */
mbed_official 146:f64d43ff0c18 281 flexcan_status_t flexcan_hal_disable(uint8_t instance);
mbed_official 146:f64d43ff0c18 282
mbed_official 146:f64d43ff0c18 283 /*!
mbed_official 146:f64d43ff0c18 284 * @brief Checks whether the FlexCAN is enabled or disabled.
mbed_official 146:f64d43ff0c18 285 *
mbed_official 146:f64d43ff0c18 286 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 287 * @return State of FlexCAN enable(0)/disable(1)
mbed_official 146:f64d43ff0c18 288 */
mbed_official 146:f64d43ff0c18 289 static inline bool flexcan_hal_is_enabled(uint8_t instance)
mbed_official 146:f64d43ff0c18 290 {
mbed_official 146:f64d43ff0c18 291 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 292
mbed_official 146:f64d43ff0c18 293 return BR_CAN_MCR_MDIS(instance);
mbed_official 146:f64d43ff0c18 294 }
mbed_official 146:f64d43ff0c18 295
mbed_official 146:f64d43ff0c18 296 /*!
mbed_official 146:f64d43ff0c18 297 * @brief Resets the FlexCAN controller.
mbed_official 146:f64d43ff0c18 298 *
mbed_official 146:f64d43ff0c18 299 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 300 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 301 */
mbed_official 146:f64d43ff0c18 302 flexcan_status_t flexcan_hal_sw_reset(uint8_t instance);
mbed_official 146:f64d43ff0c18 303
mbed_official 146:f64d43ff0c18 304 /*!
mbed_official 146:f64d43ff0c18 305 * @brief Selects the clock source for FlexCAN.
mbed_official 146:f64d43ff0c18 306 *
mbed_official 146:f64d43ff0c18 307 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 308 * @param clk The FlexCAN clock source
mbed_official 146:f64d43ff0c18 309 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 310 */
mbed_official 146:f64d43ff0c18 311 flexcan_status_t flexcan_hal_select_clk(uint8_t instance, flexcan_clk_source_t clk);
mbed_official 146:f64d43ff0c18 312
mbed_official 146:f64d43ff0c18 313 /*!
mbed_official 146:f64d43ff0c18 314 * @brief Initializes the FlexCAN controller.
mbed_official 146:f64d43ff0c18 315 *
mbed_official 146:f64d43ff0c18 316 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 317 * @param data The FlexCAN platform data.
mbed_official 146:f64d43ff0c18 318 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 319 */
mbed_official 146:f64d43ff0c18 320 flexcan_status_t flexcan_hal_init(uint8_t instance, const flexcan_user_config_t *data);
mbed_official 146:f64d43ff0c18 321
mbed_official 146:f64d43ff0c18 322 /*!
mbed_official 146:f64d43ff0c18 323 * @brief Sets the FlexCAN time segments for setting up bit rate.
mbed_official 146:f64d43ff0c18 324 *
mbed_official 146:f64d43ff0c18 325 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 326 * @param time_seg FlexCAN time segments, which need to be set for the bit rate.
mbed_official 146:f64d43ff0c18 327 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 328 */
mbed_official 146:f64d43ff0c18 329 void flexcan_hal_set_time_segments(uint8_t instance, flexcan_time_segment_t *time_seg);
mbed_official 146:f64d43ff0c18 330
mbed_official 146:f64d43ff0c18 331 /*!
mbed_official 146:f64d43ff0c18 332 * @brief Gets the FlexCAN time segments to calculate the bit rate.
mbed_official 146:f64d43ff0c18 333 *
mbed_official 146:f64d43ff0c18 334 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 335 * @param time_seg FlexCAN time segments read for bit rate
mbed_official 146:f64d43ff0c18 336 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 337 */
mbed_official 146:f64d43ff0c18 338 void flexcan_hal_get_time_segments(uint8_t instance, flexcan_time_segment_t *time_seg);
mbed_official 146:f64d43ff0c18 339
mbed_official 146:f64d43ff0c18 340 /*!
mbed_official 146:f64d43ff0c18 341 * @brief Un freezes the FlexCAN module.
mbed_official 146:f64d43ff0c18 342 *
mbed_official 146:f64d43ff0c18 343 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 344 * @return 0 if successful; non-zero failed.
mbed_official 146:f64d43ff0c18 345 */
mbed_official 146:f64d43ff0c18 346 void flexcan_hal_exit_freeze_mode(uint8_t instance);
mbed_official 146:f64d43ff0c18 347
mbed_official 146:f64d43ff0c18 348 /*!
mbed_official 146:f64d43ff0c18 349 * @brief Freezes the FlexCAN module.
mbed_official 146:f64d43ff0c18 350 *
mbed_official 146:f64d43ff0c18 351 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 352 */
mbed_official 146:f64d43ff0c18 353 void flexcan_hal_enter_freeze_mode(uint8_t instance);
mbed_official 146:f64d43ff0c18 354
mbed_official 146:f64d43ff0c18 355 /*!
mbed_official 146:f64d43ff0c18 356 * @brief Enables operation mode.
mbed_official 146:f64d43ff0c18 357 *
mbed_official 146:f64d43ff0c18 358 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 359 * @param mode An operation mode to be enabled
mbed_official 146:f64d43ff0c18 360 * @return 0 if successful; non-zero failed.
mbed_official 146:f64d43ff0c18 361 */
mbed_official 146:f64d43ff0c18 362 flexcan_status_t flexcan_hal_enable_operation_mode(
mbed_official 146:f64d43ff0c18 363 uint8_t instance,
mbed_official 146:f64d43ff0c18 364 flexcan_operation_modes_t mode);
mbed_official 146:f64d43ff0c18 365
mbed_official 146:f64d43ff0c18 366 /*!
mbed_official 146:f64d43ff0c18 367 * @brief Disables operation mode.
mbed_official 146:f64d43ff0c18 368 *
mbed_official 146:f64d43ff0c18 369 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 370 * @param mode An operation mode to be disabled
mbed_official 146:f64d43ff0c18 371 * @return 0 if successful; non-zero failed.
mbed_official 146:f64d43ff0c18 372 */
mbed_official 146:f64d43ff0c18 373 flexcan_status_t flexcan_hal_disable_operation_mode(
mbed_official 146:f64d43ff0c18 374 uint8_t instance,
mbed_official 146:f64d43ff0c18 375 flexcan_operation_modes_t mode);
mbed_official 146:f64d43ff0c18 376
mbed_official 146:f64d43ff0c18 377 /*@}*/
mbed_official 146:f64d43ff0c18 378
mbed_official 146:f64d43ff0c18 379 /*!
mbed_official 146:f64d43ff0c18 380 * @name Data transfer
mbed_official 146:f64d43ff0c18 381 * @{
mbed_official 146:f64d43ff0c18 382 */
mbed_official 146:f64d43ff0c18 383
mbed_official 146:f64d43ff0c18 384 /*!
mbed_official 146:f64d43ff0c18 385 * @brief Sets the FlexCAN message buffer fields for transmitting.
mbed_official 146:f64d43ff0c18 386 *
mbed_official 146:f64d43ff0c18 387 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 388 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 389 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 390 * @param cs CODE/status values (TX)
mbed_official 146:f64d43ff0c18 391 * @param msg_id ID of the message to transmit
mbed_official 146:f64d43ff0c18 392 * @param mb_data Bytes of the FlexCAN message
mbed_official 146:f64d43ff0c18 393 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 394 */
mbed_official 146:f64d43ff0c18 395 flexcan_status_t flexcan_hal_set_mb_tx(
mbed_official 146:f64d43ff0c18 396 uint8_t instance,
mbed_official 146:f64d43ff0c18 397 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 398 uint32_t mb_idx,
mbed_official 146:f64d43ff0c18 399 flexcan_mb_code_status_tx_t *cs,
mbed_official 146:f64d43ff0c18 400 uint32_t msg_id,
mbed_official 146:f64d43ff0c18 401 uint8_t *mb_data);
mbed_official 146:f64d43ff0c18 402
mbed_official 146:f64d43ff0c18 403 /*!
mbed_official 146:f64d43ff0c18 404 * @brief Set the FlexCAN message buffer fields for receiving.
mbed_official 146:f64d43ff0c18 405 *
mbed_official 146:f64d43ff0c18 406 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 407 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 408 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 409 * @param cs CODE/status values (RX)
mbed_official 146:f64d43ff0c18 410 * @param msg_id ID of the message to receive
mbed_official 146:f64d43ff0c18 411 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 412 */
mbed_official 146:f64d43ff0c18 413 flexcan_status_t flexcan_hal_set_mb_rx(
mbed_official 146:f64d43ff0c18 414 uint8_t instance,
mbed_official 146:f64d43ff0c18 415 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 416 uint32_t mb_idx,
mbed_official 146:f64d43ff0c18 417 flexcan_mb_code_status_rx_t *cs,
mbed_official 146:f64d43ff0c18 418 uint32_t msg_id);
mbed_official 146:f64d43ff0c18 419
mbed_official 146:f64d43ff0c18 420 /*!
mbed_official 146:f64d43ff0c18 421 * @brief Gets the FlexCAN message buffer fields.
mbed_official 146:f64d43ff0c18 422 *
mbed_official 146:f64d43ff0c18 423 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 424 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 425 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 426 * @param mb The fields of the message buffer
mbed_official 146:f64d43ff0c18 427 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 428 */
mbed_official 146:f64d43ff0c18 429 flexcan_status_t flexcan_hal_get_mb(
mbed_official 146:f64d43ff0c18 430 uint8_t instance,
mbed_official 146:f64d43ff0c18 431 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 432 uint32_t mb_idx,
mbed_official 146:f64d43ff0c18 433 flexcan_mb_t *mb);
mbed_official 146:f64d43ff0c18 434
mbed_official 146:f64d43ff0c18 435 /*!
mbed_official 146:f64d43ff0c18 436 * @brief Locks the FlexCAN Rx message buffer.
mbed_official 146:f64d43ff0c18 437 *
mbed_official 146:f64d43ff0c18 438 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 439 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 440 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 441 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 442 */
mbed_official 146:f64d43ff0c18 443 flexcan_status_t flexcan_hal_lock_rx_mb(
mbed_official 146:f64d43ff0c18 444 uint8_t instance,
mbed_official 146:f64d43ff0c18 445 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 446 uint32_t mb_idx);
mbed_official 146:f64d43ff0c18 447
mbed_official 146:f64d43ff0c18 448 /*!
mbed_official 146:f64d43ff0c18 449 * @brief Unlocks the FlexCAN Rx message buffer.
mbed_official 146:f64d43ff0c18 450 *
mbed_official 146:f64d43ff0c18 451 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 452 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 453 */
mbed_official 146:f64d43ff0c18 454 static inline void flexcan_hal_unlock_rx_mb(uint8_t instance)
mbed_official 146:f64d43ff0c18 455 {
mbed_official 146:f64d43ff0c18 456 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 457
mbed_official 146:f64d43ff0c18 458 /* Unlock the mailbox */
mbed_official 146:f64d43ff0c18 459 HW_CAN_TIMER_RD(instance);
mbed_official 146:f64d43ff0c18 460 }
mbed_official 146:f64d43ff0c18 461
mbed_official 146:f64d43ff0c18 462 /*!
mbed_official 146:f64d43ff0c18 463 * @brief Enables the Rx FIFO.
mbed_official 146:f64d43ff0c18 464 *
mbed_official 146:f64d43ff0c18 465 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 466 */
mbed_official 146:f64d43ff0c18 467 void flexcan_hal_enable_rx_fifo(uint8_t instance);
mbed_official 146:f64d43ff0c18 468
mbed_official 146:f64d43ff0c18 469 /*!
mbed_official 146:f64d43ff0c18 470 * @brief Disables the Rx FIFO.
mbed_official 146:f64d43ff0c18 471 *
mbed_official 146:f64d43ff0c18 472 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 473 */
mbed_official 146:f64d43ff0c18 474 void flexcan_hal_disable_rx_fifo(uint8_t instance);
mbed_official 146:f64d43ff0c18 475
mbed_official 146:f64d43ff0c18 476 /*!
mbed_official 146:f64d43ff0c18 477 * @brief Sets the number of the Rx FIFO filters.
mbed_official 146:f64d43ff0c18 478 *
mbed_official 146:f64d43ff0c18 479 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 480 * @param number The number of Rx FIFO filters
mbed_official 146:f64d43ff0c18 481 */
mbed_official 146:f64d43ff0c18 482 void flexcan_hal_set_rx_fifo_filters_number(uint8_t instance, uint32_t number);
mbed_official 146:f64d43ff0c18 483
mbed_official 146:f64d43ff0c18 484 /*!
mbed_official 146:f64d43ff0c18 485 * @brief Sets the maximum number of Message Buffers.
mbed_official 146:f64d43ff0c18 486 *
mbed_official 146:f64d43ff0c18 487 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 488 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 489 */
mbed_official 146:f64d43ff0c18 490 void flexcan_hal_set_max_mb_number(
mbed_official 146:f64d43ff0c18 491 uint8_t instance,
mbed_official 146:f64d43ff0c18 492 const flexcan_user_config_t *data);
mbed_official 146:f64d43ff0c18 493
mbed_official 146:f64d43ff0c18 494 /*!
mbed_official 146:f64d43ff0c18 495 * @brief Sets the Rx FIFO ID filter table elements.
mbed_official 146:f64d43ff0c18 496 *
mbed_official 146:f64d43ff0c18 497 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 498 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 499 * @param id_format The format of the Rx FIFO ID Filter Table Elements
mbed_official 146:f64d43ff0c18 500 * @param id_filter_table The ID filter table elements which contain if RTR bit,
mbed_official 146:f64d43ff0c18 501 * IDE bit and RX message ID need to be set.
mbed_official 146:f64d43ff0c18 502 * @return 0 if successful; non-zero failed.
mbed_official 146:f64d43ff0c18 503 */
mbed_official 146:f64d43ff0c18 504 flexcan_status_t flexcan_hal_set_id_filter_table_elements(
mbed_official 146:f64d43ff0c18 505 uint8_t instance,
mbed_official 146:f64d43ff0c18 506 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 507 flexcan_rx_fifo_id_element_format_t id_format,
mbed_official 146:f64d43ff0c18 508 flexcan_id_table_t *id_filter_table);
mbed_official 146:f64d43ff0c18 509
mbed_official 146:f64d43ff0c18 510 /*!
mbed_official 146:f64d43ff0c18 511 * @brief Sets the FlexCAN Rx FIFO fields.
mbed_official 146:f64d43ff0c18 512 *
mbed_official 146:f64d43ff0c18 513 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 514 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 515 * @param id_format The format of the Rx FIFO ID Filter Table Elements
mbed_official 146:f64d43ff0c18 516 * @param id_filter_table The ID filter table elements which contain RTR bit, IDE bit,
mbed_official 146:f64d43ff0c18 517 * and RX message ID.
mbed_official 146:f64d43ff0c18 518 * @return 0 if successful; non-zero failed.
mbed_official 146:f64d43ff0c18 519 */
mbed_official 146:f64d43ff0c18 520 flexcan_status_t flexcan_hal_set_rx_fifo(
mbed_official 146:f64d43ff0c18 521 uint8_t instance,
mbed_official 146:f64d43ff0c18 522 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 523 flexcan_rx_fifo_id_element_format_t id_format,
mbed_official 146:f64d43ff0c18 524 flexcan_id_table_t *id_filter_table);
mbed_official 146:f64d43ff0c18 525
mbed_official 146:f64d43ff0c18 526 /*!
mbed_official 146:f64d43ff0c18 527 * @brief Gets the FlexCAN Rx FIFO data.
mbed_official 146:f64d43ff0c18 528 *
mbed_official 146:f64d43ff0c18 529 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 530 * @param rx_fifo The FlexCAN receive FIFO data
mbed_official 146:f64d43ff0c18 531 * @return 0 if successful; non-zero failed.
mbed_official 146:f64d43ff0c18 532 */
mbed_official 146:f64d43ff0c18 533 flexcan_status_t flexcan_hal_read_fifo(
mbed_official 146:f64d43ff0c18 534 uint8_t instance,
mbed_official 146:f64d43ff0c18 535 flexcan_mb_t *rx_fifo);
mbed_official 146:f64d43ff0c18 536
mbed_official 146:f64d43ff0c18 537 /*@}*/
mbed_official 146:f64d43ff0c18 538
mbed_official 146:f64d43ff0c18 539 /*!
mbed_official 146:f64d43ff0c18 540 * @name Interrupts
mbed_official 146:f64d43ff0c18 541 * @{
mbed_official 146:f64d43ff0c18 542 */
mbed_official 146:f64d43ff0c18 543
mbed_official 146:f64d43ff0c18 544 /*!
mbed_official 146:f64d43ff0c18 545 * @brief Enables the FlexCAN Message Buffer interrupt.
mbed_official 146:f64d43ff0c18 546 *
mbed_official 146:f64d43ff0c18 547 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 548 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 549 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 550 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 551 */
mbed_official 146:f64d43ff0c18 552 flexcan_status_t flexcan_hal_enable_mb_interrupt(
mbed_official 146:f64d43ff0c18 553 uint8_t instance,
mbed_official 146:f64d43ff0c18 554 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 555 uint32_t mb_idx);
mbed_official 146:f64d43ff0c18 556
mbed_official 146:f64d43ff0c18 557 /*!
mbed_official 146:f64d43ff0c18 558 * @brief Disables the FlexCAN Message Buffer interrupt.
mbed_official 146:f64d43ff0c18 559 *
mbed_official 146:f64d43ff0c18 560 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 561 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 562 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 563 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 564 */
mbed_official 146:f64d43ff0c18 565 flexcan_status_t flexcan_hal_disable_mb_interrupt(
mbed_official 146:f64d43ff0c18 566 uint8_t instance,
mbed_official 146:f64d43ff0c18 567 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 568 uint32_t mb_idx);
mbed_official 146:f64d43ff0c18 569
mbed_official 146:f64d43ff0c18 570 /*!
mbed_official 146:f64d43ff0c18 571 * @brief Enables error interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 572 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 573 */
mbed_official 146:f64d43ff0c18 574 void flexcan_hal_enable_error_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 575
mbed_official 146:f64d43ff0c18 576 /*!
mbed_official 146:f64d43ff0c18 577 * @brief Disables error interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 578 *
mbed_official 146:f64d43ff0c18 579 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 580 */
mbed_official 146:f64d43ff0c18 581 void flexcan_hal_disable_error_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 582
mbed_official 146:f64d43ff0c18 583 /*!
mbed_official 146:f64d43ff0c18 584 * @brief Enables Bus off interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 585 *
mbed_official 146:f64d43ff0c18 586 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 587 */
mbed_official 146:f64d43ff0c18 588 void flexcan_hal_enable_bus_off_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 589
mbed_official 146:f64d43ff0c18 590 /*!
mbed_official 146:f64d43ff0c18 591 * @brief Disables Bus off interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 592 *
mbed_official 146:f64d43ff0c18 593 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 594 */
mbed_official 146:f64d43ff0c18 595 void flexcan_hal_disable_bus_off_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 596
mbed_official 146:f64d43ff0c18 597 /*!
mbed_official 146:f64d43ff0c18 598 * @brief Enables Wakeup interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 599 *
mbed_official 146:f64d43ff0c18 600 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 601 */
mbed_official 146:f64d43ff0c18 602 void flexcan_hal_enable_wakeup_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 603
mbed_official 146:f64d43ff0c18 604 /*!
mbed_official 146:f64d43ff0c18 605 * @brief Disables Wakeup interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 606 *
mbed_official 146:f64d43ff0c18 607 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 608 */
mbed_official 146:f64d43ff0c18 609 void flexcan_hal_disable_wakeup_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 610
mbed_official 146:f64d43ff0c18 611 /*!
mbed_official 146:f64d43ff0c18 612 * @brief Enables TX warning interrupt of the FlexCAN module
mbed_official 146:f64d43ff0c18 613 *
mbed_official 146:f64d43ff0c18 614 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 615 */
mbed_official 146:f64d43ff0c18 616 void flexcan_hal_enable_tx_warning_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 617
mbed_official 146:f64d43ff0c18 618 /*!
mbed_official 146:f64d43ff0c18 619 * @brief Disables TX warning interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 620 *
mbed_official 146:f64d43ff0c18 621 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 622 */
mbed_official 146:f64d43ff0c18 623 void flexcan_hal_disable_tx_warning_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 624
mbed_official 146:f64d43ff0c18 625 /*!
mbed_official 146:f64d43ff0c18 626 * @brief Enables RX warning interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 627 *
mbed_official 146:f64d43ff0c18 628 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 629 */
mbed_official 146:f64d43ff0c18 630 void flexcan_hal_enable_rx_warning_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 631
mbed_official 146:f64d43ff0c18 632 /*!
mbed_official 146:f64d43ff0c18 633 * @brief Disables RX warning interrupt of the FlexCAN module.
mbed_official 146:f64d43ff0c18 634 *
mbed_official 146:f64d43ff0c18 635 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 636 */
mbed_official 146:f64d43ff0c18 637 void flexcan_hal_disable_rx_warning_interrupt(uint8_t instance);
mbed_official 146:f64d43ff0c18 638
mbed_official 146:f64d43ff0c18 639 /*@}*/
mbed_official 146:f64d43ff0c18 640
mbed_official 146:f64d43ff0c18 641 /*!
mbed_official 146:f64d43ff0c18 642 * @name Status
mbed_official 146:f64d43ff0c18 643 * @{
mbed_official 146:f64d43ff0c18 644 */
mbed_official 146:f64d43ff0c18 645
mbed_official 146:f64d43ff0c18 646 /*!
mbed_official 146:f64d43ff0c18 647 * @brief Gets the value of FlexCAN freeze ACK.
mbed_official 146:f64d43ff0c18 648 *
mbed_official 146:f64d43ff0c18 649 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 650 * @return freeze ACK state (1-freeze mode, 0-not in freeze mode).
mbed_official 146:f64d43ff0c18 651 */
mbed_official 146:f64d43ff0c18 652 static inline uint32_t flexcan_hal_get_freeze_ack(uint8_t instance)
mbed_official 146:f64d43ff0c18 653 {
mbed_official 146:f64d43ff0c18 654 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 655 return HW_CAN_MCR(instance).B.FRZACK;
mbed_official 146:f64d43ff0c18 656 }
mbed_official 146:f64d43ff0c18 657
mbed_official 146:f64d43ff0c18 658 /*!
mbed_official 146:f64d43ff0c18 659 * @brief Gets the individual FlexCAN MB interrupt flag.
mbed_official 146:f64d43ff0c18 660 *
mbed_official 146:f64d43ff0c18 661 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 662 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 663 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 664 * @return the individual MB interrupt flag (0 and 1 are the flag value)
mbed_official 146:f64d43ff0c18 665 */
mbed_official 146:f64d43ff0c18 666 uint8_t flexcan_hal_get_mb_int_flag(
mbed_official 146:f64d43ff0c18 667 uint8_t instance,
mbed_official 146:f64d43ff0c18 668 const flexcan_user_config_t *data,
mbed_official 146:f64d43ff0c18 669 uint32_t mb_idx);
mbed_official 146:f64d43ff0c18 670
mbed_official 146:f64d43ff0c18 671 /*!
mbed_official 146:f64d43ff0c18 672 * @brief Gets all FlexCAN MB interrupt flags.
mbed_official 146:f64d43ff0c18 673 *
mbed_official 146:f64d43ff0c18 674 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 675 * @return all MB interrupt flags
mbed_official 146:f64d43ff0c18 676 */
mbed_official 146:f64d43ff0c18 677 static inline uint32_t flexcan_hal_get_all_mb_int_flags(uint8_t instance)
mbed_official 146:f64d43ff0c18 678 {
mbed_official 146:f64d43ff0c18 679 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 680 return HW_CAN_IFLAG1_RD(instance);
mbed_official 146:f64d43ff0c18 681 }
mbed_official 146:f64d43ff0c18 682
mbed_official 146:f64d43ff0c18 683 /*!
mbed_official 146:f64d43ff0c18 684 * @brief Clears the interrupt flag of the message buffers.
mbed_official 146:f64d43ff0c18 685 *
mbed_official 146:f64d43ff0c18 686 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 687 * @param reg_val The value to be written to the interrupt flag1 register.
mbed_official 146:f64d43ff0c18 688 */
mbed_official 146:f64d43ff0c18 689 /* See fsl_flexcan_hal.h for documentation of this function.*/
mbed_official 146:f64d43ff0c18 690 static inline void flexcan_hal_clear_mb_int_flag(
mbed_official 146:f64d43ff0c18 691 uint8_t instance,
mbed_official 146:f64d43ff0c18 692 uint32_t reg_val)
mbed_official 146:f64d43ff0c18 693 {
mbed_official 146:f64d43ff0c18 694 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 695
mbed_official 146:f64d43ff0c18 696 /* Clear the corresponding message buffer interrupt flag*/
mbed_official 146:f64d43ff0c18 697 HW_CAN_IFLAG1_SET(instance, reg_val);
mbed_official 146:f64d43ff0c18 698 }
mbed_official 146:f64d43ff0c18 699
mbed_official 146:f64d43ff0c18 700 /*!
mbed_official 146:f64d43ff0c18 701 * @brief Gets the transmit error counter and receives the error counter.
mbed_official 146:f64d43ff0c18 702 *
mbed_official 146:f64d43ff0c18 703 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 704 * @param err_cnt Transmit error counter and receive error counter
mbed_official 146:f64d43ff0c18 705 */
mbed_official 146:f64d43ff0c18 706 void flexcan_hal_get_err_counter(
mbed_official 146:f64d43ff0c18 707 uint8_t instance,
mbed_official 146:f64d43ff0c18 708 flexcan_berr_counter_t *err_cnt);
mbed_official 146:f64d43ff0c18 709
mbed_official 146:f64d43ff0c18 710 /*!
mbed_official 146:f64d43ff0c18 711 * @brief Gets error and status.
mbed_official 146:f64d43ff0c18 712 *
mbed_official 146:f64d43ff0c18 713 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 714 * @return The current error and status
mbed_official 146:f64d43ff0c18 715 */
mbed_official 146:f64d43ff0c18 716 static inline uint32_t flexcan_hal_get_err_status(uint8_t instance)
mbed_official 146:f64d43ff0c18 717 {
mbed_official 146:f64d43ff0c18 718 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 719 return HW_CAN_ESR1_RD(instance);
mbed_official 146:f64d43ff0c18 720 }
mbed_official 146:f64d43ff0c18 721
mbed_official 146:f64d43ff0c18 722 /*!
mbed_official 146:f64d43ff0c18 723 * @brief Clears all other interrupts in ERRSTAT register (Error, Busoff, Wakeup).
mbed_official 146:f64d43ff0c18 724 *
mbed_official 146:f64d43ff0c18 725 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 726 */
mbed_official 146:f64d43ff0c18 727 void flexcan_hal_clear_err_interrupt_status(uint8_t instance);
mbed_official 146:f64d43ff0c18 728
mbed_official 146:f64d43ff0c18 729 /*@}*/
mbed_official 146:f64d43ff0c18 730
mbed_official 146:f64d43ff0c18 731 /*!
mbed_official 146:f64d43ff0c18 732 * @name Mask
mbed_official 146:f64d43ff0c18 733 * @{
mbed_official 146:f64d43ff0c18 734 */
mbed_official 146:f64d43ff0c18 735
mbed_official 146:f64d43ff0c18 736 /*!
mbed_official 146:f64d43ff0c18 737 * @brief Sets the Rx masking type.
mbed_official 146:f64d43ff0c18 738 *
mbed_official 146:f64d43ff0c18 739 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 740 * @param type The FlexCAN Rx mask type
mbed_official 146:f64d43ff0c18 741 */
mbed_official 146:f64d43ff0c18 742 void flexcan_hal_set_mask_type(uint8_t instance, flexcan_rx_mask_type_t type);
mbed_official 146:f64d43ff0c18 743
mbed_official 146:f64d43ff0c18 744 /*!
mbed_official 146:f64d43ff0c18 745 * @brief Sets the FlexCAN RX FIFO global standard mask.
mbed_official 146:f64d43ff0c18 746 *
mbed_official 146:f64d43ff0c18 747 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 748 * @param std_mask Standard mask
mbed_official 146:f64d43ff0c18 749 */
mbed_official 146:f64d43ff0c18 750 void flexcan_hal_set_rx_fifo_global_std_mask(
mbed_official 146:f64d43ff0c18 751 uint8_t instance,
mbed_official 146:f64d43ff0c18 752 uint32_t std_mask);
mbed_official 146:f64d43ff0c18 753
mbed_official 146:f64d43ff0c18 754 /*!
mbed_official 146:f64d43ff0c18 755 * @brief Sets the FlexCAN Rx FIFO global extended mask.
mbed_official 146:f64d43ff0c18 756 *
mbed_official 146:f64d43ff0c18 757 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 758 * @param ext_mask Extended mask
mbed_official 146:f64d43ff0c18 759 */
mbed_official 146:f64d43ff0c18 760 void flexcan_hal_set_rx_fifo_global_ext_mask(
mbed_official 146:f64d43ff0c18 761 uint8_t instance,
mbed_official 146:f64d43ff0c18 762 uint32_t ext_mask);
mbed_official 146:f64d43ff0c18 763
mbed_official 146:f64d43ff0c18 764 /*!
mbed_official 146:f64d43ff0c18 765 * @brief Sets the FlexCAN Rx individual standard mask for ID filtering in the Rx MBs and the Rx FIFO.
mbed_official 146:f64d43ff0c18 766 *
mbed_official 146:f64d43ff0c18 767 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 768 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 769 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 770 * @param std_mask Individual standard mask
mbed_official 146:f64d43ff0c18 771 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 772 */
mbed_official 146:f64d43ff0c18 773 flexcan_status_t flexcan_hal_set_rx_individual_std_mask(
mbed_official 146:f64d43ff0c18 774 uint8_t instance,
mbed_official 146:f64d43ff0c18 775 const flexcan_user_config_t * data,
mbed_official 146:f64d43ff0c18 776 uint32_t mb_idx,
mbed_official 146:f64d43ff0c18 777 uint32_t std_mask);
mbed_official 146:f64d43ff0c18 778
mbed_official 146:f64d43ff0c18 779 /*!
mbed_official 146:f64d43ff0c18 780 * @brief Sets the FlexCAN Rx individual extended mask for ID filtering in the Rx MBs and the Rx FIFO.
mbed_official 146:f64d43ff0c18 781 *
mbed_official 146:f64d43ff0c18 782 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 783 * @param data The FlexCAN platform data
mbed_official 146:f64d43ff0c18 784 * @param mb_idx Index of the message buffer
mbed_official 146:f64d43ff0c18 785 * @param ext_mask Individual extended mask
mbed_official 146:f64d43ff0c18 786 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 787 */
mbed_official 146:f64d43ff0c18 788 flexcan_status_t flexcan_hal_set_rx_individual_ext_mask(
mbed_official 146:f64d43ff0c18 789 uint8_t instance,
mbed_official 146:f64d43ff0c18 790 const flexcan_user_config_t * data,
mbed_official 146:f64d43ff0c18 791 uint32_t mb_idx,
mbed_official 146:f64d43ff0c18 792 uint32_t ext_mask);
mbed_official 146:f64d43ff0c18 793
mbed_official 146:f64d43ff0c18 794 /*!
mbed_official 146:f64d43ff0c18 795 * @brief Sets the FlexCAN Rx MB global standard mask.
mbed_official 146:f64d43ff0c18 796 *
mbed_official 146:f64d43ff0c18 797 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 798 * @param std_mask Standard mask
mbed_official 146:f64d43ff0c18 799 */
mbed_official 146:f64d43ff0c18 800 void flexcan_hal_set_rx_mb_global_std_mask(
mbed_official 146:f64d43ff0c18 801 uint8_t instance,
mbed_official 146:f64d43ff0c18 802 uint32_t std_mask);
mbed_official 146:f64d43ff0c18 803
mbed_official 146:f64d43ff0c18 804 /*!
mbed_official 146:f64d43ff0c18 805 * @brief Sets the FlexCAN RX MB BUF14 standard mask.
mbed_official 146:f64d43ff0c18 806 *
mbed_official 146:f64d43ff0c18 807 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 808 * @param std_mask Standard mask
mbed_official 146:f64d43ff0c18 809 */
mbed_official 146:f64d43ff0c18 810 void flexcan_hal_set_rx_mb_buf14_std_mask(
mbed_official 146:f64d43ff0c18 811 uint8_t instance,
mbed_official 146:f64d43ff0c18 812 uint32_t std_mask);
mbed_official 146:f64d43ff0c18 813
mbed_official 146:f64d43ff0c18 814 /*!
mbed_official 146:f64d43ff0c18 815 * @brief Sets the FlexCAN Rx MB BUF15 standard mask.
mbed_official 146:f64d43ff0c18 816 *
mbed_official 146:f64d43ff0c18 817 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 818 * @param std_mask Standard mask
mbed_official 146:f64d43ff0c18 819 * @return 0 if successful; non-zero failed
mbed_official 146:f64d43ff0c18 820 */
mbed_official 146:f64d43ff0c18 821 void flexcan_hal_set_rx_mb_buf15_std_mask(
mbed_official 146:f64d43ff0c18 822 uint8_t instance,
mbed_official 146:f64d43ff0c18 823 uint32_t std_mask);
mbed_official 146:f64d43ff0c18 824
mbed_official 146:f64d43ff0c18 825 /*!
mbed_official 146:f64d43ff0c18 826 * @brief Sets the FlexCAN RX MB global extended mask.
mbed_official 146:f64d43ff0c18 827 *
mbed_official 146:f64d43ff0c18 828 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 829 * @param ext_mask Extended mask
mbed_official 146:f64d43ff0c18 830 */
mbed_official 146:f64d43ff0c18 831 void flexcan_hal_set_rx_mb_global_ext_mask(
mbed_official 146:f64d43ff0c18 832 uint8_t instance,
mbed_official 146:f64d43ff0c18 833 uint32_t ext_mask);
mbed_official 146:f64d43ff0c18 834
mbed_official 146:f64d43ff0c18 835 /*!
mbed_official 146:f64d43ff0c18 836 * @brief Sets the FlexCAN RX MB BUF14 extended mask.
mbed_official 146:f64d43ff0c18 837 *
mbed_official 146:f64d43ff0c18 838 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 839 * @param ext_mask Extended mask
mbed_official 146:f64d43ff0c18 840 */
mbed_official 146:f64d43ff0c18 841 void flexcan_hal_set_rx_mb_buf14_ext_mask(
mbed_official 146:f64d43ff0c18 842 uint8_t instance,
mbed_official 146:f64d43ff0c18 843 uint32_t ext_mask);
mbed_official 146:f64d43ff0c18 844
mbed_official 146:f64d43ff0c18 845 /*!
mbed_official 146:f64d43ff0c18 846 * @brief Sets the FlexCAN RX MB BUF15 extended mask.
mbed_official 146:f64d43ff0c18 847 *
mbed_official 146:f64d43ff0c18 848 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 849 * @param ext_mask Extended mask
mbed_official 146:f64d43ff0c18 850 */
mbed_official 146:f64d43ff0c18 851 void flexcan_hal_set_rx_mb_buf15_ext_mask(
mbed_official 146:f64d43ff0c18 852 uint8_t instance,
mbed_official 146:f64d43ff0c18 853 uint32_t ext_mask);
mbed_official 146:f64d43ff0c18 854
mbed_official 146:f64d43ff0c18 855 /*!
mbed_official 146:f64d43ff0c18 856 * @brief Gets the FlexCAN ID acceptance filter hit indicator on Rx FIFO.
mbed_official 146:f64d43ff0c18 857 *
mbed_official 146:f64d43ff0c18 858 * @param instance The FlexCAN instance number
mbed_official 146:f64d43ff0c18 859 * @return RX FIFO information
mbed_official 146:f64d43ff0c18 860 */
mbed_official 146:f64d43ff0c18 861 static inline uint32_t flexcan_hal_get_rx_fifo_id_acceptance_filter(uint8_t instance)
mbed_official 146:f64d43ff0c18 862 {
mbed_official 146:f64d43ff0c18 863 assert(instance < HW_CAN_INSTANCE_COUNT);
mbed_official 146:f64d43ff0c18 864 return BR_CAN_RXFIR_IDHIT(instance);
mbed_official 146:f64d43ff0c18 865 }
mbed_official 146:f64d43ff0c18 866
mbed_official 146:f64d43ff0c18 867 /*@}*/
mbed_official 146:f64d43ff0c18 868
mbed_official 146:f64d43ff0c18 869 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 870 }
mbed_official 146:f64d43ff0c18 871 #endif
mbed_official 146:f64d43ff0c18 872
mbed_official 146:f64d43ff0c18 873 /*! @}*/
mbed_official 146:f64d43ff0c18 874
mbed_official 146:f64d43ff0c18 875 #endif /* __FSL_FLEXCAN_HAL_H__*/
mbed_official 146:f64d43ff0c18 876
mbed_official 146:f64d43ff0c18 877 /*******************************************************************************
mbed_official 146:f64d43ff0c18 878 * EOF
mbed_official 146:f64d43ff0c18 879 ******************************************************************************/
mbed_official 146:f64d43ff0c18 880