SAMV71 Xplained Ultra Software Package 1.3

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   ( 32 * BLOCK_SIZE )

Functions

 COMPILER_SECTION ("ramdisk_region")
void XDMAC_Handler (void)
 xDMA interrupt handler.
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]
uint32_t msdWriteTotal = 0
uint8_t msdRefresh = 0

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 132 of file main.c.

#define DRV_RAMDISK   0

Media index for different disks RAM disk

Definition at line 130 of file main.c.

#define DRV_SDMMC   1

SD card

Definition at line 131 of file main.c.

#define MAX_LUNS   2

Maximum number of LUNs which can be defined.

Definition at line 126 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 136 of file main.c.


Function Documentation

COMPILER_SECTION ( "ramdisk_region"   ) 

SD card pins instance.

Definition at line 138 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 448 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 219 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 229 of file main.c.

Here is the call graph for this function:


Variable Documentation

sMedia medias[MAX_LUNS]

Available media.

Definition at line 162 of file main.c.

uint8_t msdRefresh = 0

Delay TO event

Definition at line 188 of file main.c.

uint32_t msdWriteTotal = 0

Total data write to disk

Definition at line 185 of file main.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines