#include <stdint.h>
#include "xilinx_spi.h"
#include "spi_engine_private.h"
#include "axi_dmac.h"
Go to the source code of this file.
|
int32_t | spi_engine_write (struct spi_engine_desc *desc, uint32_t reg_addr, uint32_t reg_data) |
| Write SPI Engine's axi registers. More...
|
|
int32_t | spi_engine_read (struct spi_engine_desc *desc, uint32_t reg_addr, uint32_t *reg_data) |
| Read SPI Engine's axi registers. More...
|
|
int32_t | spi_engine_init (struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param) |
| Initialize the spi engine. More...
|
|
int32_t | spi_engine_write_and_read (struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number) |
| Write/read on the spi interface. More...
|
|
int32_t | spi_engine_remove (struct no_os_spi_desc *desc) |
| Free the resources allocated by no_os_spi_init(). More...
|
|
int32_t | spi_engine_offload_init (struct no_os_spi_desc *desc, const struct spi_engine_offload_init_param *param) |
| Initialize the SPI engine's offload module. More...
|
|
int32_t | spi_engine_offload_transfer (struct no_os_spi_desc *desc, struct spi_engine_offload_message msg, uint32_t no_samples) |
| Initiate a SPI transfer in offload mode. More...
|
|
int32_t | spi_engine_set_transfer_width (struct no_os_spi_desc *desc, uint8_t data_wdith) |
| Set width of the transfered word over SPI. More...
|
|
void | spi_engine_set_speed (struct no_os_spi_desc *desc, uint32_t speed_hz) |
| Set SPI engine clock frequency. More...
|
|
◆ CS_HIGH
◆ CS_LOW
◆ OFFLOAD_DISABLED
#define OFFLOAD_DISABLED 0x00 |
◆ OFFLOAD_RX_EN
◆ OFFLOAD_TX_EN
◆ OFFLOAD_TX_RX_EN
◆ READ
◆ SLEEP
◆ SPI_ENGINE_MSG_QUEUE_END
#define SPI_ENGINE_MSG_QUEUE_END 0xFFFFFFFF |
◆ WRITE
#define WRITE |
( |
|
no_bytes | ) |
|
◆ WRITE_READ
#define WRITE_READ |
( |
|
no_bytes | ) |
|
◆ spi_engine_init()
Initialize the spi engine.
- Parameters
-
desc | Decriptor containing SPI interface parameters |
param | Structure containing the spi init parameters |
- Returns
- int32_t - 0 if the transfer finished
- -1 if the memory allocation failed
◆ spi_engine_offload_init()
Initialize the SPI engine's offload module.
- Parameters
-
desc | Decriptor containing SPI interface parameters |
param | Structure containing the offload init parameters |
- Returns
- int32_t This function allways returns 0
◆ spi_engine_offload_transfer()
Initiate a SPI transfer in offload mode.
- Parameters
-
desc | Decriptor containing SPI interface parameters |
msg | Offload message that get's to be transferred |
no_samples | Number of time the messages will be transferred |
- Returns
- int32_t This function allways returns 0
◆ spi_engine_read()
int32_t spi_engine_read |
( |
struct spi_engine_desc * |
desc, |
|
|
uint32_t |
reg_addr, |
|
|
uint32_t * |
reg_data |
|
) |
| |
Read SPI Engine's axi registers.
- Parameters
-
desc | Decriptor containing SPI Engine's parameters |
reg_addr | The address of the SPI Engine's axi register from where the data where the data will be read |
reg_data | Pointer where the read that will be stored |
- Returns
- int32_t This function allways returns 0
◆ spi_engine_remove()
Free the resources allocated by no_os_spi_init().
- Parameters
-
desc | Decriptor containing SPI interface parameters |
- Returns
- int32_t This function allways returns 0
◆ spi_engine_set_speed()
void spi_engine_set_speed |
( |
struct no_os_spi_desc * |
desc, |
|
|
uint32_t |
speed_hz |
|
) |
| |
Set SPI engine clock frequency.
- Parameters
-
desc | Decriptor containing SPI Engine's parameters |
speed_hz | SPI engine transfer speed |
◆ spi_engine_set_transfer_width()
int32_t spi_engine_set_transfer_width |
( |
struct no_os_spi_desc * |
desc, |
|
|
uint8_t |
data_wdith |
|
) |
| |
Set width of the transfered word over SPI.
- Parameters
-
desc | Decriptor containing SPI interface parameters |
data_wdith | The desired data width The supported values are:
|
◆ spi_engine_write()
int32_t spi_engine_write |
( |
struct spi_engine_desc * |
desc, |
|
|
uint32_t |
reg_addr, |
|
|
uint32_t |
reg_data |
|
) |
| |
Write SPI Engine's axi registers.
- Parameters
-
desc | Decriptor containing SPI Engine's parameters |
reg_addr | The address of the SPI Engine's axi register where the data will be written |
reg_data | Data that will be written |
- Returns
- int32_t This function allways returns 0
◆ spi_engine_write_and_read()
int32_t spi_engine_write_and_read |
( |
struct no_os_spi_desc * |
desc, |
|
|
uint8_t * |
data, |
|
|
uint16_t |
bytes_number |
|
) |
| |
Write/read on the spi interface.
- Parameters
-
desc | Decriptor containing SPI interface parameters |
data | Pointer to data buffer |
bytes_number | Number of bytes to transfer |
- Returns
- int32_t - 0 if the transfer finished
- -1 if the memory allocation or transfer failed
◆ xil_spi_ops
Spi engine platform specific SPI platform ops structure.
Spi engine platform specific SPI platform ops structure.