|
| CAN_tx_object| Summary | |
#include <rtx_can.h>
CAN_ERROR CAN_tx_object (
U32 ctrl, /* CAN Controller */
U32 channel, /* CAN Channel Number */
U32 id, /* Message ID */
CAN_FORMAT format); /* ID Format (11/29-bit) */
| | 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 message ID format may be one of the following: - STANDARD_FORMAT
Standard 11-bit identifier. - EXTENDED_FORMAT
Extended 29-bit identifier.
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 Philips LPC2000 and STMicroelectronics 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 STMicroelectronics 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 Philips LPC2000 devices, do not use the channel information. For these devices, you should specify a value of 0 for the channel.
| | Return Value | | The CAN_tx_object function returns one of the following manifest constants. - CAN_OK
Success. - CAN_OBJECTS_FULL_ERROR
Indicates that no more transmit or receive objects may be defined.
| | See Also | | CAN_rx_object | | Example | |
#include <rtx_can.h>
void main (void)
{
CAN_tx_object (1, 2, 33, STANDARD_FORMAT);
// Enable message transmission on controller 1,
// channel 2, with 11-bit ID 33
}
|
|
|