chg-stn-motherboard-ti-mcu/Core/Include/ivec_mcal_mcan.h

41 lines
1.5 KiB
C

#ifndef CORE_INCLUDE_IVEc_MCAL_MCAN_H_
#define CORE_INCLUDE_IVEc_MCAL_MCAN_H_
#include "..\utils\utils.h"
#include "ti_msp_dl_config.h"
/* Enum for CAN ID Types */
typedef enum {
IVEC_MCAL_CAN_ID_STD = 0x00, /* Standard ID */
IVEC_MCAL_CAN_ID_EXT = 0x01, /* Extended ID */
IVEC_MCAL_CAN_ID_ERROR = 0x02 /* Error ID */
} xMCAL_CanIdType_e;
/* Function Prototypes for MCAN MCAL Layer */
/* Initialize the MCAN module */
IVEC_McalStatus_e vMCAL_MCAN_Init(MCAN_Regs* pMCAN, IVEC_CanBaud_e eBaudRate);
/* Deinitialize the MCAN module */
IVEC_McalStatus_e vMCAL_MCAN_DeInit(MCAN_Regs* const pMCAN);
/* Transmit data via MCAN */
IVEC_McalStatus_e vMCAL_MCAN_Tx(MCAN_Regs* const pMCAN, uint32_t u32Id, uint16_t* pu16TxData, uint32_t u32BufNum, uint32_t u32Bytes);
/* Transmit data via MCAN in blocking mode */
IVEC_McalStatus_e vMCAL_MCAN_TxBlocking(MCAN_Regs* const pMCAN, uint32_t u32Id, uint16_t* pu16TxData, uint32_t u32BufNum, int iBytes);
/* Receive data via MCAN */
IVEC_McalStatus_e vMCAL_MCAN_Rx(MCAN_Regs* const pMCAN, uint32_t* pu32Id, uint8_t* pu8RxData, int iDLC);
/* Get the error status of the MCAN module */
IVEC_McalStatus_e vMCAL_MCAN_GetErrorStatus(char* pcErrorStatus);
/* Get interrupt status of MCAN Interrupt Line 1 */
IVEC_McalStatus_e vMCAL_MCAN_GetInterruptLine1Status(uint32_t* pu32InterruptStatus);
/* Reset the MCAN module */
IVEC_McalStatus_e vMCAL_MCAN_Reset(MCAN_Regs* const pMCAN, IVEC_CanBaud_e eBaudRate);
#endif /* CORE_INCLUDE_IVEc_MCAL_MCAN_H_ */