The incomplete StandaloneProgrammer project now uses Host and Device Mass storage classes, so that program data can either be loaded onto the device's Dataflash storage, or read off an attached USB memory stick.

The USB target family and allowable USB mode tokens are now public and documented (USB_CAN_BE_*, USB_SERIES_*_AVR).

The SCSI_Request_Sense_Response_t and SCSI_Inquiry_Response_t type defines are now part of the Mass Storage Class driver common defines, rather than being defined in the Host mode Class driver section only.

The USB_MODE_HOST token is now defined even when host mode is not available.

Added missing CDC_Host_CreateBlockingStream() function code to the CDC Host Class driver.
This commit is contained in:
Dean Camera 2009-11-23 12:40:14 +00:00
parent 6e867f7d9b
commit aaa0bed556
23 changed files with 602 additions and 490 deletions

View file

@ -42,7 +42,8 @@
#include <avr/power.h>
#include <stdio.h>
#include "Descriptors.h"
#include "DiskDevice.h"
#include "DiskHost.h"
#include "Lib/SCSI.h"
#include "Lib/DataflashManager.h"
@ -50,11 +51,8 @@
#include "Lib/PetiteFATFs/pff.h"
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
@ -73,22 +71,15 @@
#define LEDMASK_USB_BUSY (LEDS_LED2)
/* External Variables: */
extern FILE USBSerialStream;
extern FILE DataflashStream;
extern FILE DiskStream;
extern FATFS DiskFATState;
/* Function Prototypes: */
#if defined(INCLUDE_FROM_STANDALONEPROG_C)
static int Dataflash_getchar(FILE* Stream);
static int Disk_getchar(FILE* Stream);
#endif
void SetupHardware(void);
void Programmer_Task(void);
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void);
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo);
#endif