R_SCIn_SPI_Slave_Send_Receive

Starts SCI slave transmission/reception (simple SPI mode).

Remark 1. This API function repeats SCI slave transmission in byte units the number of times specified by the argument tx_num from the buffer at the location specified by the argument tx_buf.

Remark 2. This API function repeats SCI slave reception in byte units the number of times specified by the argument rx_num and the received data are stored in the buffer at the location specified by the argument rx_buf.

Remark 3. When performing a SCI slave transmission/reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

#include "r_cg_macrodriver.h"

MD_STATUS R_SCIn_SPI_Slave_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num,

uint8_t * const rx_buf, uint16_t rx_num );

Remark n is the channel number.

[Argument(s)]

I/O

Argument

Description

I

uint8_t * const tx_buf;

Pointer to a buffer storing the transmission data

I

uint16_t tx_num;

Total amount of data to send

O

uint8_t * const rx_buf;

Pointer to a buffer to store the reception data

I

uint16_t rx_num;

Total amount of data to receive

[Return value]

Macro

Description

MD_OK

Normal completion

MD_ARGERROR

Invalid argument tx_num specification