35 #ifndef __HAL_SPI_SLAVE_H__ 36 #define __HAL_SPI_SLAVE_H__ 38 #include "hal_platform.h" 40 #ifdef HAL_SPI_SLAVE_MODULE_ENABLED 42 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 446 #ifdef HAL_GPIO_FEATURE_SET_DRIVING 481 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 543 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 573 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 596 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL SPI slave error, received continuous Configure Write command.
Definition: hal_spi_slave.h:518
SPI slave error, received POWER OFF command after Configure Write command.
Definition: hal_spi_slave.h:515
The SPI slave is busy.
Definition: hal_spi_slave.h:492
hal_spi_slave_command_type_t
This enum defines the SPI slave commands.
Definition: hal_platform.h:680
SPI slave error, received Write command after Configure Read command.
Definition: hal_spi_slave.h:520
The SPI slave API call was successful.
Definition: hal_spi_slave.h:533
hal_spi_slave_clock_polarity_t
SPI slave clock polarity definition.
Definition: hal_platform.h:654
hal_spi_slave_status_t hal_spi_slave_deinit(hal_spi_slave_port_t spi_port)
This function resets the SPI slave, gates its clock and disables interrupts.
hal_spi_slave_clock_phase_t phase
The SPI slave clock phase setting.
Definition: hal_spi_slave.h:549
SPI slave success operation.
Definition: hal_spi_slave.h:512
Disables send MISO data half SCLK cycle early.
Definition: hal_spi_slave.h:485
hal_spi_slave_callback_event_t
This enum defines the SPI slave event when an interrupt occurs.
Definition: hal_platform.h:667
SPI slave transaction status definition.
Definition: hal_spi_slave.h:554
hal_spi_slave_callback_event_t interrupt_status
The interrupt status of the SPI slave controller.
Definition: hal_spi_slave.h:556
hal_spi_slave_status_t hal_spi_slave_get_master_write_config(hal_spi_slave_port_t spi_port, uint32_t *address, uint32_t *length)
This function querys the address and the length from the config write command sent by the SPI master...
Invalid SPI slave port number.
Definition: hal_spi_slave.h:531
hal_spi_slave_status_t hal_spi_slave_send(hal_spi_slave_port_t spi_port, const uint8_t *data, uint32_t size)
This function sends data asynchronously with DMA mode, this function should be called from user's cal...
hal_spi_slave_status_t hal_spi_slave_receive(hal_spi_slave_port_t spi_port, uint8_t *buffer, uint32_t size)
This function receives data asynchronously with DMA mode.
An error occurred during the SPI slave API call.
Definition: hal_spi_slave.h:529
SPI slave invalid operation.
Definition: hal_spi_slave.h:513
SPI slave configure.
Definition: hal_spi_slave.h:545
hal_spi_slave_fsm_status_t fsm_status
An item from hal_spi_slave_fsm_status_t.
Definition: hal_spi_slave.h:555
hal_spi_slave_clock_phase_t
SPI slave clock format definition.
Definition: hal_platform.h:661
The SPI slave is idle.
Definition: hal_spi_slave.h:493
hal_spi_slave_status_t hal_spi_slave_set_early_miso(hal_spi_slave_port_t spi_port, hal_spi_slave_early_miso_t early_miso)
This function configures the SPI slave send MISO early half SCLK cycle parameter. ...
SPI slave error, received Configure Write command after Configure Read command.
Definition: hal_spi_slave.h:519
SPI slave error, received POWER OFF command after Configure Read command.
Definition: hal_spi_slave.h:514
Invalid parameter.
Definition: hal_spi_slave.h:532
hal_spi_slave_port_t
This enum defines the SPI slave port.
Definition: hal_platform.h:642
hal_spi_slave_early_miso_t
The SPI slave sends MISO data half SCLK cycle early.
Definition: hal_spi_slave.h:484
hal_spi_slave_bit_order_t bit_order
The SPI slave bit order setting.
Definition: hal_spi_slave.h:547
hal_spi_slave_status_t hal_spi_slave_register_callback(hal_spi_slave_port_t spi_port, hal_spi_slave_callback_t callback_function, void *user_data)
This function registers user's callback in the SPI slave driver.
hal_spi_slave_status_t hal_spi_slave_set_command(hal_spi_slave_port_t spi_port, hal_spi_slave_command_type_t command, uint8_t value)
This function configures the SPI slave command value.
hal_spi_slave_clock_polarity_t polarity
The SPI slave clock polarity setting.
Definition: hal_spi_slave.h:548
hal_spi_slave_fsm_status_t
SPI slave finite state machine status.
Definition: hal_spi_slave.h:511
hal_spi_slave_status_t hal_spi_slave_get_master_read_config(hal_spi_slave_port_t spi_port, uint32_t *address, uint32_t *length)
This function queries the address and length from the config read command sent by the SPI master...
The SPI slave was busy during the SPI slave API call.
Definition: hal_spi_slave.h:530
hal_spi_slave_running_status_t
SPI slave running status.
Definition: hal_spi_slave.h:491
SPI slave error, received continuous Configure Read command.
Definition: hal_spi_slave.h:516
SPI slave error, received Configure Read command after Configure Write command.
Definition: hal_spi_slave.h:517
hal_spi_slave_bit_order_t
SPI slave transaction bit order definition.
Definition: hal_platform.h:648
hal_spi_slave_status_t hal_spi_slave_init(hal_spi_slave_port_t spi_port, hal_spi_slave_config_t *spi_configure)
This function initializes the SPI slave and sets user defined common parameters such as timeout thres...
uint32_t timeout_threshold
The SPI slave timeout threshold setting.
Definition: hal_spi_slave.h:546
hal_spi_slave_status_t
SPI slave status.
Definition: hal_spi_slave.h:528
Enables send MISO data half SCLK cycle early.
Definition: hal_spi_slave.h:486
void(* hal_spi_slave_callback_t)(hal_spi_slave_transaction_status_t status, void *user_data)
This defines the callback function prototype.
Definition: hal_spi_slave.h:583
SPI slave error, received Read command after Configure Write command.
Definition: hal_spi_slave.h:521