NetBurner 3.5.6
PDF Version
mcanMODM7AE70::mcan_module Class Reference

MCAN Module Class. More...

#include <mcan.h>

Public Member Functions

 mcan_module (Mcan *phw, uint32_t baud)
 Create a MCAN module instance.
 
void init (Mcan *phw, struct mcan_config *config, uint32_t baud)
 Initialize a MCAN module.
 
void send_message (uint32_t id_value, uint8_t *data, uint32_t data_length, OS_SEM *pSem=0)
 Send a MCAN message.
 
bool blocking_send_message (uint32_t id_value, uint8_t *data, uint32_t data_length, uint32_t TimeOut)
 Send a MCAN message and block until sent.
 
int RegisterRxFifo (uint32_t composite_id, OS_FIFO *pFifo, int channel=-1)
 Register a FIFO to receive CAN messages.
 
int RegisterRxFifoMask (uint32_t composite_id, uint32_t mask, OS_FIFO *pFifo, int channel=-1)
 Register a FIFO to receive messages as specified by the address bit mask. A value of 1 = match, a value of 0 = does not match.
 
int RegisterRxFifoRange (uint32_t composite_id_low, uint32_t composite_id_hi, OS_FIFO *pFifo, int channel=-1)
 Register a FIFO to receive messages in the specified numeric range of addresses from low to high.
 
int UnRegisterFifo (int channel)
 Unregister the FIFO for the specified CAN channel.
 
int MultiCanSetRTRMessage (uint32_t id, uint8_t *data, uint8_t len, int channel=-1)
 Enable an auto-reply to a CAN RTR message for the specified CAN ID. The reply message is specified by the data parameter.
 
int MultiCanReplaceRTRMessage (int channel, uint8_t *data, uint8_t len)
 Modifies/updates the response for the RTR message registered wotj MultiCanSetRTRMessage().
 
int MultiCanStopRTRMessage (int channel)
 Unregister the RTR message for the specified channel.
 

Detailed Description

MCAN Module Class.

Class to control a MCAN modules (peripherals) on the MODM7AE70

Constructor & Destructor Documentation

◆ mcan_module()

mcanMODM7AE70::mcan_module::mcan_module ( Mcan * phw,
uint32_t baud )

Create a MCAN module instance.

Parameters
phwMCAN hardware peripheral, MCAN0 or MCAN 1
baudMCAN baud rate. For example, 500000

Member Function Documentation

◆ blocking_send_message()

bool mcanMODM7AE70::mcan_module::blocking_send_message ( uint32_t id_value,
uint8_t * data,
uint32_t data_length,
uint32_t TimeOut )

Send a MCAN message and block until sent.

Parameters
id_valueCAN ID, 11-bit standard or 29-bit extended
dataPointer to message data
data_lengthLength of data in bytes
TimeOutTime out value in system time ticks. For example, TICKS_PER_SECOND * 1

◆ init()

void mcanMODM7AE70::mcan_module::init ( Mcan * phw,
struct mcan_config * config,
uint32_t baud )

Initialize a MCAN module.

Parameters
phwMCAN hardware peripheral, MCAN0 or MCAN 1
configPointer to a mcan_config object, initialized with appropriate values.
baudMCAN baud rate. For example, 500000

◆ MultiCanReplaceRTRMessage()

int mcanMODM7AE70::mcan_module::MultiCanReplaceRTRMessage ( int channel,
uint8_t * data,
uint8_t len )

Modifies/updates the response for the RTR message registered wotj MultiCanSetRTRMessage().

Returns
The channel number registered for the RTR message.
See also
MultiCanSetRTRMessage(), MultiCanStopRTRMessage()

◆ MultiCanSetRTRMessage()

int mcanMODM7AE70::mcan_module::MultiCanSetRTRMessage ( uint32_t id,
uint8_t * data,
uint8_t len,
int channel = -1 )

Enable an auto-reply to a CAN RTR message for the specified CAN ID. The reply message is specified by the data parameter.

The response message can be modified with MultiCanReplaceRTRMessage().

Parameters
idCAN ID, 11-bit standard or 29-bit extended
dataPointer to message data
lenLength of message
channelOptional CAN channel
Returns
The channel number corresponding to the ID and RTR message.
See also
MultiCanReplaceRTRMessage(), MultiCanStopRTRMessage()

◆ MultiCanStopRTRMessage()

int mcanMODM7AE70::mcan_module::MultiCanStopRTRMessage ( int channel)

Unregister the RTR message for the specified channel.

Parameters
channelCAN channel number
Returns
OS_NO_ERR on success
See also
MultiCanSetRTRMessage(), MultiCanReplaceRTRMessage()

◆ RegisterRxFifo()

int mcanMODM7AE70::mcan_module::RegisterRxFifo ( uint32_t composite_id,
OS_FIFO * pFifo,
int channel = -1 )

Register a FIFO to receive CAN messages.

Parameters
composite_idCAN ID, 11-bit standard or 29-bit extended
pFifoPointer to OS_FIFO for received data
channelOptional CAN channel
Returns
OS_NO_ERR on success

◆ RegisterRxFifoMask()

int mcanMODM7AE70::mcan_module::RegisterRxFifoMask ( uint32_t composite_id,
uint32_t mask,
OS_FIFO * pFifo,
int channel = -1 )

Register a FIFO to receive messages as specified by the address bit mask. A value of 1 = match, a value of 0 = does not match.

Parameters
composite_idCAN ID, 11-bit standard or 29-bit extended
maskId mask
pFifoPointer to OS_FIFO for received data
channelOptional CAN channel
Returns
OS_NO_ERR on success

◆ RegisterRxFifoRange()

int mcanMODM7AE70::mcan_module::RegisterRxFifoRange ( uint32_t composite_id_low,
uint32_t composite_id_hi,
OS_FIFO * pFifo,
int channel = -1 )

Register a FIFO to receive messages in the specified numeric range of addresses from low to high.

Parameters
composite_id_lowComposite ID low value
composite_id_hiComposite ID high value
pFifoPointer to OS_FIFO for received data
channelOptional CAN channel
Returns
OS_NO_ERR on success

◆ send_message()

void mcanMODM7AE70::mcan_module::send_message ( uint32_t id_value,
uint8_t * data,
uint32_t data_length,
OS_SEM * pSem = 0 )

Send a MCAN message.

Parameters
id_valueCAN ID, 11-bit standard or 29-bit extended
dataPointer to message data
data_lengthLength of data in bytes
pSemOptional pointer to semaphore to post to, default is no post

◆ UnRegisterFifo()

int mcanMODM7AE70::mcan_module::UnRegisterFifo ( int channel)

Unregister the FIFO for the specified CAN channel.

Parameters
channelCAN channel number
Returns
OS_NO_ERR on success

The documentation for this class was generated from the following file: