Classes | 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"`
Include dependency graph for gr55xx_hal_xqspi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
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)
| No error More...
#define | HAL_XQSPI_ERROR_TIMEOUT ((uint32_t)0x00000001)
| Timeout error More...
#define | HAL_XQSPI_ERROR_TRANSFER ((uint32_t)0x00000002)
| Transfer error More...
#define | HAL_XQSPI_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
| Invalid parameter error. More...
#define | XQSPI_HP_MODE_DIS LL_XQSPI_HP_MODE_DIS
| Disable XQSPI High Performance mode More...
#define | XQSPI_HP_MODE_EN LL_XQSPI_HP_MODE_EN
| Enable XQSPI High Performance mode More...
#define | XQSPI_WORK_MODE_QSPI LL_XQSPI_MODE_QSPI
| Work in QSPI mode More...
#define | XQSPI_WORK_MODE_XIP LL_XQSPI_MODE_XIP
| Work in XIP mode More...
#define | XQSPI_CACHE_MODE_DIS LL_XQSPI_CACHE_DIS
| Cache off in XIP mode. More...
#define | XQSPI_CACHE_MODE_EN LL_XQSPI_CACHE_EN
| Cache on in XIP mode. More...
#define | XQSPI_CACHE_DIRECT_MAP_DIS LL_XQSPI_CACHE_DIRECT_MAP_DIS
| Cache work on 4-Way Set Associative. More...
#define | XQSPI_CACHE_DIRECT_MAP_EN LL_XQSPI_CACHE_DIRECT_MAP_EN
| Cache work on Direct Map. More...
#define | XQSPI_CACHE_FLUSH_DIS LL_XQSPI_CACHE_FLUSH_DIS
| Cache Flush Disable. More...
#define | XQSPI_CACHE_FLUSH_EN LL_XQSPI_CACHE_FLUSH_EN
| Cache Flush Enable More...
#define | XQSPI_READ_CMD_READ LL_XQSPI_XIP_CMD_READ
| Read mode More...
#define | XQSPI_READ_CMD_FAST_READ LL_XQSPI_XIP_CMD_FAST_READ
| Fast Read mode More...
#define | XQSPI_READ_CMD_DUAL_OUT_READ LL_XQSPI_XIP_CMD_DUAL_OUT_READ
| Dual-Out Fast Read mode More...
#define | XQSPI_READ_CMD_DUAL_IO_READ LL_XQSPI_XIP_CMD_DUAL_IO_READ
| Dual-IO Fast Read mode More...
#define | XQSPI_READ_CMD_QUAD_OUT_READ LL_XQSPI_XIP_CMD_QUAD_OUT_READ
| Quad-Out Fast Read mode More...
#define | XQSPI_READ_CMD_QUAD_IO_READ LL_XQSPI_XIP_CMD_QUAD_IO_READ
| Quad-IO Fast Read mode More...
#define | XQSPI_CLOCK_MODE_0 ((LL_XQSPI_SCPOL_LOW << 1) | LL_XQSPI_SCPHA_1EDGE)
| Inactive state of CLK is low, CLK toggles at the start of first data bit More...
#define | XQSPI_CLOCK_MODE_1 ((LL_XQSPI_SCPOL_LOW << 1) | LL_XQSPI_SCPHA_2EDGE)
| Inactive state of CLK is low, CLK toggles in the middle of first data bit More...
#define | XQSPI_CLOCK_MODE_2 ((LL_XQSPI_SCPOL_HIGH << 1) | LL_XQSPI_SCPHA_1EDGE)
| Inactive state of CLK is high, CLK toggles at the start of first data bit More...
#define | XQSPI_CLOCK_MODE_3 ((LL_XQSPI_SCPOL_HIGH << 1) | LL_XQSPI_SCPHA_2EDGE)
| Inactive state of CLK is high, CLK toggles in the middle of first data bit More...
#define | XQSPI_BAUD_RATE_64M LL_XQSPI_BAUD_RATE_64M
| Serial clock speed is 64 MHz More...
#define | XQSPI_BAUD_RATE_48M LL_XQSPI_BAUD_RATE_48M
| Serial clock speed is 48 MHz More...
#define | XQSPI_BAUD_RATE_32M LL_XQSPI_BAUD_RATE_32M
| Serial clock speed is 32 MHz More...
#define | XQSPI_BAUD_RATE_24M LL_XQSPI_BAUD_RATE_24M
| Serial clock speed is 24 MHz More...
#define | XQSPI_BAUD_RATE_16M LL_XQSPI_BAUD_RATE_16M
| Serial clock speed is 16 MHz More...
#define | XQSPI_DATA_MODE_SPI LL_XQSPI_QSPI_FRF_SPI
| Standard SPI Frame Format More...
#define | XQSPI_DATA_MODE_DUALSPI LL_XQSPI_QSPI_FRF_DUALSPI
| Dual-SPI Frame Format More...
#define | XQSPI_DATA_MODE_QUADSPI LL_XQSPI_QSPI_FRF_QUADSPI
| Quad-SPI Frame Format More...
#define | XQSPI_FIFO_THRESHOLD_1_8 LL_XQSPI_QSPI_FIFO_WATERMARK_1_8
| FIFO depth/8 More...
#define | XQSPI_FIFO_THRESHOLD_1_4 LL_XQSPI_QSPI_FIFO_WATERMARK_1_4
| FIFO depth/4 More...
#define | XQSPI_FIFO_THRESHOLD_1_2 LL_XQSPI_QSPI_FIFO_WATERMARK_1_2
| FIFO depth/2 More...
#define | XQSPI_FIFO_THRESHOLD_3_4 LL_XQSPI_QSPI_FIFO_WATERMARK_3_4
| FIFO depth*3/4 More...
#define | XQSPI_FIFO_DEPTH LL_XQSPI_QSPI_FIFO_DEPTH
| FIFO full depth More...
#define | XQSPI_INSTSIZE_00_BITS (0)
| 0-bit (No Instruction) More...
#define | XQSPI_INSTSIZE_08_BITS (1)
| 8-bit Instruction More...
#define | XQSPI_INSTSIZE_16_BITS (2)
| 16-bit Instruction More...
#define | XQSPI_ADDRSIZE_00_BITS (0)
| 0-bit (No Address) More...
#define | XQSPI_ADDRSIZE_08_BITS (1)
| 8-bit Address More...
#define | XQSPI_ADDRSIZE_16_BITS (2)
| 16-bit Address More...
#define | XQSPI_ADDRSIZE_24_BITS (3)
| 24-bit Address More...
#define | XQSPI_ADDRSIZE_32_BITS (4)
| 32-bit Address More...
#define | XQSPI_INST_ADDR_ALL_IN_SPI (0)
| Instruction and address are sent in SPI mode. More...
#define | XQSPI_INST_IN_SPI_ADDR_IN_SPIFRF (1)
| Instruction is sent in SPI mode, and address is sent in Daul/Quad SPI mode. More...
#define | XQSPI_INST_ADDR_ALL_IN_SPIFRF (2)
| Instruction and address are sent in Daul/Quad SPI mode. More...
#define | XQSPI_FLAG_RFF LL_XQSPI_QSPI_STAT_RFF
| Rx FIFO full flag More...
#define | XQSPI_FLAG_RFTF LL_XQSPI_QSPI_STAT_RFTF
| Rx FIFO threshold flag More...
#define | XQSPI_FLAG_RFE LL_XQSPI_QSPI_STAT_RFE
| Rx FIFO empty flag More...
#define | XQSPI_FLAG_TFF LL_XQSPI_QSPI_STAT_TFF
| Tx FIFO full flag More...
#define | XQSPI_FLAG_TFTF LL_XQSPI_QSPI_STAT_TFTF
| Tx FIFO threshold flag More...
#define | XQSPI_FLAG_TFE LL_XQSPI_QSPI_STAT_TFE
| Tx FIFO empty flag More...
#define | XQSPI_FLAG_BUSY LL_XQSPI_QSPI_STAT_BUSY
| Busy flag More...
#define | XQSPI_DISABLE_PRESENT LL_XQSPI_DISABLE_PRESENT
| Disable Present. More...
#define | XQSPI_ENABLE_PRESENT LL_XQSPI_ENABLE_PRESENT
| Enable Present More...
#define | HAL_XQSPI_RETRY_DEFAULT_VALUE ((uint32_t)1000)
| 1000 times 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, XQSPI_QSPI_EN_EN)
| Enable the specified QSPI peripheral in XQSPI. More...
#define | __HAL_XQSPI_DISABLE_QSPI(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->QSPI.SPIEN, XQSPI_QSPI_EN_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_CACHE_MAPPING(__MODE__)
| Check if XQSPI Cache Direct Map is valid. More...
#define | IS_XQSPI_CACHE_FLUSH(__MODE__)
| Check if XQSPI Cache Flush 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. More...
typedef struct _xqspi_handle_t | xqspi_handle_t
| XQSPI handle Structure definition. More...
typedef struct _xqspi_command_t | xqspi_command_t
| XQSPI command Structure definition. More...
typedef struct _hal_xqspi_callback | hal_xqspi_callback_t
| HAL_XQSPI Callback function definition. More...

## 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.

Definition in file gr55xx_hal_xqspi.h.