User`s manual
RX62N Group, RX621 Group 5. Usage Examples
void iic_tx_dmac_end_handler(void)
{
uint32_t status_flags = 0;
/* Wait for the transmission to complete */
do
{
R_IIC_GetStatus(
0,
&status_flags,
PDL_NO_PTR,
PDL_NO_PTR
);
} while((status_flags & 0x00000080ul) == 0x0u);
/* Issue a Stop condition on channel 1 */
R_IIC_Control(
0,
PDL_IIC_STOP
);
bus_busy = false;
}
void iic_rx_dmac_end_handler(void)
{
uint32_t DestAddr = 0;
/* Read the next destination address for the current transfer */
R_DMAC_GetStatus(
2,
PDL_NO_PTR,
PDL_NO_PTR,
&DestAddr,
PDL_NO_PTR,
PDL_NO_PTR
);
/* Read one more byte with NACK condition on channel 1 and stop */
R_IIC_MasterReceiveLast(
0,
(uint8_t *)DestAddr
);
bus_busy = false;
}
Figure 5-32: An example of write data to and reading data from an EEPROM, using two DMAC channels
R20UT0084EE0112 Rev.1.12 Page 5-54
July. 16, 2014