Hardware manual
RX600 Series CAN Application Programming Interface
R01AN0339EU0203 Rev. 2.03 Page 14 of 29
Mar 23, 2013
R_CAN_TxCheck
Check for successful data frame transmission.
Use to check a mailbox for a successful data frame transmission.
Format
uint32_t R_CAN_TxCheck( 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 Transmission was completed successfully.
R_CAN_SW_BAD_MBX Bad mailbox number.
R_CAN_BAD_CH_NR The channel number does not exist.
R_CAN_MSGLOST Message was overwritten or lost.
R_CAN_NO_SENTDATA No message was sent.
Properties
Prototyped in r_can_api.h
Implemented in r_can_api.c
Comments
This function is only needed if an application needs to verify that a message has been transmitted for example so that it
can progress a state machine, or if messages are sent back-to-back. With CAN’s level of transport control built into the
silicon, it can reasonably be assumed that once a mailbox has been asked to send with the API that the message will
indeed be sent. Safest if of course to use this function after a transmission.
Example
/*** TRANSMITTED a particular frame? */
api_status = R_CAN_TxCheck(0, CANBOX_TX);
if (api_status == R_CAN_OK)
{
/* Notify main application. */
message_x_sent_flag = TRUE;
}