SAMV71 Xplained Ultra Software Package 1.4

main.c File Reference

#include "board.h"
#include "libstoragemedia.h"
#include <USBD_Config.h>
#include <CDCMSDDriver.h>
#include <CDCDSerial.h>
#include <MSDFunction.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

Go to the source code of this file.

Defines

#define DATAPACKETSIZE   CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN)
#define DATABUFFERSIZE   (DATAPACKETSIZE+2)
#define MAX_LUNS   1
#define DRV_RAMDISK   0
#define DRV_SDMMC   1
#define BLOCK_SIZE   512
#define MSD_BUFFER_SIZE   (12*BLOCK_SIZE)
#define RAMDISK_SIZE   128*1024
#define RAMDISK_BASE_ADDR   ((uint32_t)ramdisk_reserved)
#define MSD_REFRESH_DELAY   250
#define INPUT_DELAY   (2*250)

Functions

 COMPILER_SECTION ("ramdisk_region")
void USBDCallbacks_RequestReceived (const USBGenericRequest *request)
void CDCDSerial_ControlLineStateChanged (uint8_t DTR, uint8_t RTS)
uint8_t CDCDSerial_LineCodingIsToChange (CDCLineCoding *pLineCoding)
int main (void)

Detailed Description

Purpose

This file contains all the specific code for the usb_iad_cdc_msd project

Definition in file main.c.


Define Documentation

#define BLOCK_SIZE   512

Size of one block in bytes.

Definition at line 151 of file main.c.

#define DATABUFFERSIZE   (DATAPACKETSIZE+2)

Size in bytes of the buffer used for reading data from the USB & USART

Definition at line 142 of file main.c.

#define DATAPACKETSIZE   CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN)

Size in bytes of the packet used for reading data from USB

Definition at line 138 of file main.c.

#define DRV_RAMDISK   0

Media index for different disks RAM disk

Definition at line 147 of file main.c.

#define DRV_SDMMC   1

SD card

Definition at line 148 of file main.c.

#define MAX_LUNS   1

Maximum number of LUNs which can be defined.

Definition at line 145 of file main.c.

#define MSD_BUFFER_SIZE   (12*BLOCK_SIZE)

Size of the MSD IO buffer in bytes (6K, more the better).

Definition at line 154 of file main.c.

#define RAMDISK_SIZE   128*1024

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

Definition at line 157 of file main.c.


Function Documentation

COMPILER_SECTION ( "ramdisk_region"   ) 

Invoked when the configuration of the device changes. Parse used endpoints.

Parameters:
cfgnum New configuration number.

Definition at line 159 of file main.c.

Here is the call graph for this function:

int main ( void   ) 

Initializes drivers and start the USB CDCMSD device.

Definition at line 350 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:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines