![]() |
Altera HWLIB
16.0
The Altera HW Manager API Reference Manual
|
The transfer functions in this group are for SPI controllers configured as slaves.
Functions | |
ALT_STATUS_CODE | alt_spi_slave_tx_rx_transfer (ALT_SPI_DEV_t *spi_dev, const uint16_t *tx_buf, uint16_t *rx_buf, const size_t buf_len) |
ALT_STATUS_CODE | alt_spi_slave_tx_transfer (ALT_SPI_DEV_t *spi_dev, const uint16_t *tx_buf, const size_t buf_len) |
ALT_STATUS_CODE | alt_spi_slave_rx_transfer (ALT_SPI_DEV_t *spi_dev, uint16_t *rx_buf, const size_t buf_len) |
ALT_STATUS_CODE alt_spi_slave_tx_rx_transfer | ( | ALT_SPI_DEV_t * | spi_dev, |
const uint16_t * | tx_buf, | ||
uint16_t * | rx_buf, | ||
const size_t | buf_len | ||
) |
This function performs a slave SPI/SSP serial transmit and receive transfer.
This API is suitable for being called during an interrupt context. It is the programmer's responsibility to ensure that there is enough space in the TX FIFO and space in the RX FIFO to accomodate the request made.
spi_dev | A pointer to the SPI controller device block instance. |
tx_buf | A buffer of data frames to transmit. The tx_buf element type is sized large enough to contain the widest possible data frame size. The data in each frame should be right justified within its tx_buf element. |
rx_buf | [out] An buffer to receive data frames sent from the master. The buffer is expected to be at least buf_len data frames in length. |
buf_len | The length in data frames of the tx_buf and rx_buf buffers. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_slave_tx_transfer | ( | ALT_SPI_DEV_t * | spi_dev, |
const uint16_t * | tx_buf, | ||
const size_t | buf_len | ||
) |
This function performs a slave SPI/SSP serial transmit only transfer.
This API is suitable for being called during an interrupt context. It is the programmer's responsibility to ensure that there is enough space in the TX FIFO to accomodate the request made.
spi_dev | A pointer to the SPI controller device block instance. |
tx_buf | A buffer of data frames to transmit. The tx_buf element type is sized large enough to contain the widest possible data frame size. The data in each frame should be right justified within its tx_buf element. |
buf_len | The length in data frames of the tx_buf buffer. |
ALT_STATUS_CODE alt_spi_slave_rx_transfer | ( | ALT_SPI_DEV_t * | spi_dev, |
uint16_t * | rx_buf, | ||
const size_t | buf_len | ||
) |
This function performs a slave SPI/SSP serial receive only transfer.
This API is suitable for being called during an interrupt context. It is the programmer's responsibility to ensure that there is enough data in the RX FIFO to accomodate the request made.
spi_dev | A pointer to the SPI controller device block instance. |
rx_buf | [out] An buffer to receive data frames sent from the master. The buffer is expected to be at least buf_len data frames in length. |
buf_len | The length in data frames of the rx_buf buffer. |