Go to the documentation of this file.
64 #ifdef HAL_SPI_MODULE_ENABLED
67 #error "NOT Support USING app_spi AND app_spi_v2 AT The Same Time !!!"
74 #define APP_SPI_PIN_ENABLE 1
75 #define APP_SPI_PIN_DISABLE 0
372 #ifdef ENV_RTOS_USE_SEMP
384 uint16_t app_spi_receive_sem_sync(
app_spi_id_t id, uint8_t *p_data, uint16_t size);
397 uint16_t app_spi_transmit_sem_sync(
app_spi_id_t id, uint8_t *p_data, uint16_t size);
411 uint16_t app_spi_transmit_receive_sem_sync(
app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size);
SPI IO configuration Structures.
SPI handle Structure definition.
app_spi_mode_t use_mode
SPI operate mode.
@ APP_SPI_TYPE_MAX
Only for check parameter, not used as input parameters.
uint16_t app_spi_deinit(app_spi_id_t id)
De-initialize the APP SPI DRIVER peripheral.
@ APP_SPI_ID_MAX
Only for check parameter, not used as input parameters.
app_spi_pin_cfg_t pin_cfg
the pin configuration information for the specified SPI module.
uint16_t app_spi_receive_high_speed_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size)
[High speed] Receive in master or slave mode an amount of data in blocking mode.
uint16_t app_spi_transmit_high_speed_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size)
[High speed] Transmit in master or slave mode an amount of data in blocking mode.
app_spi_pin_t mosi
Set the configuration of SPI MOSI pin.
@ APP_SPI_ID_SLAVE
SPI slave module.
uint16_t app_spi_read_memory_async(app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_rx_data, uint32_t cmd_size, uint32_t rx_size)
Read an amount of data from EEPROM in non-blocking mode with DMA.
@ APP_SPI_TYPE_DMA
DMA operation mode
void(* app_spi_evt_handler_t)(app_spi_evt_t *p_evt)
SPI event callback definition.
SPI parameters structure definition.
SPI init Structure definition.
SPI event structure definition.
app_io_pull_t
GPIO pull Enumerations definition.
app_io_type_t
GPIO type Enumerations definition.
uint16_t app_spi_init(app_spi_params_t *p_params, app_spi_evt_handler_t evt_handler)
Initialize the APP SPI DRIVER according to the specified parameters in the app_spi_params_t and app_s...
app_spi_pin_t clk
Set the configuration of SPI CLK pin.
uint32_t error_code
SPI Error code .
uint16_t app_spi_transmit_receive_async(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size)
Transmits and receive in master or slave mode an amount of data in non-blocking mode with Interrupt.
uint16_t app_spi_write_memory_async(app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_tx_data, uint32_t cmd_size, uint32_t tx_size)
Transmits in master or slave mode an amount of data in non-blocking mode with DMA.
app_io_type_t type
Specifies the type of SPI IO.
uint8_t enable
Enable or disable the pin.
@ APP_SPI_ID_MASTER
SPI master module.
uint16_t app_spi_transmit_receive_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size, uint32_t timeout)
Transmits and receive in master or slave mode an amount of data in blocking mode.
@ APP_SPI_TYPE_POLLING
Polling operation mode
Header file containing functions prototypes of GPIO app library.
@ APP_SPI_EVT_TX_RX
Requested TX/RX transfer completed.
app_spi_id_t id
specified SPI module ID.
spi_handle_t * app_spi_get_handle(app_spi_id_t id)
Return the SPI handle.
app_spi_id_t
SPI module Enumerations definition.
uint16_t app_spi_transmit_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
Transmits in master or slave mode an amount of data in blocking mode.
app_spi_pin_t cs
Set the configuration of SPI CS pin.
@ APP_SPI_TYPE_INTERRUPT
Interrupt operation mode.
uint16_t app_spi_receive_async(app_spi_id_t id, uint8_t *p_data, uint16_t size)
Receive in master or slave mode an amount of data in non-blocking mode with Interrupt.
app_spi_evt_type_t type
Type of event.
app_spi_evt_type_t
SPI event Enumerations definition.
dma_channel_t rx_dma_channel
Specifies the dma channel of SPI RX.
app_spi_type_t
SPI operating mode Enumerations definition.
@ APP_SPI_EVT_TX_CPLT
Requested TX transfer completed.
uint16_t app_spi_receive_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
Receive in master or slave mode an amount of data in blocking mode.
@ APP_SPI_EVT_RX_DATA
Requested RX transfer completed.
app_spi_pin_t miso
Set the configuration of SPI MISO pin.
This file contains all the functions prototypes for the HAL module driver.
dma_channel_t tx_dma_channel
Specifies the dma channel of SPI TX.
uint16_t size
SPI transmitted/received counter.
app_spi_type_t type
Specifies the operation mode of SPI.
app_io_mux_t
GPIO mux Enumerations definition.
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
uint16_t app_spi_read_eeprom_async(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size)
Read an amount of data from EEPROM in non-blocking mode with Interrupt.
Header file of app rtos config code.
Header file of app driver error code.
spi_init_t init
SPI communication parameters.
@ APP_SPI_EVT_ERROR
Error reported by UART peripheral.
app_io_mux_t mux
Specifies the Peripheral to be connected to the selected pins.
uint16_t app_spi_transmit_async(app_spi_id_t id, uint8_t *p_data, uint16_t size)
Transmits in master or slave mode an amount of data in non-blocking mode with Interrupt.
dma_channel_t
HAL DMA Channel Enumerations definition.
uint16_t app_spi_read_eeprom_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size, uint32_t timeout)
Read an amount of data from EEPROM in blocking mode.
uint32_t pin
Specifies the IO pins to be configured.
SPI operate mode Enumerations definition.