SAMV71 Xplained Ultra Software Package 1.5

main.c File Reference

#include "board.h"
#include "libsdmmc.h"
#include "../fatfs_config.h"
#include "Media.h"
#include "MEDSdcard.h"
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  ALIGN_FATFS

Defines

#define NB_MULTI_BLOCKS   5
#define NB_SPLIT_MULTI   4
#define TEST_BLOCK_START   (0)
#define TEST_BLOCK_END   SD_GetNumberBlocks(&sdDrv[bMciID])
#define TEST_BLOCK_SKIP   (100 * 1024 * 2)
#define NB_ERRORS   5
#define AllOCSIZE   4096
#define MAX_LUNS   1
#define ID_DRV   DRV_MMC
#define STR_ROOT_DIRECTORY   "0:"
#define DATA_SIZE   4096
#define TEST_PERFORMENCT_SIZE   (4*1024*1024)
#define ASSERT(condition,...)
#define READ_MULTI
#define WRITE_MULTI
 Define to test multi-write (SD_Write()) or single-write is used (SD_WriteBlocks()).
#define MMCT_ReadFun(pSd, blk, nbBlk, pData)   SD_ReadBlocks(pSd, blk, pData, nbBlk)
#define MMCT_WriteFun(pSd, blk, nbBlk, pData)   SD_WriteBlocks(pSd, blk, pData, nbBlk)

Functions

void HSMCI_Handler (void)
int main (void)
 hsmci_sdcard_fatfs Application entry point.

Variables

sMedia medias [MAX_LUNS]
sSdCard sdDrv [BOARD_NUM_MCI]
const char * FileName = "Basic.bin"
const char * FileNameReadMe = "ReadMe.txt"
const char * ReadMeText = "Samv7 FatFS example: Done!!"
uint8_t data [DATA_SIZE]

Detailed Description

Purpose

This file contains all the specific code for the hsmci_sdcard_fatfs example.

---------------------------------------------------------------------------- Headers ----------------------------------------------------------------------------

Definition in file main.c.


Define Documentation

#define AllOCSIZE   4096

Bytes per cluster, FS format is necessary to make it effective

Definition at line 133 of file main.c.

#define ASSERT (   condition,
  ... 
)
Value:
{ \
        if (!(condition)) { \
            printf("-F- ASSERT: "); \
            printf(__VA_ARGS__); \
        } \
    }
#define DATA_SIZE   4096

size of the file to write/read.minimum size 512 for erase operation

Definition at line 176 of file main.c.

#define MAX_LUNS   1

Maximum number of LUNs which can be defined. (Logical drive = physical drive = medium number)

Definition at line 140 of file main.c.

#define NB_ERRORS   5

Number of errors displayed

Definition at line 130 of file main.c.

#define NB_MULTI_BLOCKS   5

Maximum number of blocks read once

Definition at line 115 of file main.c.

#define NB_SPLIT_MULTI   4

Split R/W to 2, first R/W 4 blocks then remaining

Definition at line 118 of file main.c.

#define TEST_BLOCK_END   SD_GetNumberBlocks(&sdDrv[bMciID])

Test settings: end block address (total SD/MMC)

Definition at line 124 of file main.c.

#define TEST_BLOCK_SKIP   (100 * 1024 * 2)

Test settings: skip size when "skip" key pressed

Definition at line 127 of file main.c.

#define TEST_BLOCK_START   (0)

Test settings: start block address (0)

Definition at line 121 of file main.c.


Function Documentation

int main ( void   ) 

hsmci_sdcard_fatfs Application entry point.

Returns:
Unused (ANSI-C compatibility).

Definition at line 737 of file main.c.

Here is the call graph for this function:


Variable Documentation

USBInterfaceDescriptor data

Data interface descriptor.

Definition at line 178 of file main.c.

sMedia medias[MAX_LUNS]

Available media.

Definition at line 219 of file main.c.

sSdCard sdDrv[BOARD_NUM_MCI]

SDCard driver instance.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines