Specifications

RX62N Group, RX621 Group RIIC Multi-Master Communication
R01AN0630EJ0100 Rev.1.00 Page 10 of 23
Sep 27, 2011
RiicStart
Overview Starts master mode transmission
Header riic.h
Declaration uint8_t RiicMstStart(uint8_t, uint8_t *, uint32_t, CallBackFunc)
Description
Starts master mode transmission.
After master mode transmission is started, this function calls the callback function under
the following conditions.
NACK received
Arbitration lost detected
Timeout detected
Master mode transmission or reception completes
The results of communication listed above can be acquired with the RiicGetMstState()
function.
Arguments
First argument: uint8_t* in_addr
Slave address (the low-order bit is the R/W bit).
When the low-order bit is 0, master mode transmission is performed, and when 1,
master mode reception is performed.
Second argument: uint8_t* in_buff
Pointer to the data storage area used for communication.
For master mode transmission, data is transmitted from the buffer pointed to by this
argument.
For master mode reception, data is stored in the buffer pointed to by this argument.
Third argument: uint32_t in_num
Transmit/receive data count
Specifies the number of data items for reception or transmission. The transmission
address is also included.
Fourth argument: CallBackFunc cb
The callback function.
Return values
RIIC_OK Normal completion
RIIC_NG Argument error (when the transmit/receive data count is less than 2)
RIIC_BUS_BUSY Bus busy
Notes
RiicGetMstState
Overview Acquire master mode communication result
Header riic.h
Declaration uint8_t RiicGetMstState(void)
Description Returns the result of master mode communication.
Arguments None
Return values
RIIC_ST_MST_IDLE Before the start of communication
RIIC_ST_MST_BUSY Communication in progress
RIIC_ST_MST_NACK NACK received
RIIC_ST_MST_AL Arbitration lost detected
RIIC_ST_MST_TMO Timeout detected
RIIC_ST_MST_COMPLETE Master mode transmission or reception completed
Notes