/* MSS_SPI_transfer_frame() See "mss_spi.h" for details of how to use this function.  */
uint32_t MSS_SPI_transfer_frame(mss_spi_instance_t *this_spi, uint32_t tx_bits)
/* MSS_SPI_transfer_frame() See "mss_spi.h" for details of how to use this function.  */
uint32_t MSS_SPI_transfer_frame(mss_spi_instance_t *this_spi, uint32_t tx_bits)
{
    volatile uint32_t dummy;
    ASSERT( (this_spi == &g_mss_spi0) || (this_spi == &g_mss_spi1) );
    ASSERT( this_spi->hw_reg_bit->CTRL_MASTER == MSS_SPI_MODE_MASTER );
    while ( this_spi->hw_reg_bit->STATUS_RX_RDY == 1U )
    {
        dummy = this_spi->hw_reg->RX_DATA;
        dummy = dummy;
    }
    this_spi->hw_reg->TX_DATA = tx_bits;
    while ( this_spi->hw_reg_bit->STATUS_TX_DONE == 0U )
    {
        ;
    }
    while ( this_spi->hw_reg_bit->STATUS_RX_RDY == 0U )
    {
        ;
    }
    return( this_spi->hw_reg->RX_DATA );
}