19.8.3.3.1 Code

Add the following to your user application main().
while (true) {
    /* Infinite loop */
    if (!port_pin_get_input_level(BUTTON_0_PIN)) {
        spi_select_slave(&spi_master_instance, &slave, true);
        spi_transceive_buffer_job(&spi_master_instance, wr_buffer,rd_buffer,BUF_LENGTH);
        while (!transrev_complete_spi_master) {
        }
        transrev_complete_spi_master = false;
        spi_select_slave(&spi_master_instance, &slave, false);
    }
}