The transfer functions in this group are for SPI controllers configured as masters.
|
ALT_STATUS_CODE | alt_spi_master_tx_rx_transfer (ALT_SPI_DEV_t *spi_dev, const uint32_t slave_select, const size_t num_frames, const uint16_t *tx_buf, uint16_t *rx_buf) |
|
ALT_STATUS_CODE | alt_spi_master_tx_transfer (ALT_SPI_DEV_t *spi_dev, const uint32_t slave_select, const size_t num_frames, const uint16_t *tx_buf) |
|
ALT_STATUS_CODE | alt_spi_master_rx_transfer (ALT_SPI_DEV_t *spi_dev, const uint32_t slave_select, const size_t num_frames, uint16_t *rx_buf) |
|
ALT_STATUS_CODE | alt_spi_master_eeprom_transfer (ALT_SPI_DEV_t *spi_dev, const uint32_t slave_select, const uint8_t opcode, const uint16_t eeprom_addr, const size_t num_frames, uint16_t *rx_buf) |
|
ALT_STATUS_CODE alt_spi_master_tx_rx_transfer |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint32_t |
slave_select, |
|
|
const size_t |
num_frames, |
|
|
const uint16_t * |
tx_buf, |
|
|
uint16_t * |
rx_buf |
|
) |
| |
This function performs a master SPI/SSP serial transmit and receive transfer.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
slave_select | A mask of the slave select output signal line(s) to enable. slave_selects is a mask of logically OR'ed ALT_SPI_SS_t values that designate the slave select outputs to enable during the transfer operation. |
num_frames | The number of data frames involved in the transfer operation. Valid range: 1 to 65536. |
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. The buffer is expected to contain num_frames data frames for transmittal. |
rx_buf | [out] An buffer to receive data frames sent from the slave. The buffer is expected to be at least num_frames data frames in length. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_master_tx_transfer |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint32_t |
slave_select, |
|
|
const size_t |
num_frames, |
|
|
const uint16_t * |
tx_buf |
|
) |
| |
This function performs a master SPI/SSP serial transmit only transfer.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
slave_select | A mask of the slave select output signal line(s) to enable. slave_selects is a mask of logically OR'ed ALT_SPI_SS_t values that designate the slave select outputs to enable during the transfer operation. |
num_frames | The number of data frames involved in the transfer operation. Valid range: 1 to 65536. |
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. The buffer is expected to contain num_frames data frames for transmittal. |
ALT_STATUS_CODE alt_spi_master_rx_transfer |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint32_t |
slave_select, |
|
|
const size_t |
num_frames, |
|
|
uint16_t * |
rx_buf |
|
) |
| |
This function performs a master SPI/SSP serial receive only transfer.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
slave_select | A mask of the slave select output signal line(s) to enable. slave_selects is a mask of logically OR'ed ALT_SPI_SS_t values that designate the slave select outputs to enable during the transfer operation. |
num_frames | The number of data frames involved in the transfer operation. Valid range: 1 to 65536. |
rx_buf | [out] An buffer to receive data frames sent from the slave. The buffer is expected to be at least num_frames data frames in length. |
ALT_STATUS_CODE alt_spi_master_eeprom_transfer |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint32_t |
slave_select, |
|
|
const uint8_t |
opcode, |
|
|
const uint16_t |
eeprom_addr, |
|
|
const size_t |
num_frames, |
|
|
uint16_t * |
rx_buf |
|
) |
| |
This function performs a master SPI EEPROM read transfer.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
slave_select | A mask of the slave select output signal line(s) to enable. slave_selects is a mask of logically OR'ed ALT_SPI_SS_t values that designate the slave select outputs to enable during the transfer operation. |
opcode | The opcode to transmit to the EEPROM device. |
eeprom_addr | The address transmitted to access the EEPROM device. |
num_frames | The number of data frames involved in the transfer operation. Valid range: 1 to 65536. |
rx_buf | [out] An buffer to receive data frames sent from the slave. The buffer is expected to be at least num_frames data frames in length. |