Classes | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_dspi.h File Reference

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

`#include "gr55xx_ll_dspi.h"`
`#include "gr55xx_hal_def.h"`
`#include "gr55xx_hal_pwr_mgmt.h"`
Include dependency graph for gr55xx_hal_dspi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | _dspi_init_t
| QSPI init Structure definition. More...
struct | _dspi_handle
| DSPI handle Structure definition. More...
struct | _dspi_command_t
| DSPI command Structure definition. More...
struct | _hal_dspi_callback
| HAL_DSPI Callback function definition. More...

## Macros
#define | HAL_DSPI_ERROR_NONE ((uint32_t)0x00000000)
| No error More...
#define | HAL_DSPI_ERROR_TIMEOUT ((uint32_t)0x00000001)
| Timeout error More...
#define | HAL_DSPI_ERROR_TRANSFER ((uint32_t)0x00000002)
| Transfer error More...
#define | HAL_DSPI_ERROR_DMA ((uint32_t)0x00000004)
| DMA transfer error More...
#define | HAL_DSPI_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
| Invalid parameter error More...
#define | DSPI_BAUD_RATE_2P1PCLK LL_DSPI_BAUD_RATE_2P1PCLK
| DSPI Baud rate fPCLK / 2 More...
#define | DSPI_BAUD_RATE_4P1PCLK LL_DSPI_BAUD_RATE_4P1PCLK
| DSPI Baud rate fPCLK / 4 More...
#define | DSPI_BAUD_RATE_8P1PCLK LL_DSPI_BAUD_RATE_8P1PCLK
| DSPI Baud rate fPCLK / 8 More...
#define | DSPI_BAUD_RATE_16P1PCLK LL_DSPI_BAUD_RATE_16P1PCLK
| DSPI Baud rate fPCLK / 16 More...
#define | DSPI_BAUD_RATE_32P1PCLK LL_DSPI_BAUD_RATE_32P1PCLK
| DSPI Baud rate fPCLK / 32 More...
#define | DSPI_BAUD_RATE_64P1PCLK LL_DSPI_BAUD_RATE_64P1PCLK
| DSPI Baud rate fPCLK / 64 More...
#define | DSPI_BAUD_RATE_128P1PCLK LL_DSPI_BAUD_RATE_128P1PCLK
| DSPI Baud rate fPCLK / 128. More...
#define | DSPI_BAUD_RATE_256P1PCLK LL_DSPI_BAUD_RATE_256PCLK
| DSPI Baud rate fPCLK / 256. More...
#define | DSPI_PROT_MODE_3W1L LL_DSPI_PROT_MODE_3W1L
| DSPI 3-Wire 1-Lane Interface More...
#define | DSPI_PROT_MODE_4W1L LL_DSPI_PROT_MODE_4W1L
| DSPI 4-Wire 1-Lane Interface More...
#define | DSPI_PROT_MODE_4W2L LL_DSPI_PROT_MODE_4W2L
| DSPI 4-Wire 2-Lane Interface More...
#define | DSPI_INSTSIZE_08_BITS ((uint32_t)0x01)
| 8-bit Instruction More...
#define | DSPI_INSTSIZE_16_BITS ((uint32_t)0x02)
| 16-bit Instruction More...
#define | DSPI_INSTSIZE_32_BITS ((uint32_t)0x03)
| 32-bit Instruction More...
#define | DSPI_DATASIZE_04_BITS LL_DSPI_DATASIZE_4BIT
| Data length for DSPI transfer: 4 bits. More...
#define | DSPI_DATASIZE_05_BITS LL_DSPI_DATASIZE_5BIT
| Data length for DSPI transfer: 5 bits. More...
#define | DSPI_DATASIZE_06_BITS LL_DSPI_DATASIZE_6BIT
| Data length for DSPI transfer: 6 bits. More...
#define | DSPI_DATASIZE_07_BITS LL_DSPI_DATASIZE_7BIT
| Data length for DSPI transfer: 7 bits. More...
#define | DSPI_DATASIZE_08_BITS LL_DSPI_DATASIZE_8BIT
| Data length for DSPI transfer: 8 bits. More...
#define | DSPI_DATASIZE_09_BITS LL_DSPI_DATASIZE_9BIT
| Data length for DSPI transfer: 9 bits. More...
#define | DSPI_DATASIZE_10_BITS LL_DSPI_DATASIZE_10BIT
| Data length for DSPI transfer: 10 bits. More...
#define | DSPI_DATASIZE_11_BITS LL_DSPI_DATASIZE_11BIT
| Data length for DSPI transfer: 11 bits. More...
#define | DSPI_DATASIZE_12_BITS LL_DSPI_DATASIZE_12BIT
| Data length for DSPI transfer: 12 bits. More...
#define | DSPI_DATASIZE_13_BITS LL_DSPI_DATASIZE_13BIT
| Data length for DSPI transfer: 13 bits. More...
#define | DSPI_DATASIZE_14_BITS LL_DSPI_DATASIZE_14BIT
| Data length for DSPI transfer: 14 bits. More...
#define | DSPI_DATASIZE_15_BITS LL_DSPI_DATASIZE_15BIT
| Data length for DSPI transfer: 15 bits. More...
#define | DSPI_DATASIZE_16_BITS LL_DSPI_DATASIZE_16BIT
| Data length for DSPI transfer: 16 bits. More...
#define | DSPI_DATASIZE_17_BITS LL_DSPI_DATASIZE_17BIT
| Data length for DSPI transfer: 17 bits. More...
#define | DSPI_DATASIZE_18_BITS LL_DSPI_DATASIZE_18BIT
| Data length for DSPI transfer: 18 bits. More...
#define | DSPI_DATASIZE_19_BITS LL_DSPI_DATASIZE_19BIT
| Data length for DSPI transfer: 19 bits. More...
#define | DSPI_DATASIZE_20_BITS LL_DSPI_DATASIZE_20BIT
| Data length for DSPI transfer: 20 bits. More...
#define | DSPI_DATASIZE_21_BITS LL_DSPI_DATASIZE_21BIT
| Data length for DSPI transfer: 21 bits. More...
#define | DSPI_DATASIZE_22_BITS LL_DSPI_DATASIZE_22BIT
| Data length for DSPI transfer: 22 bits. More...
#define | DSPI_DATASIZE_23_BITS LL_DSPI_DATASIZE_23BIT
| Data length for DSPI transfer: 23 bits. More...
#define | DSPI_DATASIZE_24_BITS LL_DSPI_DATASIZE_24BIT
| Data length for DSPI transfer: 24 bits. More...
#define | DSPI_DATASIZE_25_BITS LL_DSPI_DATASIZE_25BIT
| Data length for DSPI transfer: 25 bits. More...
#define | DSPI_DATASIZE_26_BITS LL_DSPI_DATASIZE_26BIT
| Data length for DSPI transfer: 26 bits. More...
#define | DSPI_DATASIZE_27_BITS LL_DSPI_DATASIZE_27BIT
| Data length for DSPI transfer: 27 bits. More...
#define | DSPI_DATASIZE_28_BITS LL_DSPI_DATASIZE_28BIT
| Data length for DSPI transfer: 28 bits. More...
#define | DSPI_DATASIZE_29_BITS LL_DSPI_DATASIZE_29BIT
| Data length for DSPI transfer: 29 bits. More...
#define | DSPI_DATASIZE_30_BITS LL_DSPI_DATASIZE_30BIT
| Data length for DSPI transfer: 30 bits. More...
#define | DSPI_DATASIZE_31_BITS LL_DSPI_DATASIZE_31BIT
| Data length for DSPI transfer: 31 bits. More...
#define | DSPI_DATASIZE_32_BITS LL_DSPI_DATASIZE_32BIT
| Data length for DSPI transfer: 32 bits. More...
#define | DSPI_FLAG_FFE LL_DSPI_SR_FFE
| Frame format error flag More...
#define | DSPI_FLAG_OVR LL_DSPI_SR_OVR
| Rx overrun flag More...
#define | DSPI_FLAG_MODE LL_DSPI_SR_MODF
| Mode fault flag More...
#define | DSPI_FLAG_RFNE LL_DSPI_SR_RFNE
| Rx FIFO not empty flag More...
#define | DSPI_FLAG_TFE LL_DSPI_SR_TFE
| Tx FIFO empty flag More...
#define | DSPI_FLAG_BUSY LL_DSPI_SR_BUSY
| Busy flag More...
#define | DSPI_IT_RXNE LL_DSPI_IM_RXNE
| Receive FIFO not empty Interrupt More...
#define | DSPI_IT_ERR LL_DSPI_IM_ER
| Error Interrupt More...
#define | DSPI_IT_TXE LL_DSPI_IM_TXE
| Transmit FIFO Empty Interrupt More...
#define | DSPI_RX_FIFO_TH_1P2 LL_DSPI_FRXTH_1P2
| FIFO level is 1/2 (8 bytes) More...
#define | DSPI_RX_FIFO_TH_1P4 LL_DSPI_FRXTH_1P4
| FIFO level is 1/4 (4 bytes) More...
#define | DSPI_RX_FIFO_TH_1P8 LL_DSPI_FRXTH_1P8
| FIFO level is 1/8 (2 bytes) More...
#define | DSPI_RX_FIFO_TH_1P16 LL_DSPI_FRXTH_1P16
| FIFO level is 1/16 (1 bytes) More...
#define | DSPI_TRANSPORT_DATA LL_DSPI_DCX_DATA
| Transport data. More...
#define | DSPI_TRANSPORT_CMD LL_DSPI_DCX_CMD
| Transport cmd More...
#define | HAL_DSPI_TIMEOUT_DEFAULT_VALUE ((uint32_t)5000)
| 5s More...
#define | __HAL_DSPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_DSPI_STATE_RESET)
| Reset DSPI handle states. More...
#define | __HAL_DSPI_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL1, DSPI_CR1_EN)
| Enable the specified DSPI peripheral. More...
#define | __HAL_DSPI_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL1, DSPI_CR1_EN)
| Disable the specified DSPI peripheral. More...
#define | __HAL_DSPI_ENABLE_DMATX(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL2, DSPI_CR2_TXDMAEN)
| Enable the DSPI DMA TX Request. More...
#define | __HAL_DSPI_ENABLE_DMARX(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL2, DSPI_CR2_RXDMAEN)
| Enable the DSPI DMA RX Request. More...
#define | __HAL_DSPI_DISABLE_DMATX(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL2, DSPI_CR2_TXDMAEN)
| Disable the DSPI DMA TX Request. More...
#define | __HAL_DSPI_DISABLE_DMARX(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL2, DSPI_CR2_RXDMAEN)
| Disable the DSPI DMA RX Request. More...
#define | __HAL_DSPI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BITS((__HANDLE__)->p_instance->CTRL2, (__INTERRUPT__))
| Enable the specified DSPI interrupts. More...
#define | __HAL_DSPI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL2, (__INTERRUPT__))
| Disable the specified DSPI interrupts. More...
#define | __HAL_DSPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (READ_BITS((__HANDLE__)->p_instance->CTRL2, (__INTERRUPT__)) == (__INTERRUPT__))
| Check whether the specified DSPI interrupt source is enabled or not. More...
#define | __HAL_DSPI_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0) ? SET : RESET)
| Check whether the specified DSPI flag is set or not. More...
#define | __HAL_DSPI_FLUSH_FIFO(__HANDLE__) ll_dspi_flush_fifo((__HANDLE__)->p_instance)
| Flush the DSPI receiver FIFO. More...
#define | __HAL_DSPI_TRANSPORT_TYPE(__HANDLE__, __TYPE__) ll_dspi_set_dcx((__HANDLE__)->p_instance, (__TYPE__))
| Set the DSPI data transport type. More...
#define | IS_DSPI_CLOCK_PRESCALER(__PRESCALER__)
| Check if DSPI Clock Prescaler is valid. More...
#define | IS_DSPI_INTERFACE_MODE(__INTERFACEMODE__)
| Check if DSPI Interface Mode is valid. More...
#define | IS_DSPI_INSTRUCTION_SIZE(__INST_SIZE__)
| Check if DSPI Instruction Size is valid. More...

## Typedefs
typedef struct _dspi_init_t | dspi_init_t
| QSPI init Structure definition. More...
typedef struct _dspi_handle | dspi_handle_t
| DSPI handle Structure definition. More...
typedef struct _dspi_command_t | dspi_command_t
| DSPI command Structure definition. More...
typedef struct _hal_dspi_callback | hal_dspi_callback_t
| HAL_DSPI Callback function definition. More...

## Enumerations
enum | hal_dspi_state_t { HAL_DSPI_STATE_RESET = 0x00, HAL_DSPI_STATE_READY = 0x01, HAL_DSPI_STATE_BUSY = 0x02, HAL_DSPI_STATE_BUSY_INDIRECT_TX = 0x12, HAL_DSPI_STATE_ABORT = 0x08, HAL_DSPI_STATE_ERROR = 0x04 }
| HAL DSPI State Enumerations definition. More...

## Functions
hal_status_t | hal_dspi_init (dspi_handle_t *p_dspi)
| Initialize the DSPI according to the specified parameters in the dspi_init_t and initialize the associated handle. More...
hal_status_t | hal_dspi_deinit (dspi_handle_t *p_dspi)
| De-initialize the DSPI peripheral. More...
void | hal_dspi_msp_init (dspi_handle_t *p_dspi)
| Initialize the DSPI MSP. More...
void | hal_dspi_msp_deinit (dspi_handle_t *p_dspi)
| De-initialize the DSPI MSP. More...
hal_status_t | hal_dspi_command_transmit (dspi_handle_t *p_dspi, dspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout)
| Transmit an amount of data with the specified instruction in blocking mode. More...
hal_status_t | hal_dspi_command (dspi_handle_t *p_dspi, dspi_command_t *p_cmd, uint32_t timeout)
| Transmit only instruction in blocking mode. More...
hal_status_t | hal_dspi_transmit (dspi_handle_t *p_qspi, uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode. More...
hal_status_t | hal_dspi_command_transmit_it (dspi_handle_t *p_dspi, dspi_command_t *p_cmd, uint8_t *p_data)
| Transmit an amount of data with the specified instruction in non-blocking mode with Interrupt. More...
hal_status_t | hal_dspi_command_it (dspi_handle_t *p_dspi, dspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with Interrupt. More...
hal_status_t | hal_dspi_transmit_it (dspi_handle_t *p_dspi, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode with Interrupt. More...
hal_status_t | hal_dspi_command_transmit_dma (dspi_handle_t *p_dspi, dspi_command_t *p_cmd, uint8_t *p_data)
| Transmit an amount of data with the specified instruction in non-blocking mode with DMA . More...
hal_status_t | hal_dspi_command_transmit_dma_sg_llp (dspi_handle_t *p_dspi, dspi_command_t *p_cmd, uint8_t *p_data, dma_sg_llp_config_t *sg_llp_config)
| Transmit an amount of data with the specified instruction in non-blocking mode with DMA SG or LLP. More...
hal_status_t | hal_dspi_command_dma (dspi_handle_t *p_dspi, dspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with DMA. More...
hal_status_t | hal_dspi_transmit_dma (dspi_handle_t *p_dspi, uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode with DMA. More...
hal_status_t | hal_dspi_transmit_dma_sg_llp (dspi_handle_t *p_dspi, uint8_t *p_data, uint32_t length, dma_sg_llp_config_t *sg_llp_config)
| Transmit an amount of data in non-blocking mode with DMA SG or LLP. More...
hal_status_t | hal_dspi_abort (dspi_handle_t *p_dspi)
| Abort the current transmission. More...
hal_status_t | hal_dspi_abort_it (dspi_handle_t *p_dspi)
| Abort the current transmission (non-blocking function) More...
void | hal_dspi_irq_handler (dspi_handle_t *p_dspi)
| Handle DSPI interrupt request. More...
void | hal_dspi_tx_cplt_callback (dspi_handle_t *p_dspi)
| Tx Transfer completed callback. More...
void | hal_dspi_error_callback (dspi_handle_t *p_dspi)
| DSPI error callback. More...
void | hal_dspi_abort_callback (dspi_handle_t *p_dspi)
| DSPI Abort callback. More...
hal_dspi_state_t | hal_dspi_get_state (dspi_handle_t *p_dspi)
| Return the DSPI handle state. More...
uint32_t | hal_dspi_get_error (dspi_handle_t *p_dspi)
| Return the DSPI error code. More...
void | hal_dspi_set_timeout (dspi_handle_t *p_dspi, uint32_t timeout)
| Set the DSPI internal process timeout value. More...
hal_status_t | hal_dspi_config_mode (dspi_handle_t *p_dspi, uint32_t mode)
| Set the DSPI transmission mode. More...
hal_status_t | hal_dspi_suspend_reg (dspi_handle_t *p_dspi)
| Suspend some registers related to DSPI configuration before sleep. More...
hal_status_t | hal_dspi_resume_reg (dspi_handle_t *p_dspi)
| Restore some registers related to DSPI configuration after sleep. More...

## Detailed Description

Header file containing functions prototypes of DSPI 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_dspi.h.