19.8.1.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_write_buffer_wait(&spi_master_instance, buffer, BUF_LENGTH);
        spi_select_slave(&spi_master_instance, &slave, false);
        port_pin_set_output_level(LED_0_PIN, LED0_ACTIVE);
    }
}