Hardware manual
RX600 Series CAN Application Programming Interface
R01AN0339EU0203 Rev. 2.03 Page 13 of 29
Mar 23, 2013
R_CAN_Tx
Starts actual message transmission onto the CAN bus
This API will wait until the mailbox finishes handling a prior frame, then set the mailbox to transmit mode.
Format
uint32_t R_CAN_Tx( const uint32_t ch_nr,
const uint32_t mbox_nr );
Arguments
ch_nr 0,1,2,3 Which CAN bus to use. 1-4 channels may be available.
mbox_nr 0-32 Which CAN mailbox to use.
Return Values
R_CAN_OK The mailbox was set to transmit a previously configured mailbox.
R_CAN_SW_BAD_MBX Bad mailbox number.
R_CAN_BAD_CH_NR The channel number does not exist.
R_CAN_SW_SET_TX_TMO Waiting for previous transmission to finish timed out.
R_CAN_SW_SET_RX_TMO Waiting for previous reception to complete timed out.
Properties
Prototyped in r_can_api.h
Implemented in r_can_api.c
Comments
R_CAN_TxSet must have been called at least once for this mailbox after system start to set up the mailbox content, as
this function only tells the mailbox to send its content.
Example
#define MY_TX_SLOT 7
/* Send mailbox content. This mailbox is presumed to have been set up to send some time
in the past. */
R_CAN_Tx(0, MY_TX_SLOT);