gr55xx_hal_spi_v2.h
Go to the documentation of this file.
1
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_SPI_V2_H__
53 #define __GR55xx_HAL_SPI_V2_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_spi.h"
61 #include "gr55xx_hal_def.h"
62 #include "gr55xx_hal_dma.h"
63 #include "gr55xx_hal_spi.h"
64
69 #define SPI_XFER_INST_NONE 0xFF
70 #define SPI_XFER_ADDR_NONE 0xFFFFFF
71 #define SPI_XFER_INST_ADDR_NONE 0xFFFFFFFF
120 hal_status_t hal_spi_v2_init(spi_handle_t *p_spi, uint32_t rx_sample_delay);
121
133 hal_status_t hal_spi_v2_deinit(spi_handle_t *p_spi);
134
143 void hal_spi_v2_msp_init(spi_handle_t *p_spi);
144
153 void hal_spi_v2_msp_deinit(spi_handle_t *p_spi);
168 void hal_spi_v2_set_rx_delay(spi_handle_t *p_spi, uint32_t rx_delay);
169
170
218 hal_status_t hal_spi_v2_transmit_8bit_toggle(spi_handle_t *p_spi, uint8_t *p_data, uint32_t length, uint32_t timeout);
219
237 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);
238
256 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);
257
275 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);
276
294 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);
295
296
314 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);
315
332 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);
333
350 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);
351
368 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);
369
386 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);
387
406 hal_status_t hal_spi_v2_abort(spi_handle_t *p_spi);
407
428 hal_status_t hal_spi_v2_abort_it(spi_handle_t *p_spi);
443 void hal_spi_v2_irq_handler(spi_handle_t *p_spi);
444
451 void hal_spi_v2_tx_cplt_callback(spi_handle_t *p_spi);
452
459 void hal_spi_v2_rx_cplt_callback(spi_handle_t *p_spi);
460
467 void hal_spi_v2_tx_rx_cplt_callback(spi_handle_t *p_spi);
468
475 void hal_spi_v2_error_callback(spi_handle_t *p_spi);
476
483 void hal_spi_v2_abort_cplt_callback(spi_handle_t *p_spi);
484
519 hal_spi_state_t hal_spi_v2_get_state(spi_handle_t *p_spi);
520
528 uint32_t hal_spi_v2_get_error(spi_handle_t *p_spi);
529
537 void hal_spi_v2_set_timeout(spi_handle_t *p_spi, uint32_t timeout);
538
546 uint32_t hal_spi_v2_get_tx_fifo_threshold(spi_handle_t *p_spi);
547
555 uint32_t hal_spi_v2_get_rx_fifo_threshold(spi_handle_t *p_spi);
556
568 hal_status_t hal_spi_v2_suspend_reg(spi_handle_t *p_spi);
569
582 hal_status_t hal_spi_v2_resume_reg(spi_handle_t *p_spi);
583
597 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);
598
603 #ifdef __cplusplus
604 }
605 #endif
606
607 #endif /* __GR55xx_HAL_SPI_V2_H__ */
608
_spi_handle
SPI handle Structure definition.
Definition: gr55xx_hal_spi.h:135
hal_spi_v2_transmit_8bit
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 o...
hal_spi_v2_transmit_8bit_dma
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...
hal_spi_v2_receive_8bit_dma
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 ...
gr55xx_hal_spi.h
Header file containing functions prototypes of SPI HAL library.
hal_spi_v2_transmit_dma_with_toggle
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.
hal_spi_v2_transmit_32bit
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 ...
hal_spi_v2_get_rx_fifo_threshold
uint32_t hal_spi_v2_get_rx_fifo_threshold(spi_handle_t *p_spi)
Get the RX FIFO threshold.
hal_spi_v2_deinit
hal_status_t hal_spi_v2_deinit(spi_handle_t *p_spi)
De-initialize the SPI peripheral.
hal_spi_state_t
hal_spi_state_t
HAL SPI State Enumerations definition.
Definition: gr55xx_hal_spi.h:76
hal_spi_v2_suspend_reg
hal_status_t hal_spi_v2_suspend_reg(spi_handle_t *p_spi)
Suspend some registers related to SPI configuration before sleep.
hal_spi_v2_abort_it
hal_status_t hal_spi_v2_abort_it(spi_handle_t *p_spi)
Abort ongoing transfer (Interrupt mode).
hal_spi_v2_rx_cplt_callback
void hal_spi_v2_rx_cplt_callback(spi_handle_t *p_spi)
Rx Transfer completed callback.
hal_spi_v2_tx_cplt_callback
void hal_spi_v2_tx_cplt_callback(spi_handle_t *p_spi)
Tx Transfer completed callback.
hal_spi_v2_get_state
hal_spi_state_t hal_spi_v2_get_state(spi_handle_t *p_spi)
Return the SPI handle state.
hal_spi_v2_receive_8bit
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...
hal_spi_v2_abort
hal_status_t hal_spi_v2_abort(spi_handle_t *p_spi)
Abort ongoing transfer (blocking mode).
gr55xx_ll_spi.h
Header file containing functions prototypes of SPI LL library.
hal_spi_v2_msp_deinit
void hal_spi_v2_msp_deinit(spi_handle_t *p_spi)
De-initialize the SPI MSP.
hal_spi_v2_receive_32bit_dma
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...
gr55xx_hal_dma.h
Header file containing functions prototypes of DMA HAL library.
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
hal_spi_v2_irq_handler
void hal_spi_v2_irq_handler(spi_handle_t *p_spi)
Handle SPI interrupt request.
hal_spi_v2_transmit_8bit_toggle
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-ass...
hal_spi_v2_transmit_receive_8bit
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...
hal_spi_v2_get_error
uint32_t hal_spi_v2_get_error(spi_handle_t *p_spi)
Return the SPI error code.
hal_spi_v2_transmit_32bit_dma
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 se...
hal_spi_v2_receive_32bit
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 o...
hal_spi_v2_error_callback
void hal_spi_v2_error_callback(spi_handle_t *p_spi)
SPI error callback.
hal_spi_v2_resume_reg
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 conjun...
hal_spi_v2_msp_init
void hal_spi_v2_msp_init(spi_handle_t *p_spi)
Initialize the SPI MSP.
hal_spi_v2_get_tx_fifo_threshold
uint32_t hal_spi_v2_get_tx_fifo_threshold(spi_handle_t *p_spi)
Get the TX FIFO threshold.
hal_spi_v2_abort_cplt_callback
void hal_spi_v2_abort_cplt_callback(spi_handle_t *p_spi)
SPI Abort Completed callback.
hal_spi_v2_set_timeout
void hal_spi_v2_set_timeout(spi_handle_t *p_spi, uint32_t timeout)
Set the SPI internal process timeout value.
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
hal_spi_v2_set_rx_delay
void hal_spi_v2_set_rx_delay(spi_handle_t *p_spi, uint32_t rx_delay)
set receive sample delay
hal_spi_v2_tx_rx_cplt_callback
void hal_spi_v2_tx_rx_cplt_callback(spi_handle_t *p_spi)
Tx and Rx Transfer completed callback.