Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
canfd_internal.h File Reference

This is an internal header file used by the CANFD module and should not be included directly by the applications. More...

#include <ti/drivers/osal/HwiP.h>
#include <ti/common/sys_common.h>
#include <ti/drivers/canfd/include/hw_mcanss.h>
#include <ti/drivers/canfd/canfd.h>

Data Structures

struct  MCAN_ConfigParams_t
 Data structure defines the MCAN configuration parameters. More...
 
struct  MCAN_RxNewDataStatus_t
 Data structure defines the MCAN new data flag for Rx buffer. More...
 
struct  MCAN_RxFIFOStatus_t
 Data structure defines the MCAN Rx FIFO Status. More...
 
struct  MCAN_TxFIFOStatus_t
 Data structure defines the MCAN Tx FIFO Status. More...
 
struct  MCAN_TxEventFIFOStatus_t
 Data structure defines the MCAN Tx Event FIFO Status. More...
 
struct  MCAN_TxBufElement_t
 Data structure defines the MCAN Tx Buffer element. More...
 
struct  MCAN_RxBufElement_t
 Data structure defines the MCAN Rx Buffer element. More...
 
struct  MCAN_TxEventFIFOElement_t
 Data structure defines the MCAN Tx Event FIFO element. More...
 
struct  MCAN_StdMsgIDFilterElement_t
 Data structure defines the MCAN Standard Message ID Filter Element. More...
 
struct  MCAN_ExtMsgIDFilterElement_t
 Data structure defines the MCAN Extended Message ID Filter Element. More...
 
struct  MCAN_MsgRAMConfigParams_t
 Data structure defines the MCAN Message RAM Configuration Parameters. Message RAM can contain following sections: Standard ID filters, Extended ID filters, TX FIFO(or TX Q), TX Buffers, TX EventFIFO, RX FIFO0, RX FIFO1, RX Buffer. Note: If particular section in the RAM is not used then it's size should be initialized to '0' (Number of buffers in case of Tx/Rx buffer). More...
 
struct  MCAN_HighPriorityMsgInfo_t
 Data structure defines the MCAN High Priority Message. More...
 
struct  MCAN_BitTimingParams_t
 Data structure defines the parameters for bit timing calculation. Bit timing related to data phase will be valid only in case where MCAN is put in CANFD mode and will be '0' otherwise. More...
 
struct  MCAN_RevisionId_t
 Data structure defines the accessing Revision ID and Core Release Info. of MCAN module. More...
 
struct  MCAN_ECCAggrRevisionId_t
 Data structure defines the accessing Revision ID of ECC AGGR. More...
 
struct  MCAN_ECCWrapRevisionId_t
 Data structure defines the accessing Revision ID of ECC wrapper. More...
 
struct  CANFD_HwCfg_t
 CANFD Hardware Atrributes. More...
 
struct  CANFD_DriverMCB_t
 CANFD Master Control Block. More...
 
struct  CANFD_MessageObject_t
 CAN message object block. More...
 

Macros

#define MCAN_MAX_TX_MSG_OBJECTS   (32U)
 Maximum number of Tx message objects that can be supported by CANFD.
 
#define MCAN_MAX_RX_MSG_OBJECTS   (32U)
 Maximum number of Rx message objects that can be supported by CANFD.
 
#define MCAN_MAX_MSG_OBJECTS   (MCAN_MAX_TX_MSG_OBJECTS + MCAN_MAX_RX_MSG_OBJECTS)
 Maximum number of message objects that can be supported by CANFD.
 
#define MCAN_MSG_RAM_STD_ELEM_SIZE   (1U)
 Standard ID Filter Element Size.
 
#define MCAN_MSG_RAM_EXT_ELEM_SIZE   (2U)
 Extended ID Filter Element Size.
 
#define MCAN_MSG_RAM_TX_RX_ELEM_SIZE   (18U)
 Tx/Rx Element Size. 18 words = 18 * 4 = 72 bytes: 8 bytes of header and 64 bytes of data.
 
#define XTD_MSGID_MASK   (0x1fffffffU)
 Message Identifier Masks.
 
#define MCAN_MAX_PAYLOAD_BYTES   (64U)
 Maximum payload supported by CAN-FD protocol in bytes.
 
#define MCAN_MAX_RX_BUFFERS   (64U)
 Maximum number of Rx buffers.
 
#define MCAN_MAX_TX_BUFFERS   (32U)
 Maximum number of Tx buffers.
 
#define MCAN_INTR_MASK
 Defines all the interrupt are enabled.
 

Typedefs

typedef enum MCAN_IntrLineNum_t MCAN_IntrLineNum
 Enumerates the values used to represent the MCAN interrupt lines.
 
typedef enum MCAN_MemType_t MCAN_MemType
 This enumeration defines the values used to represent the MCAN Message RAM type.
 
typedef enum MCAN_RxFIFONum_t MCAN_RxFIFONum
 This enumeration defines the MCAN receive FIFO number.
 
typedef enum CANFD_MCANElemSize_t CANFD_MCANElemSize
 This enumeration defines the MCAN FIFO/Buffer element Size.
 
typedef enum CANFD_DriverState_t CANFD_DriverState
 This enumeration defines the values used to represent the CANFD driver state.
 
typedef enum MCAN_IntrSrc_t MCAN_IntrSrc
 This enumeration defines the values for MCAN interrupts.
 
typedef struct MCAN_ConfigParams_t MCAN_ConfigParams
 Data structure defines the MCAN configuration parameters.
 
typedef struct MCAN_RxNewDataStatus_t MCAN_RxNewDataStatus
 Data structure defines the MCAN new data flag for Rx buffer.
 
typedef struct MCAN_RxFIFOStatus_t MCAN_RxFIFOStatus
 Data structure defines the MCAN Rx FIFO Status.
 
typedef struct MCAN_TxFIFOStatus_t MCAN_TxFIFOStatus
 Data structure defines the MCAN Tx FIFO Status.
 
typedef struct MCAN_TxEventFIFOStatus_t MCAN_TxEventFIFOStatus
 Data structure defines the MCAN Tx Event FIFO Status.
 
typedef struct MCAN_TxBufElement_t MCAN_TxBufElement
 Data structure defines the MCAN Tx Buffer element.
 
typedef struct MCAN_RxBufElement_t MCAN_RxBufElement
 Data structure defines the MCAN Rx Buffer element.
 
typedef struct MCAN_TxEventFIFOElement_t MCAN_TxEventFIFOElement
 Data structure defines the MCAN Tx Event FIFO element.
 
typedef struct MCAN_StdMsgIDFilterElement_t MCAN_StdMsgIDFilterElement
 Data structure defines the MCAN Standard Message ID Filter Element.
 
typedef struct MCAN_ExtMsgIDFilterElement_t MCAN_ExtMsgIDFilterElement
 Data structure defines the MCAN Extended Message ID Filter Element.
 
typedef struct MCAN_MsgRAMConfigParams_t MCAN_MsgRAMConfigParams
 Data structure defines the MCAN Message RAM Configuration Parameters. Message RAM can contain following sections: Standard ID filters, Extended ID filters, TX FIFO(or TX Q), TX Buffers, TX EventFIFO, RX FIFO0, RX FIFO1, RX Buffer. Note: If particular section in the RAM is not used then it's size should be initialized to '0' (Number of buffers in case of Tx/Rx buffer).
 
typedef struct MCAN_HighPriorityMsgInfo_t MCAN_HighPriorityMsgInfo
 Data structure defines the MCAN High Priority Message.
 
typedef struct MCAN_BitTimingParams_t MCAN_BitTimingParams
 Data structure defines the parameters for bit timing calculation. Bit timing related to data phase will be valid only in case where MCAN is put in CANFD mode and will be '0' otherwise.
 
typedef struct MCAN_RevisionId_t MCAN_RevisionId
 Data structure defines the accessing Revision ID and Core Release Info. of MCAN module.
 
typedef struct MCAN_ECCAggrRevisionId_t MCAN_ECCAggrRevisionId
 Data structure defines the accessing Revision ID of ECC AGGR.
 
typedef struct MCAN_ECCWrapRevisionId_t MCAN_ECCWrapRevisionId
 Data structure defines the accessing Revision ID of ECC wrapper.
 
typedef struct CANFD_HwCfg_t CANFD_HwCfg
 CANFD Hardware Atrributes. More...
 
typedef struct CANFD_DriverMCB_t CANFD_DriverMCB
 CANFD Master Control Block. More...
 
typedef struct CANFD_MessageObject_t CANFD_MessageObject
 CAN message object block. More...
 

Enumerations

Functions

void MCAN_reset (uint32_t baseAddr)
 This API is used to initiate reset for MCAN module. More...
 
uint32_t MCAN_isInReset (uint32_t baseAddr)
 This function checks if the MCAN module is in Reset. More...
 
uint32_t MCAN_isFDOpEnable (uint32_t baseAddr)
 This API will return flexible data rate operation status MCAN module. More...
 
uint32_t MCAN_isMemInitDone (uint32_t baseAddr)
 This function checks if the memory initialization is done for MCAN module. More...
 
void MCAN_setOpMode (uint32_t baseAddr, uint32_t mode)
 This API will set MCAN module mode of operation. More...
 
uint32_t MCAN_getOpMode (uint32_t baseAddr)
 This API will return MCAN module mode of operation. More...
 
int32_t MCAN_init (uint32_t baseAddr, const CANFD_MCANInitParams *initParams)
 This API will initialize MCAN module. More...
 
int32_t MCAN_config (uint32_t baseAddr, const CANFD_MCANInitParams *configParams)
 This API will configure MCAN module. More...
 
void MCAN_eccConfig (uint32_t baseAddr, const CANFD_MCANECCConfigParams *configParams)
 This API will enable/disable ECC on the Message RAM. More...
 
int32_t MCAN_setBitTime (uint32_t baseAddr, const MCAN_BitTimingParams *configParams)
 This API will configure a bit timings for MCAN module. More...
 
int32_t MCAN_msgRAMConfig (uint32_t baseAddr, const MCAN_MsgRAMConfigParams *msgRAMConfigParams)
 This API will configure Different sections of Message RAM. More...
 
int32_t MCAN_setExtIDAndMask (uint32_t baseAddr, uint32_t idMask)
 This API will configure Extended ID AND Mask. More...
 
void MCAN_writeMsgRam (uint32_t baseAddr, uint32_t memType, uint32_t bufNum, const MCAN_TxBufElement *elem)
 This API is used to write Tx message to message RAM. More...
 
int32_t MCAN_txBufAddReq (uint32_t baseAddr, uint32_t bufNum)
 This API will set Tx Buffer Add Request. More...
 
void MCAN_getNewDataStatus (uint32_t baseAddr, MCAN_RxNewDataStatus *newDataStatus)
 This API will return New Data Message Status. More...
 
void MCAN_clearNewDataStatus (uint32_t baseAddr, const MCAN_RxNewDataStatus *newDataStatus)
 This API clear New Data Message Status. More...
 
void MCAN_readMsgRam (uint32_t baseAddr, uint32_t memType, uint32_t bufNum, uint32_t fifoNum, MCAN_RxBufElement *elem)
 This API is used to read received message form message RAM. More...
 
void MCAN_addStdMsgIDFilter (uint32_t baseAddr, uint32_t filtNum, const MCAN_StdMsgIDFilterElement *elem)
 This API is used to add Standard Message ID Filter Element. More...
 
void MCAN_addExtMsgIDFilter (uint32_t baseAddr, uint32_t filtNum, const MCAN_ExtMsgIDFilterElement *elem)
 This API is used to add Extended Message ID Filter Element. More...
 
void MCAN_lpbkModeEnable (uint32_t baseAddr, uint32_t lpbkMode, uint32_t enable)
 This API will enable/disable Loop Back Test Mode for MCAN module. More...
 
void MCAN_getErrCounters (uint32_t baseAddr, CANFD_MCANErrCntStatus *errCounter)
 This API will return error counter status for MCAN module. More...
 
void MCAN_getProtocolStatus (uint32_t baseAddr, CANFD_MCANProtocolStatus *protStatus)
 This API will return protocol status for MCAN module. More...
 
void MCAN_enableIntr (uint32_t baseAddr, uint32_t intrMask, uint32_t enable)
 This API is used to enable/disable interrupts. More...
 
void MCAN_selectIntrLine (uint32_t baseAddr, uint32_t intrMask, uint32_t lineNum)
 This API is used to select interrupt line. More...
 
void MCAN_enableIntrLine (uint32_t baseAddr, uint32_t lineNum, uint32_t enable)
 This API is used to enable/disable selected interrupt line. More...
 
uint32_t MCAN_getIntrStatus (uint32_t baseAddr)
 This API will return interrupt status. More...
 
void MCAN_clearIntrStatus (uint32_t baseAddr, uint32_t intrMask)
 This API is used to clear the interrupt status. More...
 
void MCAN_getHighPriorityMsgStatus (uint32_t baseAddr, MCAN_HighPriorityMsgInfo *hpm)
 This API will return High Priority Message Status. More...
 
void MCAN_getRxFIFOStatus (uint32_t baseAddr, MCAN_RxFIFOStatus *fifoStatus)
 This API will Rx FIFO status. More...
 
int32_t MCAN_writeRxFIFOAck (uint32_t baseAddr, uint32_t fifoNum, uint32_t idx)
 This API will write Rx FIFO Acknowledgement. More...
 
void MCAN_getTxFIFOQueStatus (uint32_t baseAddr, MCAN_TxFIFOStatus *fifoStatus)
 This API will Tx FIFO status. More...
 
uint32_t MCAN_getTxBufReqPend (uint32_t baseAddr)
 This API will return Tx Buffer Request Pending status. More...
 
int32_t MCAN_txBufCancellationReq (uint32_t baseAddr, uint32_t buffNum)
 This API will set Tx Buffer Cancellation Request. More...
 
uint32_t MCAN_getTxBufTransmissionStatus (uint32_t baseAddr)
 This API will return Tx Buffer Transmission Occurred status. More...
 
uint32_t MCAN_txBufCancellationStatus (uint32_t baseAddr)
 This API will return Transmit Buffer Cancellation Finished status. More...
 
int32_t MCAN_txBufTransIntrEnable (uint32_t baseAddr, uint32_t bufNum, uint32_t enable)
 This API is used to enable/disable Tx Buffer Transmission Interrupt. More...
 
int32_t MCAN_getTxBufCancellationIntrEnable (uint32_t baseAddr, uint32_t bufNum, uint32_t enable)
 This API is used to enable/disable Tx Buffer Cancellation Finished Interrupt. More...
 
void MCAN_addClockStopRequest (uint32_t baseAddr, uint32_t enable)
 This API add clock stop request for MCAN module to put it in power down mode. More...
 
void MCAN_getTxEventFIFOStatus (uint32_t baseAddr, MCAN_TxEventFIFOStatus *fifoStatus)
 This API will Tx Event FIFO status. More...
 
int32_t MCAN_writeTxEventFIFOAck (uint32_t baseAddr, uint32_t idx)
 This API will write Event FIFO Acknowledge Index. More...
 
void MCAN_eccForceError (uint32_t baseAddr, const CANFD_MCANECCErrForceParams *eccErr)
 This API will Force Error on ECC. More...
 
void MCAN_eccGetErrorStatus (uint32_t baseAddr, CANFD_MCANECCErrStatus *eccErr)
 This API will return ECC Error status. More...
 
void MCAN_eccClearErrorStatus (uint32_t baseAddr, uint32_t errType)
 This API is used to clear the ECC Error status. More...
 
void MCAN_eccWriteEOI (uint32_t baseAddr, uint32_t errType)
 This API is used to write End of Interrupt for ECC interrupt. More...
 
void MCAN_eccEnableIntr (uint32_t baseAddr, uint32_t errType, uint32_t enable)
 This API is used to enable ECC interrupt. More...
 
uint32_t MCAN_eccGetIntrStatus (uint32_t baseAddr, uint32_t errType)
 This API is used to get ECC interrupt status. More...
 
void MCAN_eccClearIntrStatus (uint32_t baseAddr, uint32_t errType)
 This API is used to clear ECC interrupt status. More...
 
void MCAN_extTSCounterConfig (uint32_t baseAddr, uint32_t prescalar)
 This API will configure external timestamp counter for MCAN module. More...
 
void MCAN_extTSCounterEnable (uint32_t baseAddr, uint32_t enable)
 This API will enable/disable fast external time stamp counter for MCAN module. More...
 
void MCAN_extTSEnableIntr (uint32_t baseAddr, uint32_t enable)
 This API will enable/disable External TimeStamp Counter Overflow Interrupt for MCAN module. More...
 
void MCAN_extTSWriteEOI (uint32_t baseAddr)
 This API is used to write End of Interrupt for External TimeStamp Counter Overflow Interrupt. More...
 
uint32_t MCAN_extTSGetUnservicedIntrCount (uint32_t baseAddr)
 This API returns Number of unserviced rollover/overflow interrupts for external TimeStamp counter. More...
 
void MCAN_getRevisionId (uint32_t baseAddr, MCAN_RevisionId *revId)
 This API is used get the MCAN revision ID. More...
 
uint32_t MCAN_getClockStopAck (uint32_t baseAddr)
 This API get clock stop acknowledgement for MCAN module. It return whether MCAN is power down mode or not. More...
 
void MCAN_extTSSetRawStatus (uint32_t baseAddr)
 This API will set External TimeStamp Counter Overflow Interrupt Raw status for MCAN module. More...
 
void MCAN_extTSClearRawStatus (uint32_t baseAddr)
 This API will clear External TimeStamp Counter Overflow Interrupt raw status for MCAN module. More...
 
uint32_t MCAN_getRxPinState (uint32_t baseAddr)
 This API will return Rx pin state of MCAN module. More...
 
void MCAN_setTxPinState (uint32_t baseAddr, uint32_t state)
 This API will set Tx pin state of MCAN module. More...
 
uint32_t MCAN_getTxPinState (uint32_t baseAddr)
 This API will return Tx pin state of MCAN module. More...
 
uint32_t MCAN_getTSCounterVal (uint32_t baseAddr)
 This API will return current timestamp counter value. More...
 
uint32_t MCAN_getClkStopAck (uint32_t baseAddr)
 This API will return clock stop acknowledgement for MCAN module. More...
 
void MCAN_getBitTime (uint32_t baseAddr, MCAN_BitTimingParams *configParams)
 This API will get the configured bit timings for MCAN module. More...
 
void MCAN_resetTSCounter (uint32_t baseAddr)
 This API will reset timestamp counter value. More...
 
uint32_t MCAN_getTOCounterVal (uint32_t baseAddr)
 This API will return current time-out counter value. More...
 
void MCAN_eccAggrGetRevisionId (uint32_t baseAddr, MCAN_ECCAggrRevisionId *revId)
 This API is used get the ECC AGGR revision ID. More...
 
void MCAN_eccWrapGetRevisionId (uint32_t baseAddr, MCAN_ECCWrapRevisionId *revId)
 This API is used get the ECC Wrapper revision ID. More...
 
uint32_t MCAN_extTSIsIntrEnable (uint32_t baseAddr)
 This API returns External TimeStamp Counter Overflow Interrupt enable status for MCAN module. More...
 
uint32_t MCAN_getEndianVal (uint32_t baseAddr)
 This function return endianness value of MCAN module. More...
 
uint32_t MCAN_getExtIDANDMassk (uint32_t baseAddr)
 This API will get the configured Extended ID AND Mask. More...
 

Variables

CANFD_HwCfg gCanFdHwCfg [2]
 Platform specific CANFD initializations. This is XWR16xx specific configuration and should NOT be modified by the customer. More...
 

Detailed Description

This is an internal header file used by the CANFD module and should not be included directly by the applications.

NOTE: (C) Copyright 2016 Texas Instruments, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Variable Documentation

CANFD_HwCfg gCanFdHwCfg[2]

Platform specific CANFD initializations. This is XWR16xx specific configuration and should NOT be modified by the customer.

Platform specific CANFD initializations. This is XWR16xx specific configuration and should NOT be modified by the customer.


Copyright 2020, Texas Instruments Incorporated