iLLD_TC27xC  1.0
Message Objects
Collaboration diagram for Message Objects:

Functions

IFX_INLINE boolean IfxMultican_Can_MsgObj_cancelSend (IfxMultican_Can_MsgObj *msgObj)
 Cancel pending TX request by invalidating the request
Only when frame transmission has not been started. More...
 
IFX_INLINE void IfxMultican_Can_MsgObj_clearRxPending (IfxMultican_Can_MsgObj *msgObj)
 Clear the RX pending flag of a message object. More...
 
IFX_INLINE void IfxMultican_Can_MsgObj_clearTxPending (IfxMultican_Can_MsgObj *msgObj)
 Clear the TX pending flag of a message object. More...
 
IFX_INLINE void IfxMultican_Can_MsgObj_deinit (IfxMultican_Can_MsgObj *msgObj)
 Reset the message object
Append the message object to the end of idle list and reset message object registers. More...
 
IFX_INLINE IfxMultican_MsgObjId IfxMultican_Can_MsgObj_getPendingId (IfxMultican_Can_MsgObj *msgObj, IfxMultican_MsgObjGroup msgObjGroup)
 Get message object ID which has TX/RX pending flag from a message object group. More...
 
IFX_INLINE IfxMultican_MsgObjStat IfxMultican_Can_MsgObj_getStatus (IfxMultican_Can_MsgObj *msgObj)
 Get the message object status. More...
 
IFX_INLINE IfxMultican_Status IfxMultican_Can_MsgObj_readLongFrame (IfxMultican_Can_MsgObj *msgObj, IfxMultican_Message *msg, uint32 *data)
 Read a received CAN message. More...
 
IFX_INLINE IfxMultican_Status IfxMultican_Can_MsgObj_sendLongFrame (IfxMultican_Can_MsgObj *msgObj, IfxMultican_Message *msg, uint32 *data)
 Read a received CAN message. More...
 
IFX_EXTERN void IfxMultican_Can_MsgObj_getConfig (IfxMultican_Can_MsgObj *msgObj, IfxMultican_Can_MsgObjConfig *config)
 Get the actual message object configuration. More...
 
IFX_EXTERN IfxMultican_Status IfxMultican_Can_MsgObj_init (IfxMultican_Can_MsgObj *msgObj, const IfxMultican_Can_MsgObjConfig *config)
 Initialize the message object. More...
 
IFX_EXTERN void IfxMultican_Can_MsgObj_initConfig (IfxMultican_Can_MsgObjConfig *config, IfxMultican_Can_Node *node)
 Initialise message config with default values and the given parameters. More...
 
IFX_EXTERN boolean IfxMultican_Can_MsgObj_isRxPending (IfxMultican_Can_MsgObj *msgObj)
 Returns the RX pending flag of a message object. More...
 
IFX_EXTERN boolean IfxMultican_Can_MsgObj_isTxPending (IfxMultican_Can_MsgObj *msgObj)
 Returns the TX pending flag of a message object. More...
 
IFX_EXTERN IfxMultican_Status IfxMultican_Can_MsgObj_readMessage (IfxMultican_Can_MsgObj *msgObj, IfxMultican_Message *msg)
 Read a received CAN message. More...
 
IFX_EXTERN IfxMultican_Status IfxMultican_Can_MsgObj_sendMessage (IfxMultican_Can_MsgObj *msgObj, const IfxMultican_Message *msg)
 Send a CAN message. More...
 

Detailed Description

Function Documentation

IFX_INLINE boolean IfxMultican_Can_MsgObj_cancelSend ( IfxMultican_Can_MsgObj msgObj)

Cancel pending TX request by invalidating the request
Only when frame transmission has not been started.

Parameters
msgObjpointer to the CAN message object handle
Returns
TRUE if cancellation was successfully executed

Definition at line 1284 of file IfxMultican_Can.h.

IFX_INLINE void IfxMultican_Can_MsgObj_clearRxPending ( IfxMultican_Can_MsgObj msgObj)

Clear the RX pending flag of a message object.

Parameters
msgObjpointer to the CAN message object handle
Returns
None
// clear pending flag

Definition at line 1292 of file IfxMultican_Can.h.

IFX_INLINE void IfxMultican_Can_MsgObj_clearTxPending ( IfxMultican_Can_MsgObj msgObj)

Clear the TX pending flag of a message object.

Parameters
msgObjpointer to the CAN message object handle
Returns
None
// clear pending flag

Definition at line 1300 of file IfxMultican_Can.h.

IFX_INLINE void IfxMultican_Can_MsgObj_deinit ( IfxMultican_Can_MsgObj msgObj)

Reset the message object
Append the message object to the end of idle list and reset message object registers.

Parameters
msgObjpointer to the CAN message object handle
Returns
None

Definition at line 1308 of file IfxMultican_Can.h.

IFX_EXTERN void IfxMultican_Can_MsgObj_getConfig ( IfxMultican_Can_MsgObj msgObj,
IfxMultican_Can_MsgObjConfig config 
)

Get the actual message object configuration.

Parameters
msgObjpointer to the CAN message object handle
configPointer to the RAM buffer. Filled by this function
Returns
None

Definition at line 37 of file IfxMultican_Can.c.

IFX_INLINE IfxMultican_MsgObjId IfxMultican_Can_MsgObj_getPendingId ( IfxMultican_Can_MsgObj msgObj,
IfxMultican_MsgObjGroup  msgObjGroup 
)

Get message object ID which has TX/RX pending flag from a message object group.

Parameters
msgObjpointer to the CAN message object handle
msgObjGroupMessage object group
Returns
Message Object Id

Definition at line 1314 of file IfxMultican_Can.h.

IFX_INLINE IfxMultican_MsgObjStat IfxMultican_Can_MsgObj_getStatus ( IfxMultican_Can_MsgObj msgObj)

Get the message object status.

Parameters
msgObjpointer to the CAN message object handle
Returns
IfxMultican_MsgObjStat bitfield
msgStatus = IfxMultican_Can_MsgObj_getStatus(&canMsgObj[node]);

Definition at line 1320 of file IfxMultican_Can.h.

IFX_EXTERN IfxMultican_Status IfxMultican_Can_MsgObj_init ( IfxMultican_Can_MsgObj msgObj,
const IfxMultican_Can_MsgObjConfig config 
)

Initialize the message object.

Parameters
msgObjpointer to the CAN message object handle
configpointer to the CAN message object configuration
Returns
Status
// create message object config
IfxMultican_Can_MsgObj_initConfig(&canMsgObjConfig, &canNode[node]);
canMsgObjConfig.msgObjId = node;
canMsgObjConfig.messageId = id;
canMsgObjConfig.acceptanceMask = 0x7FFFFFFFUL;
canMsgObjConfig.frame = IfxMultican_Frame_receive;
canMsgObjConfig.control.messageLen = 8;
canMsgObjConfig.control.extendedFrame = FALSE;
canMsgObjConfig.control.matchingId = TRUE;
// initialize message object
//IfxMultican_Can_MsgObj canMsgObj[TESTED_NODES]; // declared globally
IfxMultican_Can_MsgObj_init(&canMsgObj[node], &canMsgObjConfig);

Definition at line 70 of file IfxMultican_Can.c.

IFX_EXTERN void IfxMultican_Can_MsgObj_initConfig ( IfxMultican_Can_MsgObjConfig config,
IfxMultican_Can_Node node 
)

Initialise message config with default values and the given parameters.

Parameters
configpointer to the CAN message object configuration
nodepointer to the CAN node handle to which the message object should be assigned
Returns
None

A coding example can be found in IfxMultican_Can_MsgObj_init

Definition at line 564 of file IfxMultican_Can.c.

IFX_EXTERN boolean IfxMultican_Can_MsgObj_isRxPending ( IfxMultican_Can_MsgObj msgObj)

Returns the RX pending flag of a message object.

Parameters
msgObjpointer to the CAN message object handle
Returns
TRUE of the RX pending flag of a message object is set

Definition at line 603 of file IfxMultican_Can.c.

IFX_EXTERN boolean IfxMultican_Can_MsgObj_isTxPending ( IfxMultican_Can_MsgObj msgObj)

Returns the TX pending flag of a message object.

Parameters
msgObjpointer to the CAN message object handle
Returns
TRUE of the TX pending flag of a message object is set

Definition at line 618 of file IfxMultican_Can.c.

IFX_INLINE IfxMultican_Status IfxMultican_Can_MsgObj_readLongFrame ( IfxMultican_Can_MsgObj msgObj,
IfxMultican_Message msg,
uint32 data 
)

Read a received CAN message.

Parameters
msgObjpointer to the CAN message object handle
msgThis parameter is filled in by the function with the received message. Also when reading is not successful
dataPointer to data (in words)
Returns
IfxMultican_Status_noError: if the operation was successful
IfxMultican_Status_messageLost: if the message lost and new data is not yet ready
IfxMultican_Status_newDataButMessageLost: if the one message lost and last new data is retrieved successfully
// create message that is to be filled in by the function with the received message
IfxMultican_Message_longFrameInit(&msg, 0xdead, 0xf, FALSE); // start with invalid values
// wait until a new message is available
while( !IfxMultican_Can_MsgObj_isRxPending(&canDstMsgObj) );
// read the message
// rxData is assumed to be declared gloabally
IfxMultican_Status readStatus = IfxMultican_Can_MsgObj_readLongFrame(&canDstMsgObj, &msg, &rxData);

Definition at line 1328 of file IfxMultican_Can.h.

IFX_EXTERN IfxMultican_Status IfxMultican_Can_MsgObj_readMessage ( IfxMultican_Can_MsgObj msgObj,
IfxMultican_Message msg 
)

Read a received CAN message.

Parameters
msgObjpointer to the CAN message object handle
msgThis parameter is filled in by the function with the received message. Also when reading is not successful
Returns
IfxMultican_Status_noError: if the operation was successful
IfxMultican_Status_messageLost: if the message lost and new data is not yet ready
IfxMultican_Status_newDataButMessageLost: if the one message lost and last new data is retrieved successfully
// create message that is to be filled in by the function with the received message
IfxMultican_Message_init(&msg, 0xdead, 0xdeadbeef, 0xdeadbeef, 0xf); // start with invalid values
// wait until a new message is available
while( !IfxMultican_Can_MsgObj_isRxPending(&canDstMsgObj) );
// read the message
IfxMultican_Status readStatus = IfxMultican_Can_MsgObj_readMessage(&canDstMsgObj, &msg);

Definition at line 635 of file IfxMultican_Can.c.

IFX_INLINE IfxMultican_Status IfxMultican_Can_MsgObj_sendLongFrame ( IfxMultican_Can_MsgObj msgObj,
IfxMultican_Message msg,
uint32 data 
)

Read a received CAN message.

Parameters
msgObjpointer to the CAN message object handle
msgThis parameter is filled in by the function with the received message. Also when reading is not successful
dataPointer to data (in words)
Returns
IfxMultican_Status_noError: if the operation was successful
IfxMultican_Status_messageLost: if the message lost and new data is not yet ready
IfxMultican_Status_newDataButMessageLost: if the one message lost and last new data is retrieved successfully
// create message that is to be send
//send the message
// txData assumed to be declared globally
while( IfxMultican_Can_MsgObj_sendLongFrame(&canSrcMsgObj, &msg, &txData) == IfxMultican_Status_notSentBusy );

Definition at line 1334 of file IfxMultican_Can.h.

IFX_EXTERN IfxMultican_Status IfxMultican_Can_MsgObj_sendMessage ( IfxMultican_Can_MsgObj msgObj,
const IfxMultican_Message msg 
)

Send a CAN message.

Parameters
msgObjpointer to the CAN message object handle
msgSpecifies the msg to be send
Returns
IfxMultican_Status_noError: if the operation was successful
IfxMultican_Status_notSentBusy: if the operation was unsuccessful due to hardware is busy
// create message that is to be send
//send the message

Definition at line 675 of file IfxMultican_Can.c.