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 485 HAL_SPI_SLAVE_EARLY_MISO_DISABLE = 0,
486 HAL_SPI_SLAVE_EARLY_MISO_ENABLE = 1
487 } hal_spi_slave_early_miso_t;
492 HAL_SPI_SLAVE_BUSY = 0,
493 HAL_SPI_SLAVE_IDLE = 1
494 } hal_spi_slave_running_status_t;
512 HAL_SPI_SLAVE_FSM_SUCCESS_OPERATION = 0x00,
513 HAL_SPI_SLAVE_FSM_INVALID_OPERATION = 0x01,
514 HAL_SPI_SLAVE_FSM_ERROR_PWROFF_AFTER_CR = 0x02,
515 HAL_SPI_SLAVE_FSM_ERROR_PWROFF_AFTER_CW = 0x03,
516 HAL_SPI_SLAVE_FSM_ERROR_CONTINOUS_CR = 0x04,
517 HAL_SPI_SLAVE_FSM_ERROR_CR_AFTER_CW = 0x05,
518 HAL_SPI_SLAVE_FSM_ERROR_CONTINOUS_CW = 0x06,
519 HAL_SPI_SLAVE_FSM_ERROR_CW_AFTER_CR = 0x07,
520 HAL_SPI_SLAVE_FSM_ERROR_WRITE_AFTER_CR = 0x08,
521 HAL_SPI_SLAVE_FSM_ERROR_READ_AFTER_CW = 0x09
522 } hal_spi_slave_fsm_status_t;
543 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 546 uint32_t timeout_threshold;
547 hal_spi_slave_bit_order_t bit_order;
555 hal_spi_slave_fsm_status_t fsm_status;
556 hal_spi_slave_callback_event_t interrupt_status;
557 } hal_spi_slave_transaction_status_t;
573 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 596 #ifdef HAL_SPI_SLAVE_FEATURE_SW_CONTROL 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:524
hal_spi_slave_clock_phase_t phase
The SPI slave clock phase setting.
Definition: hal_spi_slave.h:562
Invalid SPI slave port number.
Definition: hal_spi_slave.h:531
An error occurred during the SPI slave API call.
Definition: hal_spi_slave.h:529
SPI slave configure.
Definition: hal_spi_slave.h:560
hal_spi_slave_clock_phase_t
SPI slave clock format definition.
Definition: hal_platform.h:531
Invalid parameter.
Definition: hal_spi_slave.h:532
hal_spi_slave_port_t
This enum defines the SPI slave port.
Definition: hal_platform.h:518
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_clock_polarity_t polarity
The SPI slave clock polarity setting.
Definition: hal_spi_slave.h:561
The SPI slave was busy during the SPI slave API call.
Definition: hal_spi_slave.h:530
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 including clock polar...
void(* hal_spi_slave_callback_t)(void *user_data)
This defines the callback function prototype.
Definition: hal_spi_slave.h:590
hal_spi_slave_status_t
SPI slave status.
Definition: hal_spi_slave.h:528