Functions
Functions
Peripheral Driver » APP DRIVER » QSPI
Collaboration diagram for Functions:

## Functions
uint16_t | app_qspi_init (app_qspi_params_t *p_params, app_qspi_evt_handler_t evt_handler)
| Initialize the APP QSPI DRIVER according to the specified parameters in the app_qspi_params_t and app_qspi_evt_handler_t. More...
uint16_t | app_qspi_deinit (app_qspi_id_t id)
| De-initialize the APP QSPI DRIVER peripheral. More...
uint16_t | app_qspi_abort (app_qspi_id_t id)
| Abort qspi communication with Interrupt. More...
uint16_t | app_qspi_command_receive_sync (app_qspi_id_t id, app_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...
uint16_t | app_qspi_command_receive_async (app_qspi_id_t id, app_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...
uint16_t | app_qspi_command_transmit_sync (app_qspi_id_t id, app_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...
uint16_t | app_qspi_command_transmit_async (app_qspi_id_t id, app_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...
uint16_t | app_qspi_command_sync (app_qspi_id_t id, app_qspi_command_t *p_cmd, uint32_t timeout)
| Transmit only instruction in blocking mode. More...
uint16_t | app_qspi_command_async (app_qspi_id_t id, app_qspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with Interrupt. More...
uint16_t | app_qspi_transmit_sync_ex (app_qspi_id_t id, uint32_t qspi_mode, uint32_t data_width, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit data without command, support std/dual/quad mode. More...
uint16_t | app_qspi_transmit_sync (app_qspi_id_t id, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode with standard SPI. More...
uint16_t | app_qspi_transmit_async_ex (app_qspi_id_t id, uint32_t qspi_mode, uint32_t data_width, uint8_t *p_data, uint32_t length)
| Transmit data without command, support std/dual/quad mode. More...
uint16_t | app_qspi_transmit_async (app_qspi_id_t id, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode at standard SPI with Interrupt. More...
uint16_t | app_qspi_receive_sync_ex (app_qspi_id_t id, uint32_t qspi_mode, uint32_t data_width, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Receive data without command, support std/dual/quad mode. More...
uint16_t | app_qspi_receive_sync (app_qspi_id_t id, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Receive an amount of data in blocking mode with standard SPI. More...
uint16_t | app_qspi_receive_async_ex (app_qspi_id_t id, uint32_t qspi_mode, uint32_t data_width, uint8_t *p_data, uint32_t length)
| Receive data without command, support std/dual/quad mode. More...
uint16_t | app_qspi_receive_async (app_qspi_id_t id, uint8_t *p_data, uint32_t length)
| Receive an amount of data in non-blocking mode at standard SPI with Interrupt. More...
uint16_t | app_qspi_transmit_in_qpi_async (app_qspi_id_t id, uint32_t data_width, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in QPI mode (Async Mode). More...
qspi_handle_t * | app_qspi_get_handle (app_qspi_id_t id)
| Return the QSPI handle. More...
uint16_t | app_qspi_dma_init (app_qspi_params_t *p_params)
| Initialize the APP QSPI DRIVER according to the specified parameters in the app_qspi_params_t and app_qspi_evt_handler_t. More...
uint16_t | app_qspi_dma_deinit (app_qspi_id_t id)
| De-initialize the APP QSPI DRIVER peripheral. More...
uint16_t | app_qspi_dma_command_receive_async (app_qspi_id_t id, app_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...
uint16_t | app_qspi_dma_command_transmit_async (app_qspi_id_t id, app_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...
uint16_t | app_qspi_dma_command_async (app_qspi_id_t id, app_qspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with Interrupt. More...
uint16_t | app_qspi_dma_transmit_async_ex (app_qspi_id_t id, uint32_t qspi_mode, uint32_t data_width, uint8_t *p_data, uint32_t length)
| Transmit data without command, support std/dual/quad mode. More...
uint16_t | app_qspi_dma_transmit_async (app_qspi_id_t id, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode at standard SPI with Interrupt. More...
uint16_t | app_qspi_dma_receive_async_ex (app_qspi_id_t id, uint32_t qspi_mode, uint32_t data_width, uint8_t *p_data, uint32_t length)
| Receive data without command, support std/dual/quad mode. More...
uint16_t | app_qspi_dma_receive_async (app_qspi_id_t id, uint8_t *p_data, uint32_t length)
| Receive an amount of data in non-blocking mode at standard SPI with Interrupt. More...
uint16_t | app_qspi_dma_transmit_in_qpi_async (app_qspi_id_t id, uint32_t data_width, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in QPI mode (Async Mode). More...

## Detailed Description

## Function Documentation

## ◆ app_qspi_abort()

uint16_t app_qspi_abort | ( | app_qspi_id_t | id | ) |

Abort qspi communication with Interrupt.

Parameters

  [in] | id | QSPI module ID.

Returns
  Result of operation.

## ◆ app_qspi_command_async()

uint16_t app_qspi_command_async | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to transmit command.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.

Returns
  Result of operation.

## ◆ app_qspi_command_receive_async()

uint16_t app_qspi_command_receive_async | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to receive.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer

Returns
  Result of operation.

## ◆ app_qspi_command_receive_sync()

uint16_t app_qspi_command_receive_sync | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to receive.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_qspi_command_sync()

uint16_t app_qspi_command_sync | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to transmit command.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_qspi_command_transmit_async()

uint16_t app_qspi_command_transmit_async | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to transmit.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer

Returns
  Result of operation.

## ◆ app_qspi_command_transmit_sync()

uint16_t app_qspi_command_transmit_sync | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to transmit.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_qspi_deinit()

uint16_t app_qspi_deinit | ( | app_qspi_id_t | id | ) |

De-initialize the APP QSPI DRIVER peripheral.

Parameters

  [in] | id | De-initialize for a specific ID.

Returns
  Result of De-initialization.

## ◆ app_qspi_dma_command_async()

uint16_t app_qspi_dma_command_async | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to transmit command.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.

Returns
  Result of operation.

## ◆ app_qspi_dma_command_receive_async()

uint16_t app_qspi_dma_command_receive_async | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to receive.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer

Returns
  Result of operation.

## ◆ app_qspi_dma_command_transmit_async()

uint16_t app_qspi_dma_command_transmit_async | ( | app_qspi_id_t | id,
|  | app_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] | id | which QSPI module want to transmit.
  [in] | p_cmd | Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
  [out] | p_data | Pointer to data buffer

Returns
  Result of operation.

## ◆ app_qspi_dma_deinit()

uint16_t app_qspi_dma_deinit | ( | app_qspi_id_t | id | ) |

De-initialize the APP QSPI DRIVER peripheral.

Parameters

  [in] | id | De-initialize for a specific ID.

Returns
  Result of De-initialization.

## ◆ app_qspi_dma_init()

uint16_t app_qspi_dma_init | ( | app_qspi_params_t * | p_params | ) |

Initialize the APP QSPI DRIVER according to the specified parameters in the app_qspi_params_t and app_qspi_evt_handler_t.

Note
  If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use interrupt mode.

Parameters

  [in] | p_params | Pointer to app_qspi_params_t parameter which contains the configuration information for the specified QSPI module.

Returns
  Result of initialization.

## ◆ app_qspi_dma_receive_async()

uint16_t app_qspi_dma_receive_async | ( | app_qspi_id_t | id,
|  | 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] | id | which QSPI module want to receive.
  [out] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes

Returns
  Result of operation.

## ◆ app_qspi_dma_receive_async_ex()

uint16_t app_qspi_dma_receive_async_ex | ( | app_qspi_id_t | id,
|  | uint32_t | qspi_mode,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Receive data without command, support std/dual/quad mode.

Parameters

  [in] | id | : QSPI module ID.
  [in] | qspi_mode | : QSPI_DATA_MODE_SPI QSPI_DATA_MODE_DUALSPI QSPI_DATA_MODE_QUADSPI
  [in] | data_width | :QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | : data Pointer to transmit
  [in] | length | : byte length of data

Returns
  true/false

## ◆ app_qspi_dma_transmit_async()

uint16_t app_qspi_dma_transmit_async | ( | app_qspi_id_t | id,
|  | 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] | id | which QSPI module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Returns
  Result of operation.

## ◆ app_qspi_dma_transmit_async_ex()

uint16_t app_qspi_dma_transmit_async_ex | ( | app_qspi_id_t | id,
|  | uint32_t | qspi_mode,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit data without command, support std/dual/quad mode.

Parameters

  [in] | id | : QSPI module ID.
  [in] | qspi_mode | : QSPI_DATA_MODE_SPI QSPI_DATA_MODE_DUALSPI QSPI_DATA_MODE_QUADSPI
  [in] | data_width | :QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | : data Pointer to transmit
  [in] | length | : byte length of data

Returns
  true/false

## ◆ app_qspi_dma_transmit_in_qpi_async()

uint16_t app_qspi_dma_transmit_in_qpi_async | ( | app_qspi_id_t | id,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in QPI mode (Async Mode).

Parameters

  [in] | id | Which QSPI module want to Transmit.
  [in] | data_width | Just support QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be transmitted in bytes

Returns
  Result of operation.

## ◆ app_qspi_get_handle()

qspi_handle_t* app_qspi_get_handle | ( | app_qspi_id_t | id | ) |

Return the QSPI handle.

Parameters

  [in] | id | QSPI module ID.

Returns
  Pointer to the specified ID's QSPI handle.

## ◆ app_qspi_init()

uint16_t app_qspi_init | ( | app_qspi_params_t * | p_params,
|  | app_qspi_evt_handler_t | evt_handler
| ) |  |

Initialize the APP QSPI DRIVER according to the specified parameters in the app_qspi_params_t and app_qspi_evt_handler_t.

Note
  If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use interrupt mode.

Parameters

  [in] | p_params | Pointer to app_qspi_params_t parameter which contains the configuration information for the specified QSPI module.
  [in] | evt_handler | QSPI user callback function.

Returns
  Result of initialization.

## ◆ app_qspi_receive_async()

uint16_t app_qspi_receive_async | ( | app_qspi_id_t | id,
|  | 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] | id | which QSPI module want to receive.
  [out] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes

Returns
  Result of operation.

## ◆ app_qspi_receive_async_ex()

uint16_t app_qspi_receive_async_ex | ( | app_qspi_id_t | id,
|  | uint32_t | qspi_mode,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Receive data without command, support std/dual/quad mode.

Parameters

  [in] | id | : QSPI module ID.
  [in] | qspi_mode | : QSPI_DATA_MODE_SPI QSPI_DATA_MODE_DUALSPI QSPI_DATA_MODE_QUADSPI
  [in] | data_width | :QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | : data Pointer to transmit
  [in] | length | : byte length of data

Returns
  true/false

## ◆ app_qspi_receive_sync()

uint16_t app_qspi_receive_sync | ( | app_qspi_id_t | id,
|  | 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] | id | which QSPI module want to receive.
  [out] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be received in bytes
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_qspi_receive_sync_ex()

uint16_t app_qspi_receive_sync_ex | ( | app_qspi_id_t | id,
|  | uint32_t | qspi_mode,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Receive data without command, support std/dual/quad mode.

Parameters

  [in] | id | : QSPI module ID.
  [in] | qspi_mode | : QSPI_DATA_MODE_SPI QSPI_DATA_MODE_DUALSPI QSPI_DATA_MODE_QUADSPI
  [in] | data_width | :QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | : data Pointer to transmit
  [in] | length | : byte length of data
  [in] | timeout | Timeout duration

Returns
  true/false

## ◆ app_qspi_transmit_async()

uint16_t app_qspi_transmit_async | ( | app_qspi_id_t | id,
|  | 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] | id | which QSPI module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Returns
  Result of operation.

## ◆ app_qspi_transmit_async_ex()

uint16_t app_qspi_transmit_async_ex | ( | app_qspi_id_t | id,
|  | uint32_t | qspi_mode,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit data without command, support std/dual/quad mode.

Parameters

  [in] | id | : QSPI module ID.
  [in] | qspi_mode | : QSPI_DATA_MODE_SPI QSPI_DATA_MODE_DUALSPI QSPI_DATA_MODE_QUADSPI
  [in] | data_width | :QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | : data Pointer to transmit
  [in] | length | : byte length of data

Returns
  true/false

## ◆ app_qspi_transmit_in_qpi_async()

uint16_t app_qspi_transmit_in_qpi_async | ( | app_qspi_id_t | id,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in QPI mode (Async Mode).

Parameters

  [in] | id | Which QSPI module want to Transmit.
  [in] | data_width | Just support QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be transmitted in bytes

Returns
  Result of operation.

## ◆ app_qspi_transmit_sync()

uint16_t app_qspi_transmit_sync | ( | app_qspi_id_t | id,
|  | 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] | id | which QSPI module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_qspi_transmit_sync_ex()

uint16_t app_qspi_transmit_sync_ex | ( | app_qspi_id_t | id,
|  | uint32_t | qspi_mode,
|  | uint32_t | data_width,
|  | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit data without command, support std/dual/quad mode.

Parameters

  [in] | id | : QSPI module ID.
  [in] | qspi_mode | : QSPI_DATA_MODE_SPI QSPI_DATA_MODE_DUALSPI QSPI_DATA_MODE_QUADSPI
  [in] | data_width | :QSPI_DATASIZE_08_BITS QSPI_DATASIZE_16_BITS QSPI_DATASIZE_32_BITS
  [in] | p_data | : data Pointer to transmit
  [in] | length | : byte length of data
  [in] | timeout | Timeout duration

Returns
  true/false