Functions
canfd.c File Reference

The file implements the Controller Area Network Driver Flexible data for XWR16xx/XWR18xx/XWR68xx. More...

#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <ti/drivers/osal/MemoryP.h>
#include <ti/drivers/osal/DebugP.h>
#include <ti/drivers/osal/HwiP.h>
#include <ti/common/hw_types.h>
#include <ti/common/sys_common.h>
#include <ti/drivers/canfd/include/canfd_internal.h>

Functions

static void CANFD_processFIFOElements (CANFD_DriverMCB *ptrCanFdMCB, MCAN_RxFIFONum fifoNum)
 
static void CANFD_MCANInt0Isr (uintptr_t arg)
 
static void CANFD_MCANInt1Isr (uintptr_t arg)
 
static void CANFD_configMessageRAM (const CANFD_DriverMCB *ptrCanFdMCB, const CANFD_MCANMsgRAMCfgParams *configParams, int32_t *errCode)
 
CANFD_Handle CANFD_init (uint8_t instanceId, const CANFD_MCANInitParams *configParams, int32_t *errCode)
 
int32_t CANFD_deinit (CANFD_Handle handle, int32_t *errCode)
 
int32_t CANFD_configBitTime (CANFD_Handle handle, const CANFD_MCANBitTimingParams *bitTimeParams, int32_t *errCode)
 
CANFD_MsgObjHandle CANFD_createMsgObject (CANFD_Handle handle, const CANFD_MCANMsgObjCfgParams *msgObjectParams, int32_t *errCode)
 
CANFD_MsgObjHandle CANFD_createRxRangeMsgObject (CANFD_Handle handle, const CANFD_MCANRxMsgObjRangeCfgParams *msgObjectParams, int32_t *errCode)
 
int32_t CANFD_deleteMsgObject (CANFD_MsgObjHandle handle, int32_t *errCode)
 
int32_t CANFD_transmitData (CANFD_MsgObjHandle handle, uint32_t id, CANFD_MCANFrameType frameType, uint32_t dataLength, const uint8_t *data, int32_t *errCode)
 
int32_t CANFD_transmitDataCancel (CANFD_MsgObjHandle handle, int32_t *errCode)
 
int32_t CANFD_getData (CANFD_MsgObjHandle handle, uint32_t *id, CANFD_MCANFrameType *ptrFrameType, CANFD_MCANXidType *idType, uint32_t *ptrDataLength, uint8_t *data, int32_t *errCode)
 
int32_t CANFD_getOptions (CANFD_Handle handle, const CANFD_OptionTLV *ptrOptInfo, int32_t *errCode)
 
int32_t CANFD_setOptions (CANFD_Handle handle, const CANFD_OptionTLV *ptrOptInfo, int32_t *errCode)
 

Detailed Description

The file implements the Controller Area Network Driver Flexible data for XWR16xx/XWR18xx/XWR68xx.

NOTE: (C) Copyright 2017 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.

Function Documentation

static void CANFD_configMessageRAM ( const CANFD_DriverMCB *  ptrCanFdMCB,
const CANFD_MCANMsgRAMCfgParams *  configParams,
int32_t *  errCode 
)
static

Description
Function initializes the CANFD driver instance with the specified hardware attributes. It resets and configures the MCAN module, sets up the Message RAM and ECC Aggregator. It configures the CANFD driver with the control parameters.

Parameters
[in]ptrCanFdMCBPointer to the CANFD driver MCB
[in]configParamsCAN module configuration parameters
[out]errCodeError code populated on error
Return values
Success- Handle to the CAN Driver
Error- NULL
static void CANFD_processFIFOElements ( CANFD_DriverMCB *  ptrCanFdMCB,
MCAN_RxFIFONum  fifoNum 
)
static

Description
Function processes the Rx FIFO and calls application callback function to receive data.

Parameters
[in]ptrCanFdMCBPointer to the CANFD driver MCB
[in]fifoNumRx FiFO number
Return values
Success- Handle to the CAN Driver
Error- NULL

Copyright 2020, Texas Instruments Incorporated