SAMV71 Xplained Ultra Software Package 1.5

mcan.h File Reference

#include "chip.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  MailboxInfoType
struct  Mailbox8Type
struct  Mailbox12Type
struct  Mailbox16Type
struct  Mailbox20Type
struct  Mailbox24Type
struct  Mailbox32ype
struct  Mailbox48Type
struct  Mailbox64Type
struct  MCan_MsgRamPntrs
struct  MCan_ConfigType

Enumerations

enum  MCan_IdType { CAN_STD_ID = 0, CAN_EXT_ID = 1 }
enum  MCan_DlcType {
  CAN_DLC_0 = 0, CAN_DLC_1 = 1, CAN_DLC_2 = 2, CAN_DLC_3 = 3,
  CAN_DLC_4 = 4, CAN_DLC_5 = 5, CAN_DLC_6 = 6, CAN_DLC_7 = 7,
  CAN_DLC_8 = 8, CAN_DLC_12 = 9, CAN_DLC_16 = 10, CAN_DLC_20 = 11,
  CAN_DLC_24 = 12, CAN_DLC_32 = 13, CAN_DLC_48 = 14, CAN_DLC_64 = 15
}
enum  MCan_FifoType { CAN_FIFO_0 = 0, CAN_FIFO_1 = 1 }
enum  MCan_IntrLineType { CAN_INTR_LINE_0 = 0, CAN_INTR_LINE_1 = 1 }

Functions

__STATIC_INLINE uint32_t MCAN_IsTxComplete (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE void MCAN_ClearTxComplete (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE uint32_t MCAN_IsMessageStoredToRxDedBuffer (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE void MCAN_ClearMessageStoredToRxBuffer (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE uint32_t MCAN_IsMessageStoredToRxFifo0 (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE void MCAN_ClearMessageStoredToRxFifo0 (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE uint32_t MCAN_IsMessageStoredToRxFifo1 (const MCan_ConfigType *mcanConfig)
__STATIC_INLINE void MCAN_ClearMessageStoredToRxFifo1 (const MCan_ConfigType *mcanConfig)
void MCAN_Init (const MCan_ConfigType *mcanConfig)
 Initializes the MCAN hardware for giving peripheral. Default: Mixed mode TX Buffer + FIFO.
void MCAN_InitFdEnable (const MCan_ConfigType *mcanConfig)
 Enables a FUTURE switch to FD mode (tx & rx payloads up to 64 bytes) but transmits WITHOUT bit rate switching INIT must be set - so this should be called between MCAN_Init() and MCAN_Enable().
void MCAN_InitFdBitRateSwitchEnable (const MCan_ConfigType *mcanConfig)
 Enables a FUTURE switch to FD mode (tx & rx payloads up to 64 bytes) and transmits WITH bit rate switching INIT must be set - so this should be called between MCAN_Init() and MCAN_Enable().
void MCAN_InitTxQueue (const MCan_ConfigType *mcanConfig)
 Initializes MCAN queue for TX INIT must be set - so this should be called between MCAN_Init() and MCAN_Enable().
void MCAN_InitLoopback (const MCan_ConfigType *mcanConfig)
 Initializes the MCAN in loop back mode. INIT must be set - so this should be called between MCAN_Init() and MCAN_Enable().
void MCAN_Enable (const MCan_ConfigType *mcanConfig)
 Enable MCAN peripheral. INIT must be set - so this should be called between MCAN_Init().
void MCAN_RequestIso11898_1 (const MCan_ConfigType *mcanConfig)
 Requests switch to Iso11898-1 (standard / classic) mode (tx & rx payloads up to 8 bytes).
void MCAN_RequestFd (const MCan_ConfigType *mcanConfig)
 Requests switch to FD mode (tx & rx payloads up to 64 bytes) but transmits WITHOUT bit rate switching. requested mode should have been enabled at initialization.
void MCAN_RequestFdBitRateSwitch (const MCan_ConfigType *mcanConfig)
 Request switch to FD mode (tx & rx payloads up to 64 bytes) and transmits WITH bit rate switching. requested mode should have been enabled at initialization.
void MCAN_LoopbackOn (const MCan_ConfigType *mcanConfig)
 Switch on loop back mode. TEST must be set in MCAN_CCCR - e.g. by a prior call to MCAN_InitLoopback().
void MCAN_LoopbackOff (const MCan_ConfigType *mcanConfig)
 Switch off loop back mode.
void MCAN_IEnableMessageStoredToRxDedBuffer (const MCan_ConfigType *mcanConfig, MCan_IntrLineType line)
 Enable message line and message stored to Dedicated Receive Buffer Interrupt Line.
uint8_t * MCAN_ConfigTxDedBuffer (const MCan_ConfigType *mcanConfig, uint8_t buffer, uint32_t id, MCan_IdType idType, MCan_DlcType dlc)
 Configures a Dedicated TX Buffer.
void MCAN_SendTxDedBuffer (const MCan_ConfigType *mcanConfig, uint8_t buffer)
 Send Tx buffer.
uint32_t MCAN_AddToTxFifoQ (const MCan_ConfigType *mcanConfig, uint32_t id, MCan_IdType idType, MCan_DlcType dlc, uint8_t *data)
 Adds Message to TX Fifo / Queue.
uint8_t MCAN_IsBufferTxd (const MCan_ConfigType *mcanConfig, uint8_t buffer)
 Check if data transmitted from buffer/fifo/queue.
void MCAN_ConfigRxBufferFilter (const MCan_ConfigType *mcanConfig, uint32_t buffer, uint32_t filter, uint32_t id, MCan_IdType idType)
 Configure RX Buffer Filter ID must match exactly for a RX Buffer Filter.
void MCAN_ConfigRxClassicFilter (const MCan_ConfigType *mcanConfig, MCan_FifoType fifo, uint8_t filter, uint32_t id, MCan_IdType idType, uint32_t mask)
 Configure Classic Filter Classic Filters direct accepted messages to a FIFO & include both a ID and a ID mask.
uint8_t MCAN_IsNewDataInRxDedBuffer (const MCan_ConfigType *mcanConfig, uint8_t buffer)
 check if data received into buffer
void MCAN_GetRxDedBuffer (const MCan_ConfigType *mcanConfig, uint8_t buffer, Mailbox64Type *pRxMailbox)
 Get Rx buffer.
uint32_t MCAN_GetRxFifoBuffer (const MCan_ConfigType *mcanConfig, MCan_FifoType fifo, Mailbox64Type *pRxMailbox)
 Get from the receive FIFO and place in a application mailbox.

Variables

const MCan_ConfigType mcan0Config
const MCan_ConfigType mcan1Config

Detailed Description

Purpose

Interface for configuring and using Timer Counter (TC) peripherals.

Usage

  1. Optionally, use TC_FindMckDivisor() to let the program find the best TCCLKS field value automatically.
  2. Configure a Timer Counter in the desired mode using TC_Configure().
  3. Start or stop the timer clock using TC_Start() and TC_Stop().

Definition in file mcan.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines