Microchip® Advanced Software Framework

qs_spi_slave_callback.c File Reference

SAM SPI Quick Start.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>

Macros

#define BUF_LENGTH   20
 [setup] [buf_length] More...
 

Functions

void configure_spi_slave (void)
 [conf_callback] More...
 
void configure_spi_slave_callbacks (void)
 [dev_inst] [setup] More...
 
int main (void)
 [configure_spi] More...
 
static void spi_slave_callback (struct spi_module *const module)
 [callback] More...
 

Variables

static uint8_t buffer_expect [BUF_LENGTH]
 
static uint8_t buffer_rx [BUF_LENGTH] = {0x00,}
 [buf_length] More...
 
struct spi_module spi_slave_instance
 [var] More...
 
volatile bool transfer_complete_spi_slave = false
 [buffer] [var] More...
 

#define BUF_LENGTH   20

[setup] [buf_length]

Referenced by main().

void configure_spi_slave ( void  )

[conf_callback]

[dev_inst] [setup]

[configure_spi]

[config]

[config]

[conf_defaults]

[conf_defaults] [conf_spi_slave_instance]

[conf_spi_slave_instance] [conf_preload]

[conf_preload] [conf_format]

[conf_format] [mux_setting]

[mux_setting]

[init]

[init]

[enable]

[enable]

References spi_slave_config::frame_format, spi_config::mode, spi_config::mode_specific, spi_config::mux_setting, spi_config::pinmux_pad0, spi_config::pinmux_pad1, spi_config::pinmux_pad2, spi_config::pinmux_pad3, spi_slave_config::preload_enable, spi_config::slave, spi_enable(), SPI_FRAME_FORMAT_SPI_FRAME, spi_get_config_defaults(), spi_init(), SPI_MODE_SLAVE, and spi_slave_instance.

void configure_spi_slave_callbacks ( void  )

[dev_inst] [setup]

[callback]

[conf_callback]

[reg_callback]

[reg_callback] [en_callback]

[en_callback]

References SPI_CALLBACK_BUFFER_RECEIVED, spi_enable_callback(), spi_register_callback(), spi_slave_callback(), and spi_slave_instance.

Referenced by main().

int main ( void  )

[configure_spi]

[main_start]

[system_init]

[system_init]

[run_config]

[run_config] [run_callback_config]

[run_callback_config] [main_start]

[main_use_case] [read]

[read] [transf_complete]

[transf_complete] [compare]

[compare]

[inf_loop]

[inf_loop] [main_use_case]

References BUF_LENGTH, buffer_expect, buffer_rx, configure_spi_slave(), configure_spi_slave_callbacks(), delay, i, port_pin_toggle_output_level(), result, spi_read_buffer_job(), spi_slave_instance, system_init(), and transfer_complete_spi_slave.

static void spi_slave_callback ( struct spi_module *const  module)
static

[callback]

[callback_var]

[callback_var]

References transfer_complete_spi_slave.

Referenced by configure_spi_slave_callbacks().

uint8_t buffer_expect[BUF_LENGTH]
static
Initial value:
= {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13
}

Referenced by main().

uint8_t buffer_rx[BUF_LENGTH] = {0x00,}
static

[buf_length]

[buffer]

Referenced by main().

struct spi_module spi_slave_instance

[var]

[dev_inst]

volatile bool transfer_complete_spi_slave = false

[buffer] [var]

Referenced by main(), and spi_slave_callback().