Data Structures | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_xqspi.h File Reference

Header file containing functions prototypes of XQSPI HAL library. More...

`#include "gr55xx_ll_xqspi.h"`
`#include "gr55xx_hal_def.h"`

Go to the source code of this file.

## Data Structures
struct | _xqspi_init_t
| XQSPI init Structure definition. More...
struct | _xqspi_handle_t
| XQSPI handle Structure definition. More...
struct | _xqspi_command_t
| XQSPI command Structure definition. More...
struct | _hal_xqspi_callback
| HAL_XQSPI Callback function definition. More...

## Macros
#define | HAL_XQSPI_ERROR_NONE ((uint32_t)0x00000000)
#define | HAL_XQSPI_ERROR_TIMEOUT ((uint32_t)0x00000001)
#define | HAL_XQSPI_ERROR_TRANSFER ((uint32_t)0x00000002)
#define | HAL_XQSPI_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
#define | XQSPI_WORK_MODE_QSPI LL_XQSPI_MODE_QSPI
#define | XQSPI_WORK_MODE_XIP LL_XQSPI_MODE_XIP
#define | XQSPI_CACHE_MODE_DIS LL_XQSPI_CACHE_DIS
#define | XQSPI_CACHE_MODE_EN LL_XQSPI_CACHE_EN
#define | XQSPI_READ_CMD_READ LL_XQSPI_XIP_CMD_READ
#define | XQSPI_READ_CMD_FAST_READ LL_XQSPI_XIP_CMD_FAST_READ
#define | XQSPI_READ_CMD_DUAL_OUT_READ LL_XQSPI_XIP_CMD_DUAL_OUT_READ
#define | XQSPI_READ_CMD_DUAL_IO_READ LL_XQSPI_XIP_CMD_DUAL_IO_READ
#define | XQSPI_READ_CMD_QUAD_OUT_READ LL_XQSPI_XIP_CMD_QUAD_OUT_READ
#define | XQSPI_READ_CMD_QUAD_IO_READ LL_XQSPI_XIP_CMD_QUAD_IO_READ
#define | XQSPI_CLOCK_MODE_0 ((LL_XQSPI_SCPOL_LOW << 1) | LL_XQSPI_SCPHA_1EDGE)
#define | XQSPI_CLOCK_MODE_1 ((LL_XQSPI_SCPOL_LOW << 1) | LL_XQSPI_SCPHA_2EDGE)
#define | XQSPI_CLOCK_MODE_2 ((LL_XQSPI_SCPOL_HIGH << 1) | LL_XQSPI_SCPHA_1EDGE)
#define | XQSPI_CLOCK_MODE_3 ((LL_XQSPI_SCPOL_HIGH << 1) | LL_XQSPI_SCPHA_2EDGE)
#define | XQSPI_BAUD_RATE_64M LL_XQSPI_BAUD_RATE_64M
#define | XQSPI_BAUD_RATE_48M LL_XQSPI_BAUD_RATE_48M
#define | XQSPI_BAUD_RATE_32M LL_XQSPI_BAUD_RATE_32M
#define | XQSPI_BAUD_RATE_24M LL_XQSPI_BAUD_RATE_24M
#define | XQSPI_BAUD_RATE_16M LL_XQSPI_BAUD_RATE_16M
#define | XQSPI_DATA_MODE_SPI LL_XQSPI_QSPI_FRF_SPI
#define | XQSPI_DATA_MODE_DUALSPI LL_XQSPI_QSPI_FRF_DUALSPI
#define | XQSPI_DATA_MODE_QUADSPI LL_XQSPI_QSPI_FRF_QUADSPI
#define | XQSPI_FIFO_THRESHOLD_1_8 LL_XQSPI_QSPI_FIFO_WATERMARK_1_8
#define | XQSPI_FIFO_THRESHOLD_1_4 LL_XQSPI_QSPI_FIFO_WATERMARK_1_4
#define | XQSPI_FIFO_THRESHOLD_1_2 LL_XQSPI_QSPI_FIFO_WATERMARK_1_2
#define | XQSPI_FIFO_THRESHOLD_3_4 LL_XQSPI_QSPI_FIFO_WATERMARK_3_4
#define | XQSPI_FIFO_DEPTH LL_XQSPI_QSPI_FIFO_DEPTH
#define | XQSPI_INSTSIZE_00_BITS (0)
#define | XQSPI_INSTSIZE_08_BITS (1)
#define | XQSPI_INSTSIZE_16_BITS (2)
#define | XQSPI_ADDRSIZE_00_BITS (0)
#define | XQSPI_ADDRSIZE_08_BITS (1)
#define | XQSPI_ADDRSIZE_16_BITS (2)
#define | XQSPI_ADDRSIZE_24_BITS (3)
#define | XQSPI_ADDRSIZE_32_BITS (4)
#define | XQSPI_INST_ADDR_ALL_IN_SPI (0)
#define | XQSPI_INST_IN_SPI_ADDR_IN_SPIFRF (1)
#define | XQSPI_INST_ADDR_ALL_IN_SPIFRF (2)
#define | XQSPI_FLAG_RFF LL_XQSPI_QSPI_STAT_RFF
#define | XQSPI_FLAG_RFTF LL_XQSPI_QSPI_STAT_RFTF
#define | XQSPI_FLAG_RFE LL_XQSPI_QSPI_STAT_RFE
#define | XQSPI_FLAG_TFF LL_XQSPI_QSPI_STAT_TFF
#define | XQSPI_FLAG_TFTF LL_XQSPI_QSPI_STAT_TFTF
#define | XQSPI_FLAG_TFE LL_XQSPI_QSPI_STAT_TFE
#define | XQSPI_FLAG_BUSY LL_XQSPI_QSPI_STAT_BUSY
#define | XQSPI_DISABLE_PRESENT LL_XQSPI_DISABLE_PRESENT
#define | XQSPI_ENABLE_PRESENT LL_XQSPI_ENABLE_PRESENT
#define | HAL_XQSPI_RETRY_DEFAULT_VALUE ((uint32_t)1000)
| XQSPI_Retry_definition XQSPI Retry definition. More...
#define | __HAL_XQSPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_XQSPI_STATE_RESET)
| Reset XQSPI handle states. More...
#define | __HAL_XQSPI_ENABLE_QSPI(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->QSPI.SPIEN, SSI_SSIEN_EN)
| Enable the specified QSPI peripheral in XQSPI. More...
#define | __HAL_XQSPI_DISABLE_QSPI(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->QSPI.SPIEN, SSI_SSIEN_EN)
| Disable the specified QSPI peripheral in XQSPI. More...
#define | __HAL_XQSPI_ENABLE_XIP(__HANDLE__)
| Enable the specified XIP peripheral in XQSPI. More...
#define | __HAL_XQSPI_DISABLE_XIP(__HANDLE__)
| Disable the specified XIP peripheral in XQSPI. More...
#define | __HAL_XQSPI_ENABLE_CACHE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CACHE.CTRL0, XQSPI_CACHE_CTRL0_DIS)
| Enable the specified CACHE peripheral in XQSPI. More...
#define | __HAL_XQSPI_DISABLE_CACHE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CACHE.CTRL0, XQSPI_CACHE_CTRL0_DIS)
| Disable the specified CACHE peripheral in XQSPI. More...
#define | __HAL_XQSPI_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->QSPI.STAT, (__FLAG__)) != 0) ? SET : RESET)
| Check whether the specified XQSPI flag is set or not. More...
#define | IS_XQSPI_WORK_MODE(__MODE__)
| Check if XQSPI Work Mode is valid. More...
#define | IS_XQSPI_CACHE_MODE(__MODE__)
| Check if XQSPI Cache Mode is valid. More...
#define | IS_XQSPI_READ_CMD(__CMD__)
| Check if XQSPI Read CMD is valid. More...
#define | IS_XQSPI_BAUD_RATE(__BAUD__)
| Check if XQSPI Clock Baud Rate is valid. More...
#define | IS_XQSPI_CLOCK_MODE(__CLKMODE__)
| Check if XQSPI Clock Mode is valid. More...
#define | IS_XQSPI_FIFO_THRESHOLD(__THR__)
| Check if XQSPI FIFO Threshold is valid. More...
#define | IS_XQSPI_INSTRUCTION_SIZE(__INST_SIZE__)
| Check if XQSPI Instruction Size is valid. More...
#define | IS_XQSPI_ADDRESS_SIZE(__ADDR_SIZE__)
| Check if XQSPI Address Size is valid. More...
#define | IS_XQSPI_INSTADDR_MODE(__MODE__)
| Check if XQSPI Instruction and Address Mode is valid. More...
#define | IS_XQSPI_DATA_MODE(__MODE__)
| Check if XQSPI Data Mode is valid. More...

## Typedefs
typedef struct _xqspi_init_t | xqspi_init_t
| XQSPI init Structure definition.
typedef struct _xqspi_handle_t | xqspi_handle_t
| XQSPI handle Structure definition.
typedef struct _xqspi_command_t | xqspi_command_t
| XQSPI command Structure definition.
typedef struct _hal_xqspi_callback | hal_xqspi_callback_t
| HAL_XQSPI Callback function definition.

## Enumerations
enum | hal_xqspi_state_t { HAL_XQSPI_STATE_RESET = 0x00, HAL_XQSPI_STATE_READY = 0x01, HAL_XQSPI_STATE_BUSY = 0x02, HAL_XQSPI_STATE_BUSY_INDIRECT_TX = 0x12, HAL_XQSPI_STATE_BUSY_INDIRECT_RX = 0x22, HAL_XQSPI_STATE_ABORT = 0x08, HAL_XQSPI_STATE_ERROR = 0x04 }
| HAL XQSPI State Enumerations definition. More...

## Functions
hal_status_t | hal_xqspi_init (xqspi_handle_t *p_xqspi)
| Initialize the XQSPI according to the specified parameters in the xqspi_init_t and initialize the associated handle. More...
hal_status_t | hal_xqspi_deinit (xqspi_handle_t *p_xqspi)
| De-initialize the XQSPI peripheral. More...
void | hal_xqspi_msp_init (xqspi_handle_t *p_xqspi)
| Initialize the XQSPI MSP. More...
void | hal_xqspi_msp_deinit (xqspi_handle_t *p_xqspi)
| De-initialize the XQSPI MSP. More...
hal_status_t | hal_xqspi_command_transmit (xqspi_handle_t *p_xqspi, xqspi_command_t *p_cmd, uint8_t *p_data, uint32_t retry)
| Transmit an amount of data with specified instruction and address in blocking mode. More...
hal_status_t | hal_xqspi_command_receive (xqspi_handle_t *p_xqspi, xqspi_command_t *p_cmd, uint8_t *p_data, uint32_t retry)
| Receive an amount of data with specified instruction and address in blocking mode. More...
hal_status_t | hal_xqspi_transmit (xqspi_handle_t *p_xqspi, uint8_t *p_data, uint32_t length, uint32_t retry)
| Transmit an amount of data in blocking mode. More...
hal_status_t | hal_xqspi_receive (xqspi_handle_t *p_xqspi, uint8_t *p_data, uint32_t length, uint32_t retry)
| Receive an amount of data in blocking mode. More...
hal_xqspi_state_t | hal_xqspi_get_state (xqspi_handle_t *p_xqspi)
| Return the XQSPI handle state. More...
uint32_t | hal_xqspi_get_error (xqspi_handle_t *p_xqspi)
| Return the XQSPI error code. More...
void | hal_xqspi_set_retry (xqspi_handle_t *p_xqspi, uint32_t retry)
| Set the XQSPI internal process repeat times value. More...
hal_status_t | hal_xqspi_set_tx_fifo_threshold (xqspi_handle_t *p_xqspi, uint32_t threshold)
| Set the TXFIFO threshold. More...
hal_status_t | hal_xqspi_set_rx_fifo_threshold (xqspi_handle_t *p_xqspi, uint32_t threshold)
| Set the RXFIFO threshold. More...
uint32_t | hal_xqspi_get_tx_fifo_threshold (xqspi_handle_t *p_xqspi)
| Get the TXFIFO threshold. More...
uint32_t | hal_xqspi_get_rx_fifo_threshold (xqspi_handle_t *p_xqspi)
| Get the RXFIFO threshold. More...
void | hal_xqspi_set_xip_present_status (xqspi_handle_t *p_xqspi, uint32_t status)
| Turn on/off present module, only in XIP mode. More...

## Detailed Description

Header file containing functions prototypes of XQSPI HAL library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.