SPI control functions.
More...
SPI control functions.
===============================================================================
##### Peripheral State and Errors functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the SPI.
(+) hal_spi_get_state() API can be helpful to check in run-time the state of the SPI peripheral
(+) hal_spi_get_error() check in run-time Errors occurring during communication
(+) hal_spi_set_timeout() set the timeout during internal process
(+) hal_spi_set_tx_fifo_threshold() set the TX FIFO Threshold
(+) hal_spi_set_rx_fifo_threshold() set the RX FIFO Threshold
(+) hal_spi_get_tx_fifo_threshold() get the TX FIFO Threshold
(+) hal_spi_get_rx_fifo_threshold() get the RX FIFO Threshold
===============================================================================
##### Peripheral State and Errors functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the SPI.
(+) hal_spi_get_state() API can be helpful to check in run-time the state of the SPI peripheral
(+) hal_spi_get_error() check in run-time Errors occurring during communication
(+) hal_spi_set_timeout() set the timeout during internal process
(+) hal_spi_get_tx_fifo_threshold() get the TX FIFO Threshold
(+) hal_spi_get_rx_fifo_threshold() get the RX FIFO Threshold
◆ hal_spi_get_error()
Return the SPI error code.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Returns
- SPI error code in bitmap format
◆ hal_spi_get_rx_fifo_threshold()
uint32_t hal_spi_get_rx_fifo_threshold |
( |
spi_handle_t * |
p_spi | ) |
|
Get the RX FIFO threshold.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Returns
- RX FIFO threshold
◆ hal_spi_get_state()
Return the SPI handle state.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Return values
-
◆ hal_spi_get_tx_fifo_threshold()
uint32_t hal_spi_get_tx_fifo_threshold |
( |
spi_handle_t * |
p_spi | ) |
|
Get the TX FIFO threshold.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Returns
- TX FIFO threshold
◆ hal_spi_resume_reg()
Restore some registers related to SPI configuration after sleep. This function must be used in conjunction with the hal_spi_suspend_reg().
- Parameters
-
[in] | p_spi | Pointer to a SPI handle which contains the configuration information for the specified SPI module. |
- Return values
-
◆ hal_spi_set_rx_fifo_threshold()
Set the RX FIFO threshold.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
[in] | threshold | RX FIFO threshold value ranging bwtween 0x0U ~ 0x7U. |
- Return values
-
◆ hal_spi_set_timeout()
void hal_spi_set_timeout |
( |
spi_handle_t * |
p_spi, |
|
|
uint32_t |
timeout |
|
) |
| |
Set the SPI internal process timeout value.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
[in] | timeout | Internal process timeout value. |
◆ hal_spi_set_tx_fifo_threshold()
Set the TX FIFO threshold.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
[in] | threshold | TX FIFO threshold value ranging bwtween 0x0U ~ 0x7U. |
- Return values
-
◆ hal_spi_suspend_reg()
Suspend some registers related to SPI configuration before sleep.
- Parameters
-
[in] | p_spi | Pointer to a SPI handle which contains the configuration information for the specified SPI module. |
- Return values
-
◆ hal_spi_v2_get_error()
Return the SPI error code.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Returns
- SPI error code in bitmap format
◆ 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.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Returns
- RX FIFO threshold
◆ hal_spi_v2_get_state()
Return the SPI handle state.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Return values
-
◆ 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.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
- Returns
- TX FIFO threshold
◆ hal_spi_v2_resume_reg()
Restore some registers related to SPI configuration after sleep. This function must be used in conjunction with the hal_spi_suspend_reg().
- Parameters
-
[in] | p_spi | Pointer to a SPI handle which contains the configuration information for the specified SPI module. |
- Return values
-
◆ 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.
- Parameters
-
[in] | p_spi | Pointer to an SPI handle which contains the configuration information for the specified SPI module. |
[in] | timeout | Internal process timeout value. |
◆ hal_spi_v2_suspend_reg()
Suspend some registers related to SPI configuration before sleep.
- Parameters
-
[in] | p_spi | Pointer to a SPI handle which contains the configuration information for the specified SPI module. |
- Return values
-
◆ 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.
- Parameters
-
- Returns
- Result of operation.