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

Data transfers functions. More...

Collaboration diagram for IO operation functions:

## Functions
hal_status_t | hal_qspi_command_transmit (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout)
| Transmit an amount of data with the specified instruction and address in blocking mode. More...
hal_status_t | hal_qspi_command_receive (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout)
| Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode. More...
hal_status_t | hal_qspi_command (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint32_t timeout)
| Transmit only instruction in blocking mode. More...
hal_status_t | hal_qspi_transmit (qspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode with standard SPI. More...
hal_status_t | hal_qspi_receive (qspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Receive an amount of data in blocking mode with standard SPI. More...
hal_status_t | hal_qspi_command_transmit_it (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint8_t *p_data)
| Transmit an amount of data with the specified instruction and address in non-blocking mode with Interrupt. More...
hal_status_t | hal_qspi_command_receive_it (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint8_t *p_data)
| Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mode with Interrupt. More...
hal_status_t | hal_qspi_command_it (qspi_handle_t *p_qspi, qspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with Interrupt. More...
hal_status_t | hal_qspi_transmit_it (qspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode at standard SPI with Interrupt. More...
hal_status_t | hal_qspi_receive_it (qspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length)
| Receive an amount of data in non-blocking mode at standard SPI with Interrupt. More...
hal_status_t | hal_qspi_command_transmit_dma (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint8_t *p_data)
| Transmit an amount of data with the specified instruction and address in non-blocking mode with DMA . More...
hal_status_t | hal_qspi_command_receive_dma (qspi_handle_t *p_qspi, qspi_command_t *p_cmd, uint8_t *p_data)
| Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mode with DMA . More...
hal_status_t | hal_qspi_command_dma (qspi_handle_t *p_qspi, qspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with DMA. More...
hal_status_t | hal_qspi_transmit_dma (qspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode at standard SPI with DMA. More...
hal_status_t | hal_qspi_receive_dma (qspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length)
| Receive an amount of data in non-blocking mode at standard SPI with DMA. More...
hal_status_t | hal_qspi_abort (qspi_handle_t *p_qspi)
| Abort the current transmission. More...
hal_status_t | hal_qspi_abort_it (qspi_handle_t *p_qspi)
| Abort the current transmission (non-blocking function) More...

## Detailed Description

Data transfers functions.

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

        [..] The QSPI 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 QSPI IRQ when using Interrupt mode or the DMA IRQ when
                using DMA mode.
                The hal_qspi_tx_cplt_callback(), hal_qspi_rx_cplt_callback() and hal_qspi_txrx_cplt_callback() user callbacks
                will be executed respectively at the end of the transmit or Receive process.
                The hal_qspi_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 Lines (full duplex) modes.

## Function Documentation

## ◆ hal_qspi_abort()

hal_status_t hal_qspi_abort | ( | qspi_handle_t * | p_qspi | ) |

Abort the current transmission.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

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_qspi_abort_it()

hal_status_t hal_qspi_abort_it | ( | qspi_handle_t * | p_qspi | ) |

Abort the current transmission (non-blocking function)

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

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_qspi_command()

hal_status_t hal_qspi_command | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint32_t | timeout
| ) |  |

Transmit only instruction in blocking mode.

Note
  This function is used only in Indirect Write Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [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_qspi_command_dma()

hal_status_t hal_qspi_command_dma | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd
| ) |  |

Transmit instruction in non-blocking mode with DMA.

Note
  This function is used only in Indirect Write Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.

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_qspi_command_it()

hal_status_t hal_qspi_command_it | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd
| ) |  |

Transmit instruction in non-blocking mode with Interrupt.

Note
  This function is used only in Indirect Write Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.

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_qspi_command_receive()

hal_status_t hal_qspi_command_receive | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint8_t * | p_data,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.

Note
  This function is used only in Indirect Read Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer
  [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_qspi_command_receive_dma()

hal_status_t hal_qspi_command_receive_dma | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint8_t * | p_data
| ) |  |

Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mode with DMA .

Note
  This function is used only in Indirect Read Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer

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_qspi_command_receive_it()

hal_status_t hal_qspi_command_receive_it | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint8_t * | p_data
| ) |  |

Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mode with Interrupt.

Note
  This function is used only in Indirect Read Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer

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_qspi_command_transmit()

hal_status_t hal_qspi_command_transmit | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint8_t * | p_data,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data with the specified instruction and address in blocking mode.

Note
  This function is used only in Indirect Write Mode. Dummy cycles in command will be ignored.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [in] | p_data | Pointer to data buffer
  [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_qspi_command_transmit_dma()

hal_status_t hal_qspi_command_transmit_dma | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint8_t * | p_data
| ) |  |

Transmit an amount of data with the specified instruction and address in non-blocking mode with DMA .

Note
  This function is used only in Indirect Write Mode. Dummy cycles in command will be ignored.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [in] | p_data | Pointer to data buffer

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_qspi_command_transmit_it()

hal_status_t hal_qspi_command_transmit_it | ( | qspi_handle_t * | p_qspi,
|  | qspi_command_t * | p_cmd,
|  | uint8_t * | p_data
| ) |  |

Transmit an amount of data with the specified instruction and address in non-blocking mode with Interrupt.

Note
  This function is used only in Indirect Write Mode. Dummy cycles in command will be ignored.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | p_cmd | Pointer to a qspi_command_t structure that contains the instruction and address for data transfer.
  [in] | p_data | Pointer to data buffer

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_qspi_receive()

hal_status_t hal_qspi_receive | ( | qspi_handle_t * | p_qspi,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data in blocking mode with standard SPI.

Note
  This function is used only in Indirect Read Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI 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_qspi_receive_dma()

hal_status_t hal_qspi_receive_dma | ( | qspi_handle_t * | p_qspi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

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

Note
  This function is used only in Indirect Read Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [out] | 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_qspi_receive_it()

hal_status_t hal_qspi_receive_it | ( | qspi_handle_t * | p_qspi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

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

Note
  This function is used only in Indirect Read Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [out] | 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_qspi_transmit()

hal_status_t hal_qspi_transmit | ( | qspi_handle_t * | p_qspi,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data in blocking mode with standard SPI.

Note
  This function is used only in Indirect Write Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI 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_qspi_transmit_dma()

hal_status_t hal_qspi_transmit_dma | ( | qspi_handle_t * | p_qspi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

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

Note
  This function is used only in Indirect Write Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI 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_qspi_transmit_it()

hal_status_t hal_qspi_transmit_it | ( | qspi_handle_t * | p_qspi,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

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

Note
  This function is used only in Indirect Write Mode.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI 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.