19.8.2.2.2 Workflow
- Read data from SPI master.
while(spi_read_buffer_wait(&spi_slave_instance, buffer_rx, BUF_LENGTH,0x00) != STATUS_OK) {/* Wait for transfer from the master */} - Compare the received data with the transmitted data from SPI master.
for(uint8_t i = 0; i < BUF_LENGTH; i++) {if(buffer_rx[i] != buffer_expect[i]) {result++;}} - Infinite loop. If the data is matched, LED0 will flash slowly. Otherwise, LED will flash quickly.
while(true) {/* Infinite loop */if(result) {port_pin_toggle_output_level(LED_0_PIN);/* Add a short delay to see LED toggle */volatileuint32_t delay = 30000;while(delay--) {}}else{port_pin_toggle_output_level(LED_0_PIN);/* Add a short delay to see LED toggle */volatileuint32_t delay = 600000;while(delay--) {}}}
