// Put NSS low to start spi transaction
bsp_gpio_set_value( RADIO_NSS, 0 );
for( uint16_t i = 0; i < command_length; i++ )
{
bsp_spi_in_out( BSP_RADIO_SPI_ID, command[i] );
}
for( uint16_t i = 0; i < data_length; i++ )
{
bsp_spi_in_out( BSP_RADIO_SPI_ID, data[i] );
}
// Put NSS high as the spi transaction is finished
bsp_gpio_set_value( RADIO_NSS, 1 );
// 0x84 - SX1280_SET_SLEEP opcode. In sleep mode the radio dio is struck to 1 => do not test it
if( command[0] != 0x84 )
{
sx1280_hal_wait_on_busy( );
}