SAMV71 Xplained Ultra Software Package 1.5

main.c File Reference

#include "board.h"
#include "libstoragemedia.h"
#include "libsdmmc.h"
#include "MSDDriver.h"
#include "MSDLun.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define DBG_SPEED_OFF
#define USBHS_PRI   3
#define HSMCI_PRI   2
#define XDMAC_PRI   1
#define MAX_LUNS   2
#define DRV_RAMDISK   0
#define DRV_SDMMC   1
#define DRV_NAND   2
#define RAMDISK_SIZE   128*1024
#define RAMDISK_BASE_ADDR   ((uint32_t)ramdisk_reserved)
#define BLOCK_SIZE   512
#define MSD_BUFFER_SIZE   (128 * BLOCK_SIZE)

Functions

 COMPILER_SECTION ("ramdisk_region")
 COMPILER_ALIGNED (32)
void HSMCI_Handler (void)
void USBDCallbacks_RequestReceived (const USBGenericRequest *request)
void USBDDriverCallbacks_ConfigurationChanged (unsigned char cfgnum)
int main (void)
 usb_massstorage Application entry point.

Variables

sMedia medias [MAX_LUNS]

Detailed Description

This file contains all the specific code for the usb_massstorage.

Definition in file main.c.


Define Documentation

#define DRV_NAND   2

Nand flash

Definition at line 134 of file main.c.

#define DRV_RAMDISK   0

Media index for different disks RAM disk

Definition at line 132 of file main.c.

#define DRV_SDMMC   1

SD card

Definition at line 133 of file main.c.

#define MAX_LUNS   2

Maximum number of LUNs which can be defined.

Definition at line 128 of file main.c.

#define RAMDISK_SIZE   128*1024

RamDisk size (in bytes) RamDisk size: 20K (WinXP can not format the disk if lower than 20K)

Definition at line 138 of file main.c.


Function Documentation

COMPILER_ALIGNED ( 32   ) 

SDCard driver instance. XDMA0 interrupt handler.

Definition at line 177 of file main.c.

Here is the call graph for this function:

COMPILER_SECTION ( "ramdisk_region"   ) 

SD card pins instance.

Definition at line 140 of file main.c.

int main ( void   ) 

usb_massstorage Application entry point.

Configures UART, Configures TC0, USB MSD Driver and run it.

Returns:
Unused (ANSI-C compatibility).

Definition at line 460 of file main.c.

Here is the call graph for this function:

void USBDCallbacks_RequestReceived ( const USBGenericRequest request  ) 

Invoked when a new SETUP request is received from the host. Forwards the request to the Mass Storage device driver handler function.

Parameters:
request Pointer to a USBGenericRequest instance.

Definition at line 222 of file main.c.

Here is the call graph for this function:

void USBDDriverCallbacks_ConfigurationChanged ( unsigned char  cfgnum  ) 

Invoked when the configuration of the device changes. Resets the mass storage driver.

Parameters:
cfgnum New configuration number.

Definition at line 232 of file main.c.

Here is the call graph for this function:


Variable Documentation

sMedia medias[MAX_LUNS]

Available media.

Definition at line 165 of file main.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines