Usage example (Slave, Transmit)

Transmit 4Bytes data by Slave.

[GUI setting example]

Serial

Used

IICA0

Used

Transfer mode

Slave

Slave0

Clock mode setting

fCLK/2

Local address setting

0xA0

Operation mode setting

Normal

Wakeup function setting

Off

Communication endinterrupt priority (INTIICA0)

Low

Slave transmission end (Callback function setting)

Used

Slave reception end (Callback function setting)

Unused

[API setting example]

r_main.c

/* Start user code for global. Do not edit comment generated here */

volatile uint8_t g_iica0_tx_buf[4] = { 'A', 'B', 'C', 'D' };

/* End user code. Do not edit comment generated here */

void main(void)

{

R_MAIN_UserInit();

/* Start user code. Do not edit comment generated here */

/* Send data as slave mode */

R_IICA0_Slave_Send((uint8_t *)g_iica0_tx_buf, 4U);

while (1U)

{

;

}

/* End user code. Do not edit comment generated here */

}

r_cg_serial_user.c

static void r_iica0_callback_slave_sendend(void)

{

/* Start user code. Do not edit comment generated here */

/* Stop IICA0 module operation */

R_IICA0_Stop();

/* End user code. Do not edit comment generated here */

}