Microchip® Advanced Software Framework

sd_mmc_mci_example.c File Reference
#include <avr32/io.h>
#include "pm.h"
#include "gpio.h"
#include "intc.h"
#include "print_funcs.h"
#include "sd_mmc_mci.h"
#include "sd_mmc_mci_mem.h"
#include "cycle_counter.h"
#include "conf_sd_mmc_mci.h"

Macros

#define ALLOCATED_SECTORS   16
 
#define APPLI_CPU_SPEED   48000000
 Configuration file for the example. More...
 
#define APPLI_PBA_SPEED   48000000
 
#define BENCH_START_SECTOR   0x15000
 
#define BENCH_TIME_MS   3000
 
#define EXAMPLE_SD_SLOT   SD_SLOT_4BITS
 
#define PBB_HZ   pm_freq_param.pba_f
 

Functions

static void display_perf_bps (U32 bandwidth)
 Display results in bps. More...
 
static void init_hmatrix (void)
 Initializes the HSB bus matrix. More...
 
int main (void)
 Main function. Execution starts here. More...
 
static void sd_mmc_mci_resources_init (void)
 Initializes SD/MMC resources: GPIO, MCI and SD/MMC. More...
 
static bool test_sd_mmc_write (U8 pattern_id)
 

Variables

U8 buffer_in [SD_MMC_SECTOR_SIZE *ALLOCATED_SECTORS]
 
U8 buffer_saved [SD_MMC_SECTOR_SIZE]
 
pm_freq_param_t pm_freq_param
 

#define ALLOCATED_SECTORS   16

Referenced by main().

#define APPLI_CPU_SPEED   48000000

Configuration file for the example.

PBB clock frequency (Hz)

#define APPLI_PBA_SPEED   48000000
#define BENCH_START_SECTOR   0x15000

Referenced by main().

#define BENCH_TIME_MS   3000

Referenced by main().

#define EXAMPLE_SD_SLOT   SD_SLOT_4BITS
#define PBB_HZ   pm_freq_param.pba_f

static void display_perf_bps ( U32  bandwidth)
static

Display results in bps.

References CL_BLACK, CL_GREEN, print_dbg(), and print_dbg_ulong().

Referenced by main().

static void init_hmatrix ( void  )
static

Initializes the HSB bus matrix.

static void sd_mmc_mci_resources_init ( void  )
static

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

References pm_freq_param_t::cpu_f, EXAMPLE_SD_SLOT, gpio_enable_module(), PBB_HZ, and sd_mmc_mci_init().

Referenced by main().

static bool test_sd_mmc_write ( U8  pattern_id)
static

U8 buffer_saved[SD_MMC_SECTOR_SIZE]
pm_freq_param_t pm_freq_param
Initial value:
=
{
.cpu_f = APPLI_CPU_SPEED
, .pba_f = APPLI_PBA_SPEED
, .osc0_f = FOSC0
, .osc0_startup = OSC0_STARTUP
}
#define FOSC0
Definition: bsp-evk1104.c:26
#define APPLI_PBA_SPEED
Definition: sd_mmc_mci_example.c:101
#define APPLI_CPU_SPEED
Configuration file for the example.
Definition: sd_mmc_mci_example.c:100