Atmel 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_SPI1_RX
 
#define AVR32_PDCA_CHANNEL_USED_TX   AVR32_PDCA_PID_SPI1_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_SPI1_RX

Referenced by local_pdca_init().

#define AVR32_PDCA_CHANNEL_USED_TX   AVR32_PDCA_PID_SPI1_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(), NULL, pdca_init_channel(), pdca_int_handler(), PDCA_TRANSFER_SIZE_BYTE, and ram_buffer.

Referenced by main().

static void sd_mmc_resources_init ( void  )
static

Initializes SD/MMC resources: GPIO, SPI and SD/MMC.

References gpio_enable_module(), PBA_HZ, spi_options_t::reg, SD_MMC_SPI_BITS, sd_mmc_spi_init(), SD_MMC_SPI_MASTER_SPEED, spi_enable(), spi_initMaster(), and spi_selectionMode().

Referenced by main().

void wait ( )

const char dummy_data[]
Initial value:
=
# 111 "/home/jenkins/work/workspace/asf-main-build-doxygen-linux/source/avr32/components/memory/sd_mmc/sd_mmc_spi/example/sd_mmc_spi_example.c" 2

Referenced by hmc5883l_calibrate(), local_pdca_init(), main(), and usart_spi_write_packet().

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().