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...
 
bool app_qspi_config_memory_mappped (app_qspi_id_t id, app_qspi_mmap_device_t dev)
 Config the memory mapped mode (also called XIP mode) and Active the mode. More...
 
bool app_qspi_active_memory_mappped (app_qspi_id_t id, bool is_active)
 Active or Deactive memory mapped mode (also called XIP mode) 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_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_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_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...
 
bool app_qspi_mmap_set_endian_mode (app_qspi_id_t id, app_qspi_mmap_endian_mode_e mode)
 Set Data Endian Mode to Read in Memory mapped Mode(XIP Mode) More...
 
uint8_t app_qspi_mmap_read_u8 (app_qspi_id_t id, uint32_t address)
 Read U8 Data in Memory mapped Mode(XIP Mode), can be used in flash/psram device. More...
 
uint16_t app_qspi_mmap_read_u16 (app_qspi_id_t id, uint32_t address)
 Read U16 Data in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device. More...
 
uint32_t app_qspi_mmap_read_u32 (app_qspi_id_t id, uint32_t address)
 Read U32 Data in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device. More...
 
bool app_qspi_mmap_read_block (app_qspi_id_t id, uint32_t address, uint8_t *buffer, uint32_t length)
 Read data block in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device. More...
 
uint32_t app_qspi_get_xip_base_address (app_qspi_id_t id)
 Return the XIP Base Address of QSPI Instance. More...
 
qspi_handle_tapp_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_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...
 

Detailed Description

Function Documentation

◆ app_qspi_abort()

uint16_t app_qspi_abort ( app_qspi_id_t  id)

Abort qspi communication with Interrupt.

Parameters
[in]idQSPI module ID.
Returns
Result of operation.

◆ app_qspi_active_memory_mappped()

bool app_qspi_active_memory_mappped ( app_qspi_id_t  id,
bool  is_active 
)

Active or Deactive memory mapped mode (also called XIP mode)

Parameters
[in]id: QSPI module ID.
[in]is_activetrue - Active the mode; false - Deactive the mode
Returns
true/false

◆ 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]idwhich QSPI module want to transmit command.
[in]p_cmdPointer 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]idwhich QSPI module want to receive.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[out]p_dataPointer 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]idwhich QSPI module want to receive.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[out]p_dataPointer to data buffer
[in]timeoutTimeout 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]idwhich QSPI module want to transmit command.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[in]timeoutTimeout 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]idwhich QSPI module want to transmit.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[out]p_dataPointer 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]idwhich QSPI module want to transmit.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[out]p_dataPointer to data buffer
[in]timeoutTimeout duration
Returns
Result of operation.

◆ app_qspi_config_memory_mappped()

bool app_qspi_config_memory_mappped ( app_qspi_id_t  id,
app_qspi_mmap_device_t  dev 
)

Config the memory mapped mode (also called XIP mode) and Active the mode.

Parameters
[in]id: QSPI module ID.
[in]devdevice config for mmaped mode
Returns
true/false

◆ app_qspi_deinit()

uint16_t app_qspi_deinit ( app_qspi_id_t  id)

De-initialize the APP QSPI DRIVER peripheral.

Parameters
[in]idDe-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]idwhich QSPI module want to transmit command.
[in]p_cmdPointer 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]idwhich QSPI module want to receive.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[out]p_dataPointer 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]idwhich QSPI module want to transmit.
[in]p_cmdPointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
[out]p_dataPointer 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]idDe-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_paramsPointer 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_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_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_get_handle()

qspi_handle_t* app_qspi_get_handle ( app_qspi_id_t  id)

Return the QSPI handle.

Parameters
[in]idQSPI module ID.
Returns
Pointer to the specified ID's QSPI handle.

◆ app_qspi_get_xip_base_address()

uint32_t app_qspi_get_xip_base_address ( app_qspi_id_t  id)

Return the XIP Base Address of QSPI Instance.

Parameters
[in]idQSPI module ID.
Returns
The XIP base address.

◆ 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_paramsPointer to app_qspi_params_t parameter which contains the configuration information for the specified QSPI module.
[in]evt_handlerQSPI user callback function.
Returns
Result of initialization.

◆ app_qspi_mmap_read_block()

bool app_qspi_mmap_read_block ( app_qspi_id_t  id,
uint32_t  address,
uint8_t *  buffer,
uint32_t  length 
)

Read data block in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device.

Parameters
[in]id: QSPI module ID.
[in]address: the address of device connected to QSPI, start from 0x000000
[in]buffer: memory pointer to save the read data
[in]length: the read length in byte
Returns
true/false

◆ app_qspi_mmap_read_u16()

uint16_t app_qspi_mmap_read_u16 ( app_qspi_id_t  id,
uint32_t  address 
)

Read U16 Data in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device.

Parameters
[in]id: QSPI module ID.
[in]address: the address of device connected to QSPI, start from 0x000000
Returns
the read data

◆ app_qspi_mmap_read_u32()

uint32_t app_qspi_mmap_read_u32 ( app_qspi_id_t  id,
uint32_t  address 
)

Read U32 Data in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device.

Parameters
[in]id: QSPI module ID.
[in]address: the address of device connected to QSPI, start from 0x000000
Returns
the read data

◆ app_qspi_mmap_read_u8()

uint8_t app_qspi_mmap_read_u8 ( app_qspi_id_t  id,
uint32_t  address 
)

Read U8 Data in Memory mapped Mode(XIP Mode), can be used in flash/psram device.

Parameters
[in]id: QSPI module ID.
[in]address: the address of device connected to QSPI, start from 0x000000
Returns
the read data

◆ app_qspi_mmap_set_endian_mode()

bool app_qspi_mmap_set_endian_mode ( app_qspi_id_t  id,
app_qspi_mmap_endian_mode_e  mode 
)

Set Data Endian Mode to Read in Memory mapped Mode(XIP Mode)

Parameters
[in]id: QSPI module ID.
[in]mode: endian mode
Returns
true/false

◆ 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_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]timeoutTimeout duration
Returns
true/false

◆ 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_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]timeoutTimeout duration
Returns
true/false