![]() |
Synergy Software Package User's Manual
|
Driver for the Simple SPI on SCI. More...
Data Structures | |
| struct | sci_spi_instance_ctrl_t |
| struct | sci_spi_extended_cfg |
Functions | |
| ssp_err_t | R_SCI_SPI_Open (spi_ctrl_t *p_api_ctrl, spi_cfg_t const *const p_cfg) |
| Initialize a channel for SPI communication mode. Implements spi_api_t::open. This function performs the following tasks: Performs parameter checking and processes error conditions. Applies power to the SPI channel. Disables interrupts. Initializes the associated registers with default value and the user-configurable options. Provides the channel handle for use with other API functions. Updates user-configurable file if necessary. More... | |
| ssp_err_t | R_SCI_SPI_Read (spi_ctrl_t *const p_api_ctrl, void const *p_dest, uint32_t const length, spi_bit_width_t const bit_width) |
| Receive data from an SPI device. Implements spi_api_t::read. The function performs the following tasks: More... | |
| ssp_err_t | R_SCI_SPI_Write (spi_ctrl_t *const p_api_ctrl, void const *p_src, uint32_t const length, spi_bit_width_t const bit_width) |
| Transmit data to a SPI device. Implements spi_api_t::write. More... | |
| ssp_err_t | R_SCI_SPI_WriteRead (spi_ctrl_t *const p_api_ctrl, void const *p_src, void const *p_dest, uint32_t const length, spi_bit_width_t const bit_width) |
| Simultaneously transmit data to SPI device while receiving data from SPI device (full duplex). Implements spi_api_t::writeRead. The function performs the following tasks: More... | |
| ssp_err_t | R_SCI_SPI_Close (spi_ctrl_t *const p_api_ctrl) |
| Handle the closing of a channel by the following task. Implements spi_api_t::close Power off the channel. Disables all the associated interrupts. Update channel status. More... | |
| ssp_err_t | R_SCI_SPI_VersionGet (ssp_version_t *p_version) |
| Get the version information of the underlying driver. Implements spi_api_t::versionGet. More... | |
Variables | |
| const spi_api_t | g_spi_on_sci |
Driver for the Simple SPI on SCI.
This module supports simple SPI serial communication using the microcontroller's SCI peripheral. The Interface is defined in r_spi_api.h. This module implements SPI Interface.
| ssp_err_t R_SCI_SPI_Close | ( | spi_ctrl_t *const | p_api_ctrl | ) |
Handle the closing of a channel by the following task. Implements spi_api_t::close Power off the channel. Disables all the associated interrupts. Update channel status.
| SSP_SUCCESS | Channel successfully closed. |
| SSP_ERR_ASSERTION | The parameter p_api_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | The channel has not been opened. Open the channel first. |
Check to see if the channel is currently initialized.
Turn off power.
Close transfer block.
Release lock for this channel.
| ssp_err_t R_SCI_SPI_Open | ( | spi_ctrl_t * | p_api_ctrl, |
| spi_cfg_t const *const | p_cfg | ||
| ) |
Initialize a channel for SPI communication mode. Implements spi_api_t::open. This function performs the following tasks: Performs parameter checking and processes error conditions. Applies power to the SPI channel. Disables interrupts. Initializes the associated registers with default value and the user-configurable options. Provides the channel handle for use with other API functions. Updates user-configurable file if necessary.
| SSP_SUCCESS | Channel initialized successfully. |
| SSP_ERR_ASSERTION | One of the following invalid parameter passed.
|
| SSP_ERR_IN_USE | Channel currently in operation; Close channel first. |
| SSP_ERR_HW_LOCKED | The lock could not be acquired. The channel is busy. |
See Common Error Codes or functions called by this function for other possible return codes. This function calls:
Attempt to acquire lock for this SCI SPI channel. Prevents re-entrancy conflict.
set valid interrupts with user provided priority.
Turn on power.
Don't use FIFO mode – set FCRL_b.FM = 0.
Select SPI mode - set SCMR.SMIF=0, SIMR1.IICM=0, SMR.CM=1, SPMR.SSE=1.
Set baud rate in SCI channel for the SPI channel.
Open the SCI SPI transfer interface if available.
Peripheral Initialized.
Set control block for SCI channel to SPI mode operation.
| ssp_err_t R_SCI_SPI_Read | ( | spi_ctrl_t *const | p_api_ctrl, |
| void const * | p_dest, | ||
| uint32_t const | length, | ||
| spi_bit_width_t const | bit_width | ||
| ) |
Receive data from an SPI device. Implements spi_api_t::read. The function performs the following tasks:
| SSP_SUCCESS | Read operation successfully completed. |
| SSP_ERR_ASSERTION | One of the following invalid parameters passed
|
| SSP_ERR_HW_LOCKED | The lock could not be acquired. The channel is busy. |
| SSP_ERR_NOT_OPEN | The channel has not been opened. Open the channel first. |
See Common Error Codes or functions called by this function for other possible return codes. This function calls:
Configure module to receive data from a SPI device.
| ssp_err_t R_SCI_SPI_VersionGet | ( | ssp_version_t * | p_version | ) |
Get the version information of the underlying driver. Implements spi_api_t::versionGet.
| SSP_SUCCESS | Successful version get. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |
| ssp_err_t R_SCI_SPI_Write | ( | spi_ctrl_t *const | p_api_ctrl, |
| void const * | p_src, | ||
| uint32_t const | length, | ||
| spi_bit_width_t const | bit_width | ||
| ) |
Transmit data to a SPI device. Implements spi_api_t::write.
| SSP_SUCCESS | Write operation successfully completed. |
| SSP_ERR_ASSERTION | One of the following invalid parameters passed
|
| SSP_ERR_HW_LOCKED | The lock could not be acquired. The channel is busy. |
| SSP_ERR_NOT_OPEN | The channel has not been opened. Open the channel first. |
See Common Error Codes or functions called by this function for other possible return codes. This function calls:
Configure module to transmit data to a SPI device.
| ssp_err_t R_SCI_SPI_WriteRead | ( | spi_ctrl_t *const | p_api_ctrl, |
| void const * | p_src, | ||
| void const * | p_dest, | ||
| uint32_t const | length, | ||
| spi_bit_width_t const | bit_width | ||
| ) |
Simultaneously transmit data to SPI device while receiving data from SPI device (full duplex). Implements spi_api_t::writeRead. The function performs the following tasks:
| SSP_SUCCESS | Write operation successfully completed. |
| SSP_ERR_ASSERTION | One of the following invalid parameters passed
|
| SSP_ERR_HW_LOCKED | The lock could not be acquired. The channel is busy. |
| SSP_ERR_NOT_OPEN | The channel has not been opened. Open the channel first. |
See Common Error Codes or functions called by this function for other possible return codes. This function calls:
Configure module for full duplex operation.
| const spi_api_t g_spi_on_sci |
Filled in Interface API structure for this Instance.