| Summary |
#include <rtx_can.h>
CAN_ERROR CAN_tx_object (
U32 ctrl, /* CAN Controller */
U32 channel, /* CAN Channel Number */
U32 id, /* Message ID */
U32 object_para); /* Object Parameters */
|
| Description | The CAN_tx_object function enables message transmission for the CAN controller specified by ctrl on the specified channel. Once enabled, the CAN controller can transmit messages matching the specified id. The object_para may be one of the following: - DATA_TYPE
DATA FRAME message type. - REMOTE_TYPE
REMOTE FRAME message type. - STANDARD_TYPE
Message with standard 11-bit identifier type. - EXTENDED_TYPE
Message with extended 29-bit identifier type.
Note Types DATA_TYPE or REMOTE_TYPE can be used together with STANDARD_TYPE or EXTENDED_TYPE (type specifiers can be bit-ored together). The CAN_tx_object function is part of RL-CAN. The prototype is defined in RTX_CAN.h. Note - Enabling a transmission object is not necessary for many microcontrollers (like the NXP LPC2000 and ST Microelectronics STR7 devices) because they can send CAN messages without configuring a transmission object. As such, this function is not implemented for some devices.
- For devices like the ST Microelectronics STR7, you must leave at least one message object available for message transmission. You cannot initialize the object as a receive object and use it for transmission.
- Some CAN controllers, like that used in the NXP LPC2000 devices, do not use the channel information. For these devices, you should specify a value of 0 for the channel.
|
| Example |
#include <rtx_can.h>
void main (void) {
CAN_tx_object (1, 2, 33, DATA_TYPE | STANDARD_TYPE);
// Enable DATA message transmission on controller 1,
// channel 2, with STANDARD 11-bit ID 33
}
|