Microchip® Advanced Software Framework

qs_i2c_slave_dma.c File Reference

SAM SERCOM I2C Slave with DMA Quick Start Guide.

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

#include <asf.h>

Macros

#define DATA_LENGTH   10
 [address] More...
 
#define SLAVE_ADDRESS   0x12
 [address] More...
 

Functions

void configure_dma_resource (struct dma_resource *resource)
 [configure_dac_channel] More...
 
void configure_i2c_slave (void)
 [module] More...
 
int main (void)
 
void setup_dma_descriptor (DmacDescriptor *descriptor)
 [config_dma_resource] More...
 

Variables

struct dma_resource i2c_dma_resource
 [initialize_i2c] More...
 
struct i2c_slave_module i2c_slave_instance
 [packet_data] More...
 
uint8_t read_buffer [DATA_LENGTH]
 
DmacDescriptor i2c_dma_descriptor SECTION_DMAC_DESCRIPTOR
 [dma_resource] More...
 

#define DATA_LENGTH   10

[address]

[packet_data]

Referenced by setup_dma_descriptor().

#define SLAVE_ADDRESS   0x12

[address]

static void configure_dma_resource ( struct dma_resource resource)

[configure_dac_channel]

[_transfer_done]

[config_dma_resource]

[dma_setup_1]

[dma_setup_1]

[dma_setup_2]

[dma_setup_2]

[dma_setup_3]

[dma_setup_3]

[dma_setup_4]

[dma_setup_4]

References dma_allocate(), dma_get_config_defaults(), DMA_TRIGGER_ACTION_BEAT, dma_resource_config::peripheral_trigger, and dma_resource_config::trigger_action.

void configure_i2c_slave ( void  )

[module]

[initialize_i2c]

[init_conf]

[init_conf]

[conf_changes]

[conf_changes]

[init_module]

[init_module]

[enable_module]

[enable_module]

int main ( void  )

[init] [config_i2c]

[config_i2c]

[config_dma]

[config_dma] [init]

[main] [wait_packet]

[wait_packet]

[clear_status]

[clear_status] [main]

References configure_dma_resource(), configure_i2c_slave(), dma_add_descriptor(), dma_start_transfer_job(), i2c_dma_resource, i2c_slave_dma_read_interrupt_status(), i2c_slave_dma_write_interrupt_status(), i2c_slave_instance, setup_dma_descriptor(), and system_init().

void setup_dma_descriptor ( DmacDescriptor *  descriptor)

struct dma_resource i2c_dma_resource

[initialize_i2c]

[dma_resource]

Referenced by main().

struct i2c_slave_module i2c_slave_instance

[packet_data]

[module]

uint8_t read_buffer[DATA_LENGTH]
DmacDescriptor i2c_dma_descriptor SECTION_DMAC_DESCRIPTOR