19.8.4.2.1 Code
Add the following to your user application main().
spi_read_buffer_job(&spi_slave_instance, buffer_rx, BUF_LENGTH, 0x00);
while
(!transfer_complete_spi_slave) {
/* Wait for transfer from master */
}
for
(uint8_t i = 0; i < BUF_LENGTH; i++) {
if
(buffer_rx[i] != buffer_expect[i]) {
result++;
}
}
while
(
true
) {
/* Infinite loop */
if
(result) {
port_pin_toggle_output_level(LED_0_PIN);
/* Add a short delay to see LED toggle */
volatile
uint32_t delay = 30000;
while
(delay--) {
}
}
else
{
port_pin_toggle_output_level(LED_0_PIN);
/* Add a short delay to see LED toggle */
volatile
uint32_t delay = 600000;
while
(delay--) {
}
}
}