[HAL][SPI] Fix state change issue in Rx functions by validating parameters first
When using full-duplex SPI in master mode, the parameters of the Rx function are checked in the TxRx functions. However, the HAL_SPI_STATE_BUSY_RX state is set in the Rx function. Therefore, if the Rx function is called with invalid parameters, the TxRx function returns an error, leaving the SPI state stuck in HAL_SPI_STATE_BUSY_RX.
[HAL][SPI] Fix state change issue in Rx functions by validating parameters first
When using full-duplex SPI in master mode, the parameters of the Rx function are checked in the TxRx functions. However, the HAL_SPI_STATE_BUSY_RX state is set in the Rx function. Therefore, if the Rx function is called with invalid parameters, the TxRx function returns an error, leaving the SPI state stuck in HAL_SPI_STATE_BUSY_RX.
Fixes #17