19.8.1.3.2 Workflow

  1. Select slave.
    spi_select_slave(&spi_master_instance, &slave, true);
    
  2. Write buffer to SPI slave.
    spi_write_buffer_wait(&spi_master_instance, buffer, BUF_LENGTH);
    
  3. Deselect slave.
    spi_select_slave(&spi_master_instance, &slave, false);
    
  4. Light up.
    port_pin_set_output_level(LED_0_PIN, LED0_ACTIVE);
    
  5. Infinite loop.
    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);
        }
    }