Header file containing functions prototypes of SPI HAL library. More...
#include "gr55xx_ll_spi.h"
#include "gr55xx_hal_def.h"
#include "gr55xx_hal_dma.h"
#include "gr55xx_hal_spi.h"
Go to the source code of this file.
Macros | |
#define | SPI_XFER_INST_NONE 0xFF |
#define | SPI_XFER_ADDR_NONE 0xFFFFFF |
#define | SPI_XFER_INST_ADDR_NONE 0xFFFFFFFF |
Functions | |
hal_status_t | hal_spi_v2_init (spi_handle_t *p_spi, uint32_t rx_sample_delay) |
Initialize the SPI according to the specified parameters in the spi_init_t and initialize the associated handle. More... | |
hal_status_t | hal_spi_v2_deinit (spi_handle_t *p_spi) |
De-initialize the SPI peripheral. More... | |
void | hal_spi_v2_msp_init (spi_handle_t *p_spi) |
Initialize the SPI MSP. More... | |
void | hal_spi_v2_msp_deinit (spi_handle_t *p_spi) |
De-initialize the SPI MSP. More... | |
void | hal_spi_v2_set_rx_delay (spi_handle_t *p_spi, uint32_t rx_delay) |
set receive sample delay More... | |
hal_status_t | hal_spi_v2_transmit_8bit_toggle (spi_handle_t *p_spi, uint8_t *p_data, uint32_t length, uint32_t timeout) |
Transmit an amount of data in blocking mode with 8bit data width, and CS Signal will be assert/de-assert in every byte. More... | |
hal_status_t | hal_spi_v2_transmit_8bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout) |
Transmit an amount of data in blocking mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_receive_8bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout) |
Receive an amount of data in blocking mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_transmit_receive_8bit (spi_handle_t *p_spi, uint8_t *tx_data, uint32_t tx_length, uint8_t *rx_data, uint32_t rx_length, uint32_t timeout) |
Transmit Then Receive an amount of data in blocking mode with 8bit data width. This Function works at EEPROM Read Mode, not Full duplex Mode. More... | |
hal_status_t | hal_spi_v2_transmit_32bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout) |
Transmit an amount of data in blocking mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_receive_32bit (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length, uint32_t timeout) |
Receive an amount of data in blocking mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_transmit_8bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length) |
Transmit an amount of data in DMA mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_receive_8bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length) |
Receive an amount of data in DMA mode with 8bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_transmit_32bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_tx_data, uint32_t length) |
Transmit an amount of data in DMA mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_receive_32bit_dma (spi_handle_t *p_spi, uint8_t inst, uint32_t addr, uint8_t *p_data, uint32_t length) |
Receive an amount of data in DMA mode with 32bit data width. if set inst to SPI_XFER_INST_NONE or set addr to SPI_XFER_ADDR_NONE, inst & addr won't be used in transfer. More... | |
hal_status_t | hal_spi_v2_abort (spi_handle_t *p_spi) |
Abort ongoing transfer (blocking mode). More... | |
hal_status_t | hal_spi_v2_abort_it (spi_handle_t *p_spi) |
Abort ongoing transfer (Interrupt mode). More... | |
void | hal_spi_v2_irq_handler (spi_handle_t *p_spi) |
Handle SPI interrupt request. More... | |
void | hal_spi_v2_tx_cplt_callback (spi_handle_t *p_spi) |
Tx Transfer completed callback. More... | |
void | hal_spi_v2_rx_cplt_callback (spi_handle_t *p_spi) |
Rx Transfer completed callback. More... | |
void | hal_spi_v2_tx_rx_cplt_callback (spi_handle_t *p_spi) |
Tx and Rx Transfer completed callback. More... | |
void | hal_spi_v2_error_callback (spi_handle_t *p_spi) |
SPI error callback. More... | |
void | hal_spi_v2_abort_cplt_callback (spi_handle_t *p_spi) |
SPI Abort Completed callback. More... | |
hal_spi_state_t | hal_spi_v2_get_state (spi_handle_t *p_spi) |
Return the SPI handle state. More... | |
uint32_t | hal_spi_v2_get_error (spi_handle_t *p_spi) |
Return the SPI error code. More... | |
void | hal_spi_v2_set_timeout (spi_handle_t *p_spi, uint32_t timeout) |
Set the SPI internal process timeout value. More... | |
uint32_t | hal_spi_v2_get_tx_fifo_threshold (spi_handle_t *p_spi) |
Get the TX FIFO threshold. More... | |
uint32_t | hal_spi_v2_get_rx_fifo_threshold (spi_handle_t *p_spi) |
Get the RX FIFO threshold. More... | |
hal_status_t | hal_spi_v2_suspend_reg (spi_handle_t *p_spi) |
Suspend some registers related to SPI configuration before sleep. More... | |
hal_status_t | hal_spi_v2_resume_reg (spi_handle_t *p_spi) |
Restore some registers related to SPI configuration after sleep. This function must be used in conjunction with the hal_spi_suspend_reg(). More... | |
hal_status_t | hal_spi_v2_transmit_dma_with_toggle (spi_handle_t *p_spi, uint32_t data_size, uint8_t *p_data, uint32_t length) |
Using DMA to Transmit data by toggling CS in every data beat. More... | |
Header file containing functions prototypes of SPI HAL library.
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_spi_v2.h.