Microchip® Advanced Software Framework

sd_mmc_spi_example.c File Reference
#include <avr32/io.h>
#include "compiler.h"
#include "board.h"
#include "power_clocks_lib.h"
#include "gpio.h"
#include "spi.h"
#include "conf_sd_mmc_spi.h"
#include "sd_mmc_spi.h"
#include "usart.h"
#include "print_funcs.h"
#include "pdca.h"
#include "intc.h"
#include "dummy.h"

Macros

#define AVR32_PDCA_CHANNEL_SPI_RX   0
 
#define AVR32_PDCA_CHANNEL_SPI_TX   1
 
#define AVR32_PDCA_CHANNEL_USED_RX   AVR32_PDCA_PID_SPI_RX
 
#define AVR32_PDCA_CHANNEL_USED_TX   AVR32_PDCA_PID_SPI_TX
 
#define BUFFERSIZE   64
 Number of bytes in the receive buffer when operating in slave mode. More...
 
#define PBA_HZ   FOSC0
 PBA clock frequency (Hz) More...
 

Functions

void local_pdca_init (void)
 Initialize PDCA (Peripheral DMA Controller A) resources for the SPI transfer and start a dummy transfer. More...
 
int main (void)
 Main function. Execution starts here. More...
 
static void pdca_int_handler (void)
 
static void sd_mmc_resources_init (void)
 Initializes SD/MMC resources: GPIO, SPI and SD/MMC. More...
 
void wait ()
 

Variables

const char dummy_data []
 
volatile bool end_of_transfer
 
volatile avr32_pdca_channel_t * pdca_channelrx
 
volatile avr32_pdca_channel_t * pdca_channeltx
 
volatile char ram_buffer [1000]
 

#define AVR32_PDCA_CHANNEL_SPI_RX   0
#define AVR32_PDCA_CHANNEL_SPI_TX   1
#define AVR32_PDCA_CHANNEL_USED_RX   AVR32_PDCA_PID_SPI_RX

Referenced by local_pdca_init().

#define AVR32_PDCA_CHANNEL_USED_TX   AVR32_PDCA_PID_SPI_TX

Referenced by local_pdca_init().

#define BUFFERSIZE   64

Number of bytes in the receive buffer when operating in slave mode.

#define PBA_HZ   FOSC0

PBA clock frequency (Hz)

Referenced by main(), and sd_mmc_resources_init().

void local_pdca_init ( void  )

Initialize PDCA (Peripheral DMA Controller A) resources for the SPI transfer and start a dummy transfer.

Enable pdca transfer interrupt when completed

References pdca_channel_options_t::addr, AVR32_PDCA_CHANNEL_SPI_RX, AVR32_PDCA_CHANNEL_SPI_TX, AVR32_PDCA_CHANNEL_USED_RX, AVR32_PDCA_CHANNEL_USED_TX, dummy_data, INTC_register_interrupt(), pdca_init_channel(), pdca_int_handler(), PDCA_TRANSFER_SIZE_BYTE, and ram_buffer.

Referenced by main().

void wait ( )

Referenced by pdca_int_handler().

const char dummy_data[]
Initial value:
=
# 104 "/Jenkins/workspace/check-IS-asf-main-build-doxygen-linux-idc/source/avr32/components/memory/sd_mmc/sd_mmc_spi/example/sd_mmc_spi_example.c" 2

Referenced by local_pdca_init(), and main().

volatile bool end_of_transfer

Referenced by main(), and pdca_int_handler().

volatile avr32_pdca_channel_t* pdca_channelrx

Referenced by main().

volatile avr32_pdca_channel_t* pdca_channeltx

Referenced by main().

volatile char ram_buffer[1000]

Referenced by local_pdca_init(), and main().