Functions
IO operation functions
Peripheral Driver » HAL Driver » SPI » Functions

Data transfer functions. More...

## Functions
hal_status_t | hal_spi_transmit (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode. More...
hal_status_t | hal_spi_receive (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Receive an amount of data in blocking mode. More...
hal_status_t | hal_spi_transmit_receive (spi_handle_t *p_spi, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t length, uint32_t timeout)
| Transmit and Receive an amount of data in blocking mode. More...
hal_status_t | hal_spi_read_eeprom (spi_handle_t *p_spi, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_number_data, uint32_t rx_number_data, uint32_t timeout)
| Read an amount of data from EEPROM in blocking mode. More...
hal_status_t | hal_spi_transmit_it (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode with Interrupt. More...
hal_status_t | hal_spi_receive_it (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length)
| Receive an amount of data in non-blocking mode with Interrupt. More...
hal_status_t | hal_spi_transmit_receive_it (spi_handle_t *p_spi, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t length)
| Transmit and Receive an amount of data in non-blocking mode with Interrupt. More...
hal_status_t | hal_spi_read_eeprom_it (spi_handle_t *p_spi, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_number_data, uint32_t rx_number_data)
| Read an amount of data from EEPROM in non-blocking mode with Interrupt. More...
hal_status_t | hal_spi_transmit_dma (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode with DMA. More...
hal_status_t | hal_spi_receive_dma (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length)
| Receive an amount of data in non-blocking mode with DMA. More...
hal_status_t | hal_spi_transmit_receive_dma (spi_handle_t *p_spi, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t length)
| Transmit and Receive an amount of data in non-blocking mode with DMA. More...
hal_status_t | hal_spi_read_eeprom_dma (spi_handle_t *p_spi, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_number_data, uint32_t rx_number_data)
| Read an amount of data from EEPROM in non-blocking mode with DMA. More...
hal_status_t | hal_spi_abort (spi_handle_t *p_spi)
| Abort ongoing transfer (blocking mode). More...
hal_status_t | hal_spi_abort_it (spi_handle_t *p_spi)
| Abort ongoing transfer (Interrupt mode). More...
hal_status_t | hal_spi_v2_transmit_8bit_toggle (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode with 8bit data width, and CS Signal will be assert/de-assert in every byte. More...
hal_status_t | hal_spi_v2_transmit_8bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_receive_8bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Receive an amount of data in blocking mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_transmit_receive_8bit (spi_handle_t *p_spi, uint8_t *tx_data, uint32_t tx_length, uint8_t *rx_data, uint32_t rx_length, uint32_t timeout)
| Transmit Then Receive an amount of data in blocking mode with 8bit data width. This Function works at EEPROM Read Mode, not Full duplex Mode. More...
hal_status_t | hal_spi_v2_transmit_32bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_receive_32bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Receive an amount of data in blocking mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_transmit_8bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in DMA mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_receive_8bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length)
| Receive an amount of data in DMA mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_transmit_32bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_tx_data, uint32_t length)
| Transmit an amount of data in DMA mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_receive_32bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length)
| Receive an amount of data in DMA mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More...
hal_status_t | hal_spi_v2_abort (spi_handle_t *p_spi)
| Abort ongoing transfer (blocking mode). More...
hal_status_t | hal_spi_v2_abort_it (spi_handle_t *p_spi)
| Abort ongoing transfer (Interrupt mode). More...

## Detailed Description

Data transfer functions.

      ==============================================================================
                          ##### IO operation functions #####
     ===============================================================================
     [..]
        This subsection provides a set of functions allowing to manage the SPI
        data transfer.

        [..] The SPI supports master and slave mode:

        (#) There are two modes of transfer:
           (++) Blocking mode: The communication is performed in polling mode.
                The HAL status of all data processing is returned by the same function
                after finishing transfer.
           (++) No-Blocking mode: The communication is performed using Interrupts
                or DMA, These APIs return the HAL status.
                The end of the data processing will be indicated through the
                dedicated SPI IRQ when using Interrupt mode or the DMA IRQ when
                using DMA mode.
                The hal_spi_tx_cplt_callback(), hal_spi_rx_cplt_callback() and hal_spi_txrx_cplt_callback() user callbacks
                will be executed respectively at the end of the transmit or Receive process
                The hal_spi_error_callback() user callback will be executed when a communication error is detected.

        (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA)
            exist for 1-Line (simplex) and 2-Line (full duplex) modes.

## Function Documentation

## ◆ hal_spi_abort()

hal_status_t hal_spi_abort | ( | spi_handle_t * | p_spi | ) |

Abort ongoing transfer (blocking mode).

Parameters

  [in] | p_spi | SPI handle.

Note
  This procedure could be used for aborting any ongoing transfer (Tx and Rx), started in Interrupt or DMA mode. This procedure performs following operations :
  - Disable SPI Interrupts (depending of transfer direction)
  - Disable the DMA transfer in the peripheral register (if enabled)
  - Abort DMA transfer by calling hal_dma_abort (in case of transfer in DMA mode)
  - Set handle State to READY
  This procedure is executed in blocking mode: when exiting function, Abort is considered as completed.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_abort_it()

hal_status_t hal_spi_abort_it | ( | spi_handle_t * | p_spi | ) |

Abort ongoing transfer (Interrupt mode).

Parameters

  [in] | p_spi | SPI handle.

Note
  This procedure could be used for aborting any ongoing transfer (Tx and Rx), started in Interrupt or DMA mode. This procedure performs following operations :
  - Disable SPI Interrupts (depending of transfer direction)
  - Disable the DMA transfer in the peripheral register (if enabled)
  - Abort DMA transfer by calling hal_dma_abort_it (in case of transfer in DMA mode)
  - Set handle State to READY
  - At abort completion, call user abort complete callback
  This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_read_eeprom()

hal_status_t hal_spi_read_eeprom | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_tx_data,
|  | uint8_t * | p_rx_data,
|  | uint32_t | tx_number_data,
|  | uint32_t | rx_number_data,
|  | uint32_t | timeout
| ) |  |

Read an amount of data from EEPROM in blocking mode.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_tx_data | Pointer to transmission data buffer
  [out] | p_rx_data | Pointer to reception data buffer
  [in] | tx_number_data | Amount of data to be sent in bytes
  [in] | rx_number_data | Amount of data to be received in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_read_eeprom_dma()

hal_status_t hal_spi_read_eeprom_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_tx_data,
|  | uint8_t * | p_rx_data,
|  | uint32_t | tx_number_data,
|  | uint32_t | rx_number_data
| ) |  |

Read an amount of data from EEPROM in non-blocking mode with DMA.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_tx_data | Pointer to transmission data buffer
  [out] | p_rx_data | Pointer to reception data buffer
  [in] | tx_number_data | Amount of data to be sent in bytes
  [in] | rx_number_data | Amount of data to be received in bytes, ranging between 0 and 4095.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_read_eeprom_it()

hal_status_t hal_spi_read_eeprom_it | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_tx_data,
|  | uint8_t * | p_rx_data,
|  | uint32_t | tx_number_data,
|  | uint32_t | rx_number_data
| ) |  |

Read an amount of data from EEPROM in non-blocking mode with Interrupt.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_tx_data | Pointer to transmission data buffer
  [out] | p_rx_data | Pointer to reception data buffer
  [in] | tx_number_data | Amount of data to be sent in bytes
  [in] | rx_number_data | Amount of data to be received in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_receive()

hal_status_t hal_spi_receive | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data in blocking mode.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [out] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_receive_dma()

hal_status_t hal_spi_receive_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Receive an amount of data in non-blocking mode with DMA.

Note
  In case of MASTER mode and SPI_DIRECTION_2LINES direction, p_dmatx shall be defined.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [out] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_receive_it()

hal_status_t hal_spi_receive_it | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Receive an amount of data in non-blocking mode with Interrupt.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [out] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_transmit()

hal_status_t hal_spi_transmit | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data in blocking mode.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_transmit_dma()

hal_status_t hal_spi_transmit_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in non-blocking mode with DMA.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_transmit_it()

hal_status_t hal_spi_transmit_it | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in non-blocking mode with Interrupt.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_transmit_receive()

hal_status_t hal_spi_transmit_receive | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_tx_data,
|  | uint8_t * | p_rx_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit and Receive an amount of data in blocking mode.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_tx_data | Pointer to transmission data buffer
  [out] | p_rx_data | Pointer to reception data buffer
  [in] | length | Amount of data to be sent and received in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_transmit_receive_dma()

hal_status_t hal_spi_transmit_receive_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_tx_data,
|  | uint8_t * | p_rx_data,
|  | uint32_t | length
| ) |  |

Transmit and Receive an amount of data in non-blocking mode with DMA.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_tx_data | Pointer to transmission data buffer
  [out] | p_rx_data | Pointer to reception data buffer
  [in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_transmit_receive_it()

hal_status_t hal_spi_transmit_receive_it | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_tx_data,
|  | uint8_t * | p_rx_data,
|  | uint32_t | length
| ) |  |

Transmit and Receive an amount of data in non-blocking mode with Interrupt.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_tx_data | Pointer to transmission data buffer
  [out] | p_rx_data | Pointer to reception data buffer
  [in] | length | Amount of data to be sent and received in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_abort()

hal_status_t hal_spi_v2_abort | ( | spi_handle_t * | p_spi | ) |

Abort ongoing transfer (blocking mode).

Parameters

  [in] | p_spi | SPI handle.

Note
  This procedure could be used for aborting any ongoing transfer (Tx and Rx), started in Interrupt or DMA mode. This procedure performs following operations :
  - Disable SPI Interrupts (depending of transfer direction)
  - Disable the DMA transfer in the peripheral register (if enabled)
  - Abort DMA transfer by calling hal_dma_abort (in case of transfer in DMA mode)
  - Set handle State to READY
  This procedure is executed in blocking mode: when exiting function, Abort is considered as completed.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_abort_it()

hal_status_t hal_spi_v2_abort_it | ( | spi_handle_t * | p_spi | ) |

Abort ongoing transfer (Interrupt mode).

Parameters

  [in] | p_spi | SPI handle.

Note
  This procedure could be used for aborting any ongoing transfer (Tx and Rx), started in Interrupt or DMA mode. This procedure performs following operations :
  - Disable SPI Interrupts (depending of transfer direction)
  - Disable the DMA transfer in the peripheral register (if enabled)
  - Abort DMA transfer by calling hal_dma_abort_it (in case of transfer in DMA mode)
  - Set handle State to READY
  - At abort completion, call user abort complete callback
  This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_receive_32bit()

hal_status_t hal_spi_v2_receive_32bit | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data in blocking mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_receive_32bit_dma()

hal_status_t hal_spi_v2_receive_32bit_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Receive an amount of data in DMA mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_receive_8bit()

hal_status_t hal_spi_v2_receive_8bit | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data in blocking mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_receive_8bit_dma()

hal_status_t hal_spi_v2_receive_8bit_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Receive an amount of data in DMA mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_transmit_32bit()

hal_status_t hal_spi_v2_transmit_32bit | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data in blocking mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_transmit_32bit_dma()

hal_status_t hal_spi_v2_transmit_32bit_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_tx_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in DMA mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_tx_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_transmit_8bit()

hal_status_t hal_spi_v2_transmit_8bit | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data in blocking mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_transmit_8bit_dma()

hal_status_t hal_spi_v2_transmit_8bit_dma | ( | spi_handle_t * | p_spi,
|  | uint8_t | inst,
|  | uint32_t | addr,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in DMA mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | inst | Instruction used in transfer
  [in] | addr | Address used in transfer
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_transmit_8bit_toggle()

hal_status_t hal_spi_v2_transmit_8bit_toggle | ( | spi_handle_t * | p_spi,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data in blocking mode with 8bit data width, and CS Signal will be assert/de-assert in every byte.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_spi_v2_transmit_receive_8bit()

hal_status_t hal_spi_v2_transmit_receive_8bit | ( | spi_handle_t * | p_spi,
|  | uint8_t * | tx_data,
|  | uint32_t | tx_length,
|  | uint8_t * | rx_data,
|  | uint32_t | rx_length,
|  | uint32_t | timeout
| ) |  |

Transmit Then Receive an amount of data in blocking mode with 8bit data width. This Function works at EEPROM Read Mode, not Full duplex Mode.

Parameters

  [in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module.
  [in] | tx_data | Pointer to transmit data buffer
  [in] | tx_length | Amount of data to be transmited in bytes
  [in] | rx_data | Pointer to received data buffer
  [in] | rx_length | Amount of data to be received in bytes
  [in] | timeout | Timeout duration

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.