Jump to main content

##

# 2.93.2 QSPIx_CommandWrite Function

## C

    // x - Instance of the QSPI peripheral

    bool QSPIx_CommandWrite( qspi_command_xfer_t *qspi_command_xfer, uint32_t address );

## Summary

Writes command to QSPI slave device.

## Description

This function can be used to send commands to QSPI slave device which does not include any exchange of data.

## Precondition

QSPIx_Initialize must have been called for the associated QSPI instance.

## Parameters

Param | Description
--- | ---
*qspi_command_xfer | pointer to QSPI command transfer structure holding the instructioncode register and instruction frame register information.
address | Instruction address to be sent with the instruction frame. Can bepassed as 0 if no address associated with instruction.

## Returns

- True on transfer request success.

- False on transfer request failure.

## Example

    #define WRITE_ENABLE_CODE 0x06

    static qspi_command_xfer_t qspi_command_xfer;

    // Use QAUD SPI Lane
    qspi_command_xfer.width = QUAD_CMD;

    // Send Write enable command
    qspi_command_xfer->qspi_code.instruction = WRITE_ENABLE_CODE;

    if (QSPI0_CommandWrite(&qspi_command_xfer, 0) == false)
    {
        // Handle Error
    }