Microchip® Advanced Software Framework

qs_spi_master_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...
 
#define SLAVE_SELECT_PIN   CONF_MASTER_SS_PIN
 [buf_length] [slave_select_pin] More...
 

Functions

static void callback_spi_master (struct spi_module *const module)
 [callback] More...
 
void configure_spi_master (void)
 [conf_callback] More...
 
void configure_spi_master_callbacks (void)
 [var] [setup] More...
 
int main (void)
 [configure_spi] More...
 

Variables

static uint8_t rd_buffer [BUF_LENGTH]
 
struct spi_slave_inst slave
 [dev_inst] [slave_dev_inst] More...
 
struct spi_module spi_master_instance
 [buffer] More...
 
volatile bool transrev_complete_spi_master = false
 [slave_dev_inst] [var] More...
 
static uint8_t wr_buffer [BUF_LENGTH]
 [slave_select_pin] [buffer] More...
 

#define BUF_LENGTH   20

[setup] [buf_length]

Referenced by main().

#define SLAVE_SELECT_PIN   CONF_MASTER_SS_PIN

[buf_length] [slave_select_pin]

Referenced by configure_spi_master().

static void callback_spi_master ( struct spi_module *const  module)
static

[callback]

[callback_var]

[callback_var]

References transrev_complete_spi_master.

Referenced by configure_spi_master_callbacks().

void configure_spi_master ( void  )

[conf_callback]

[configure_spi]

[config]

[config] [slave_config]

[slave_config]

[slave_conf_defaults]

[slave_conf_defaults] [ss_pin]

[ss_pin] [slave_init]

[slave_init]

[conf_defaults]

[conf_defaults] [mux_setting]

[mux_setting]

[init]

[init]

[enable]

[enable]

References spi_config::mux_setting, spi_config::pinmux_pad0, spi_config::pinmux_pad1, spi_config::pinmux_pad2, spi_config::pinmux_pad3, slave, SLAVE_SELECT_PIN, spi_attach_slave(), spi_enable(), spi_get_config_defaults(), spi_init(), spi_master_instance, spi_slave_inst_get_config_defaults(), and spi_slave_inst_config::ss_pin.

Referenced by main().

void configure_spi_master_callbacks ( void  )

[var] [setup]

[callback]

[conf_callback]

[reg_callback]

[reg_callback] [en_callback]

[en_callback]

References callback_spi_master(), SPI_CALLBACK_BUFFER_TRANSCEIVED, spi_enable_callback(), spi_master_instance, and spi_register_callback().

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] [inf_loop]

[select_slave]

[select_slave] [write and read]

[write and read] [wait]

[wait] [deselect_slave]

[deselect_slave]

[inf_loop] [main_use_case]

References BUF_LENGTH, configure_spi_master(), configure_spi_master_callbacks(), port_pin_get_input_level(), rd_buffer, slave, spi_master_instance, spi_select_slave(), spi_transceive_buffer_job(), system_init(), transrev_complete_spi_master, and wr_buffer.

uint8_t rd_buffer[BUF_LENGTH]
static

Referenced by main().

struct spi_module spi_master_instance
volatile bool transrev_complete_spi_master = false

[slave_dev_inst] [var]

Referenced by callback_spi_master(), and main().

uint8_t wr_buffer[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
}

[slave_select_pin] [buffer]

Referenced by main().