Specifications
RX62N Group, RX621 Group RIIC Multi-Master Communication
R01AN0630EJ0100 Rev.1.00 Page 9 of 23
Sep 27, 2011
RiicSlvStart
Overview Starts slave mode operation
Header riic.h
Declaration void RiicSlvStart(uint8_t * , uint8_t * , uint32_t , CallBackFunc, CallBackFunc)
Description
Starts slave mode operation. If the slave address matches during slave mode operation,
slave transmission or slave reception is started according to the R/W# bit.
• Slave Transmission
⎯ After the start of slave mode transmission, this function transmits data from the start
of the transmit buffer specified with the second argument until a NACK is received.
⎯ Transmits 0xFF if the transmit count exceeds the transmit data count specified in the
third argument.
⎯ After transmission completes, it calls the callback function specified in the fourth
argument. However, if a NACK is received while transmitting data that is less than
the transmit data count specified in the third argument, it does not call the call back
function but rather transmits from the start of the transmit buffer specified in the
second argument when slave mode transmission is started again.
• Slave Reception
⎯ After the start of slave mode reception, this function receives data from the start of
the receive buffer specified with the second argument until a stop condition is
detected.
⎯ Receive data in excess of the receive data count specified in the third argument is
not stored in the receive buffer specified in the first argument.
⎯ After reception completes, it calls the callback function specified in the fifth
argument. However, if a stop condition is detected while receiving data that is less
than the receive data count specified in the third argument it does not call the call
back function but rather receives data from the start of the transmit buffer specified
in the second argument when slave mode reception is started again (that is, it
overwrites the buffer).
Arguments
First argument: uint8_t* in_RcvAddr
Slave mode reception data storage pointer
Data is stored in the buffer pointed to by this argument.
Second argument: uint8_t* in_TrmAddr
Slave mode transmission data storage pointer
Data is transmitted from 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.
Fourth argument: CallBackFunc cbTrm
Slave mode transmission complete callback function
This function is called when slave mode transmission completes.
Fifth argument: CallBackFunc cbRcv
Slave mode reception complete callback function
This function is called when slave mode reception completes.
Return values None
Notes When slave mode transmission or reception completes, slave mode operation stops.
Applications should call this function again to continue slave mode operation.