Updated firmware for PCB Revision 3.0
authorMichael McMaster <michael@codesrc.com>
Sat, 26 Oct 2013 14:21:42 +0000 (00:21 +1000)
committerMichael McMaster <michael@codesrc.com>
Sat, 26 Oct 2013 14:21:42 +0000 (00:21 +1000)
- A USB Bootloader is now used. Use either the bootloader host supplied
with PSoC Creator 3.0, or else the standalone app included with
Cypress AN73503. You have 2 seconds between connecting the USB cable
and hitting the "program" button.
- The bootloaderhost program included in this repository doesn't quite
work yet. When functional it should simplify firmware updates on Linux
and Mac OSX
- Fixed an error in the parts spreadsheet which had a 22k resistor for
USB termination instead of a 22 Ohm resistor.
- Updated parts spreadsheet with part number of PSoC actually used
(CY8C5267AXI-LP051).

342 files changed:
.gitmodules [new file with mode: 0644]
STATUS
parts.ods
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Cm3Iar.icf
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Cm3RealView.scat
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm_aliases.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp_aliases.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_audio.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_audio.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_boot.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.inf [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cls.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_descr.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_drv.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_episr.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_hid.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_hid.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_midi.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_midi.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_pm.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_pvt.h [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_std.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_vnd.c [new file with mode: 0644]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cm3gcc.ld
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/config.hex
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cybootloader.c [new file with mode: 0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cybootloader.icf [new file with mode: 0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydevice.h [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydevice_trm.h [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydevicegnu.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydevicegnu_trm.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydeviceiar.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydeviceiar_trm.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydevicerv.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cydevicerv_trm.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cyfitter.h [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cyfitter_cfg.c [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cyfittergnu.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cyfitteriar.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cyfitterrv.inc [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/cymetadata.c [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/eeprom.hex [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/project.h
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/protect.hex
software/SCSI2SD/SCSI2SD.cydsn/SCSI2SD.cycdx [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/SCSI2SD.cydwr
software/SCSI2SD/SCSI2SD.cydsn/SCSI2SD.cyfit [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/SCSI2SD.cyprj
software/SCSI2SD/SCSI2SD.cydsn/SCSI2SD.svd [changed mode: 0644->0755]
software/SCSI2SD/SCSI2SD.cydsn/TopDesign/TopDesign.cysch
software/SCSI2SD/SCSI2SD.cydsn/config.c
software/SCSI2SD/SCSI2SD.cydsn/config.h
software/SCSI2SD/SCSI2SD.cydsn/disk.c
software/SCSI2SD/SCSI2SD.cydsn/loopback.c
software/SCSI2SD/SCSI2SD.cydsn/main.c
software/SCSI2SD/SCSI2SD.cydsn/scsi.c
software/SCSI2SD/SCSI2SD.cydsn/scsiPhy.c
software/SCSI2SD/SCSI2SD.cydsn/scsiPhy.h
software/SCSI2SD/SCSI2SD.cydsn/scsiTarget/scsiTarget.v
software/SCSI2SD/SCSI2SD.cydsn/sd.c
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/.deps/ARM_C_FILE.P [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/.deps/C_FILE.P [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/.deps/GNU_ARM_ASM_FILE.P [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/BL.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/BL.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/Cm3Start.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/Cm3Start.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyBootAsmGnu.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyBootAsmGnu.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyDmac.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyDmac.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyFlash.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyFlash.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyLib.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CyLib.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CySpc.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/CySpc.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_Dm.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_Dm.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_Dp.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_Dp.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_audio.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_audio.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_boot.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_boot.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_cdc.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_cdc.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_cls.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_cls.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_descr.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_descr.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_drv.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_drv.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_episr.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_episr.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_hid.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_hid.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_midi.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_midi.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_pm.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_pm.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_std.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_std.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_vnd.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USBFS_vnd.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USB_Bootloader-ARM_GCC_473-Release-BUILD.log [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USB_Bootloader-ARM_GCC_473-Release-REBUILD.log [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USB_Bootloader.a [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USB_Bootloader.elf [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USB_Bootloader.hex [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/USB_Bootloader.map [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cyPm.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cyPm.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cyfitter_cfg.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cyfitter_cfg.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cymetadata.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cymetadata.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cyutils.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/cyutils.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/library.deps [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/main.lst [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/CortexM3/ARM_GCC_473/Release/main.o [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/BL.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/BL.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/BL_PVT.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/Cm3Iar.icf [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/Cm3RealView.scat [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/Cm3Start.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyBootAsmGnu.s [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyBootAsmIar.s [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyBootAsmRv.s [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyDmac.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyDmac.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyFlash.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyFlash.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyLib.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CyLib.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CySpc.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/CySpc.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/SCSI_Out_DBx_aliases.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/SCSI_Out_aliases.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_Dm.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_Dm.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_Dm_aliases.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_Dp.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_Dp.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_Dp_aliases.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_audio.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_audio.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_boot.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_cdc.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_cdc.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_cdc.inf [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_cls.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_descr.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_drv.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_episr.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_hid.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_hid.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_midi.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_midi.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_pm.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_pvt.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_std.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/USBFS_vnd.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cm3gcc.ld [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/core_cm3.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/core_cm3_psoc5.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/core_cmFunc.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/core_cmInstr.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyPm.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyPm.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydevice.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydevice_trm.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydevicegnu.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydevicegnu_trm.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydeviceiar.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydeviceiar_trm.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydevicerv.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydevicerv_trm.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cydisabledsheets.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyfitter.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyfitter_cfg.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyfitter_cfg.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyfittergnu.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyfitteriar.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyfitterrv.inc [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cymetadata.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cypins.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cytypes.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/cyutils.c [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/eeprom.hex [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/project.h [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoC5/protect.hex [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/Generated_Source/PSoCCreatorExportIDE.xml [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/TopDesign/TopDesign.cysch [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.cycdx [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.cydwr [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.cyfit [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.cyprj [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.cyprj.Micha_000 [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.cyversion [new file with mode: 0644]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.rpt [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader.svd [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/USB_Bootloader_timing.html [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/BL.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/BL.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/BL_PVT.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/Cm3Iar.icf [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/Cm3RealView.scat [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/Cm3Start.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyBootAsmGnu.s [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyBootAsmIar.s [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyBootAsmRv.s [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyDmac.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyDmac.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyFlash.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyFlash.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyLib.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CyLib.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CySpc.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/CySpc.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/PSoC5_PSoC5LP_100-TQFP.xml [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/SCSI_Out_DBx_aliases.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/SCSI_Out_aliases.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_Dm.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_Dm.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_Dm_aliases.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_Dp.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_Dp.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_Dp_aliases.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_audio.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_audio.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_boot.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_cdc.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_cdc.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_cdc.inf [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_cls.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_descr.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_drv.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_episr.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_hid.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_hid.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_midi.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_midi.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_pm.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_pvt.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_std.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USBFS_vnd.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.bvf [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.ctl [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.cycdx [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.cyfit [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.dsf [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.pci [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.pco [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.plc_log [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.route [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.rpt [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.rt_log [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.sdc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.sdf [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.svd [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.tr [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.v [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.vh2 [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader.wde [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_p.lib [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_p.pco [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_p.vh2 [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_r.lib [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_r.vh2 [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_t.lib [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_t.vh2 [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_timing.html [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/USB_Bootloader_u.sdc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/bitstream.txt [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cm3gcc.ld [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/core_cm3.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/core_cm3_psoc5.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/core_cmFunc.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/core_cmInstr.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyPm.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyPm.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydevice.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydevice_trm.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydevicegnu.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydevicegnu_trm.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydeviceiar.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydeviceiar_trm.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydevicerv.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydevicerv_trm.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cydisabledsheets.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyfitter.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyfitter_cfg.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyfitter_cfg.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyfittergnu.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyfitteriar.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyfitterrv.inc [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cymetadata.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cypins.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cytypes.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/cyutils.c [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/device.lib [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/eeprom.hex [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/elab_dependencies.txt [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/generated_files.txt [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/lcpsoc3/index [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/liberty_reader.log [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/placer.log [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/project.h [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/protect.hex [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/codegentemp/warp_dependencies.txt [new file with mode: 0755]
software/SCSI2SD/USB_Bootloader.cydsn/main.c [new file with mode: 0755]
software/bootloaderhost/Makefile [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_api.c [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_api.h [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_api2.c [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_api2.h [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_command.c [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_command.h [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_parse.c [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_parse.h [new file with mode: 0644]
software/bootloaderhost/cybootloaderutils/cybtldr_utils.h [new file with mode: 0644]
software/bootloaderhost/hidapi [new submodule]
software/bootloaderhost/main.c [new file with mode: 0644]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..2468f79
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "software/bootloaderhost/hidapi"]
+       path = software/bootloaderhost/hidapi
+       url = git://github.com/signal11/hidapi.git
diff --git a/STATUS b/STATUS
index ab682ae..03bc964 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,13 +1,8 @@
-- Software has not been updated for PCB rev 3.0. In particular, most of the pin
-assignments are incorrect.
-
-- USB bootloader is not implemented yet.
-
-- Configuration options cannot be set via USB.
+- Configuration options cannot be set via USB. Must use the USB bootloader to
+       load a new firmware instead.
        - SCSI ID hardcoded to 0
        - Partity checking is on
        - Unit Attention Condition is off
-       - SPI overclock to 32MHz off.
 
 - DMA is not used for SPI transfers
 - Parity checking not implemented for the PSoC Datapath implementation
index bdd78dc..ec09c76 100644 (file)
Binary files a/parts.ods and b/parts.ods differ
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.c
new file mode 100644 (file)
index 0000000..529413c
--- /dev/null
@@ -0,0 +1,84 @@
+/*******************************************************************************\r
+* File Name: Bootloadable_1.c\r
+* Version 1.20\r
+*\r
+*  Description:\r
+*   Provides an API for the Bootloadable application. The API includes a\r
+*   single function for starting bootloader.\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "Bootloadable_1.h"\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: Bootloadable_1_Load\r
+********************************************************************************\r
+* Summary:\r
+*  Begins the bootloading algorithm, downloading a new ACD image from the host.\r
+*\r
+* Parameters:\r
+*  None\r
+*\r
+* Returns:\r
+*  This method will never return. It will load a new application and reset\r
+*  the device.\r
+*\r
+*******************************************************************************/\r
+void Bootloadable_1_Load(void) \r
+{\r
+    /* Schedule Bootloader to start after reset */\r
+    Bootloadable_1_SET_RUN_TYPE(Bootloadable_1_START_BTLDR);\r
+\r
+    CySoftwareReset();\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: Bootloadable_1_SetFlashByte\r
+********************************************************************************\r
+* Summary:\r
+*  Sets byte at specified address in Flash.\r
+*\r
+* Parameters:\r
+*  None\r
+*\r
+* Returns:\r
+*  None\r
+*\r
+*******************************************************************************/\r
+void Bootloadable_1_SetFlashByte(uint32 address, uint8 runType) \r
+{\r
+    uint32 flsAddr = address - CYDEV_FLASH_BASE;\r
+    uint8 rowData[CYDEV_FLS_ROW_SIZE];\r
+\r
+    #if !(CY_PSOC4)\r
+        uint8 arrayId = (uint8)(flsAddr / CYDEV_FLS_SECTOR_SIZE);\r
+    #endif  /* !(CY_PSOC4) */\r
+\r
+    uint16 rowNum = (uint16)((flsAddr % CYDEV_FLS_SECTOR_SIZE) / CYDEV_FLS_ROW_SIZE);\r
+    uint32 baseAddr = address - (address % CYDEV_FLS_ROW_SIZE);\r
+    uint16 idx;\r
+\r
+\r
+    for (idx = 0u; idx < CYDEV_FLS_ROW_SIZE; idx++)\r
+    {\r
+        rowData[idx] = Bootloadable_1_GET_CODE_DATA(baseAddr + idx);\r
+    }\r
+    rowData[address % CYDEV_FLS_ROW_SIZE] = runType;\r
+\r
+\r
+    #if(CY_PSOC4)\r
+        (void) CySysFlashWriteRow((uint32)rowNum, rowData);\r
+    #else\r
+        (void) CyWriteRowData(arrayId, rowNum, rowData);\r
+    #endif  /* (CY_PSOC4) */\r
+}\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.h
new file mode 100644 (file)
index 0000000..d760f96
--- /dev/null
@@ -0,0 +1,155 @@
+/*******************************************************************************\r
+* File Name: Bootloadable_1.h\r
+* Version 1.20\r
+*\r
+*  Description:\r
+*   Provides an API for the Bootloadable application. The API includes a\r
+*   single function for starting bootloader.\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+********************************************************************************/\r
+\r
+\r
+#ifndef CY_BOOTLOADABLE_Bootloadable_1_H\r
+#define CY_BOOTLOADABLE_Bootloadable_1_H\r
+\r
+#include "cydevice_trm.h"\r
+#include "CyFlash.h"\r
+\r
+\r
+/* Check to see if required defines such as CY_PSOC5LP are available */\r
+/* They are defined starting with cy_boot v3.0 */\r
+#if !defined (CY_PSOC5LP)\r
+    #error Component Bootloadable_v1_20 requires cy_boot v3.0 or later\r
+#endif /* !defined (CY_PSOC5LP) */\r
+\r
+\r
+#ifndef CYDEV_FLASH_BASE\r
+    #define CYDEV_FLASH_BASE                            CYDEV_FLS_BASE\r
+    #define CYDEV_FLASH_SIZE                            CYDEV_FLS_SIZE\r
+#endif /* CYDEV_FLASH_BASE */\r
+\r
+#if(CY_PSOC3)\r
+    #define Bootloadable_1_GET_CODE_DATA(idx)         (*((uint8  CYCODE *) (idx)))\r
+#else\r
+    #define Bootloadable_1_GET_CODE_DATA(idx)         (*((uint8  *)(CYDEV_FLASH_BASE + (idx))))\r
+#endif /* (CY_PSOC3) */\r
+\r
+\r
+/*******************************************************************************\r
+* This variable is used by Bootloader/Bootloadable components to schedule what\r
+* application will be started after software reset.\r
+*******************************************************************************/\r
+#if (CY_PSOC4)\r
+    #if defined(__ARMCC_VERSION)\r
+        __attribute__ ((section(".bootloaderruntype"), zero_init))\r
+    #elif defined (__GNUC__)\r
+        __attribute__ ((section(".bootloaderruntype")))\r
+   #elif defined (__ICCARM__)\r
+        #pragma location=".bootloaderruntype"\r
+    #endif  /* defined(__ARMCC_VERSION) */\r
+    extern volatile uint32 cyBtldrRunType;\r
+#endif  /* (CY_PSOC4) */\r
+\r
+\r
+/*******************************************************************************\r
+* Get the reason of the device reset\r
+*******************************************************************************/\r
+#if(CY_PSOC4)\r
+    #define Bootloadable_1_RES_CAUSE_RESET_SOFT   (0x10u)\r
+    #define Bootloadable_1_GET_RUN_TYPE           \\r
+                        (((CY_GET_REG32(CYREG_RES_CAUSE) & Bootloadable_1_RES_CAUSE_RESET_SOFT) > 0u) \\r
+                            ? (cyBtldrRunType) \\r
+                            : 0u)\r
+#else\r
+    #define Bootloadable_1_GET_RUN_TYPE           (CY_GET_REG8(CYREG_RESET_SR0) & \\r
+                                                    (Bootloadable_1_START_BTLDR | Bootloadable_1_START_APP))\r
+#endif  /* (CY_PSOC4) */\r
+\r
+\r
+/*******************************************************************************\r
+* Schedule Bootloader/Bootloadable to be run after software reset\r
+*******************************************************************************/\r
+#if(CY_PSOC4)\r
+    #define Bootloadable_1_SET_RUN_TYPE(x)        (cyBtldrRunType = (x))\r
+#else\r
+    #define Bootloadable_1_SET_RUN_TYPE(x)        CY_SET_REG8(CYREG_RESET_SR0, (x))\r
+#endif  /* (CY_PSOC4) */\r
+\r
+\r
+\r
+/***************************************\r
+*     Function Prototypes\r
+***************************************/\r
+extern void Bootloadable_1_Load(void) ;\r
+\r
+\r
+/*******************************************************************************\r
+* Following code are OBSOLETE and must not be used starting from version 1.10\r
+*******************************************************************************/\r
+#define CYBTDLR_SET_RUN_TYPE(x)     Bootloadable_1_SET_RUN_TYPE(x)\r
+\r
+\r
+/*******************************************************************************\r
+* Following code are OBSOLETE and must not be used starting from version 1.20\r
+*******************************************************************************/\r
+#define Bootloadable_1_START_APP                      (0x80u)\r
+#define Bootloadable_1_START_BTLDR                    (0x40u)\r
+#define Bootloadable_1_META_DATA_SIZE                 (64u)\r
+#define Bootloadable_1_META_APP_CHECKSUM_OFFSET       (0u)\r
+\r
+#if(CY_PSOC3)\r
+\r
+    #define Bootloadable_1_APP_ADDRESS                    uint16\r
+    #define Bootloadable_1_GET_CODE_WORD(idx)             (*((uint32 CYCODE *) (idx)))\r
+\r
+    /* Offset by 2 from 32 bit start because only need 16 bits */\r
+    #define Bootloadable_1_META_APP_ADDR_OFFSET           (3u)\r
+    #define Bootloadable_1_META_APP_BL_LAST_ROW_OFFSET    (7u)\r
+    #define Bootloadable_1_META_APP_BYTE_LEN_OFFSET       (11u)\r
+    #define Bootloadable_1_META_APP_RUN_TYPE_OFFSET       (15u)\r
+\r
+#else\r
+\r
+    #define Bootloadable_1_APP_ADDRESS                    uint32\r
+    #define Bootloadable_1_GET_CODE_WORD(idx)             (*((uint32 *)(CYDEV_FLASH_BASE + (idx))))\r
+\r
+    #define Bootloadable_1_META_APP_ADDR_OFFSET           (1u)\r
+    #define Bootloadable_1_META_APP_BL_LAST_ROW_OFFSET    (5u)\r
+    #define Bootloadable_1_META_APP_BYTE_LEN_OFFSET       (9u)\r
+    #define Bootloadable_1_META_APP_RUN_TYPE_OFFSET       (13u)\r
+\r
+#endif /* (CY_PSOC3) */\r
+\r
+#define Bootloadable_1_META_APP_ACTIVE_OFFSET             (16u)\r
+#define Bootloadable_1_META_APP_VERIFIED_OFFSET           (17u)\r
+\r
+#define Bootloadable_1_META_APP_BL_BUILD_VER_OFFSET       (18u)\r
+#define Bootloadable_1_META_APP_ID_OFFSET                 (20u)\r
+#define Bootloadable_1_META_APP_VER_OFFSET                (22u)\r
+#define Bootloadable_1_META_APP_CUST_ID_OFFSET            (24u)\r
+\r
+#define Bootloadable_1_SetFlashRunType(runType)           \\r
+                        Bootloadable_1_SetFlashByte(Bootloadable_1_MD_APP_RUN_ADDR(0), (runType))\r
+\r
+void Bootloadable_1_SetFlashByte(uint32 address, uint8 runType) ;\r
+\r
+#if(CY_PSOC4)\r
+    #define Bootloadable_1_SOFTWARE_RESET         CY_SET_REG32(CYREG_CM0_AIRCR, 0x05FA0004u)\r
+#else\r
+    #define Bootloadable_1_SOFTWARE_RESET         CY_SET_REG8(CYREG_RESET_CR2, 0x01u)\r
+#endif  /* (CY_PSOC4) */\r
+\r
+#if(CY_PSOC4)\r
+    extern uint8 appRunType;\r
+#endif  /* (CY_PSOC4) */\r
+\r
+\r
+#endif /* CY_BOOTLOADABLE_Bootloadable_1_H */\r
+\r
+\r
+/* [] END OF FILE */\r
index 0cda8fb..7d0b80b 100644 (file)
@@ -5,9 +5,9 @@
 define symbol __ICFEDIT_intvec_start__ = 0x00000000;\r
 /*-Memory Regions-*/\r
 define symbol __ICFEDIT_region_ROM_start__ = 0x0;\r
-define symbol __ICFEDIT_region_ROM_end__   = 262144 - 1;\r
-define symbol __ICFEDIT_region_RAM_start__ = 0x20000000 - (65536 / 2);\r
-define symbol __ICFEDIT_region_RAM_end__   = 0x20000000 + (65536 / 2) - 1;\r
+define symbol __ICFEDIT_region_ROM_end__   = 131072 - 1;\r
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000000 - (32768 / 2);\r
+define symbol __ICFEDIT_region_RAM_end__   = 0x20000000 + (32768 / 2) - 1;\r
 /*-Sizes-*/\r
 define symbol __ICFEDIT_size_cstack__ = 0x4000;\r
 define symbol __ICFEDIT_size_heap__   = 0x1000;\r
@@ -15,19 +15,19 @@ define symbol __ICFEDIT_size_heap__   = 0x1000;
 \r
 \r
 /******** Definitions ********/\r
-define symbol CY_APPL_LOADABLE  = 0;\r
+define symbol CY_APPL_LOADABLE  = 1;\r
 define symbol CY_APPL_LOADER    = 0;\r
 define symbol CY_APPL_NUM       = 1;\r
 define symbol CY_APPL_MAX       = 1;\r
 define symbol CY_METADATA_SIZE  = 64;\r
-define symbol CY_EE_IN_BTLDR    = 0x0;\r
+define symbol CY_EE_IN_BTLDR    = 0x00;\r
 define symbol CY_EE_SIZE        = 2048;\r
-\r
+include "cybootloader.icf";\r
 if (!CY_APPL_LOADABLE) {\r
     define symbol CYDEV_BTLDR_SIZE = 0;\r
 }\r
 \r
-define symbol CY_FLASH_SIZE     = 262144;\r
+define symbol CY_FLASH_SIZE     = 131072;\r
 define symbol CY_APPL_ORIGIN    = 0; \r
 define symbol CY_FLASH_ROW_SIZE = 256;\r
 define symbol CY_ECC_ROW_SIZE   = 32;\r
index 3f58d9b..db96f5f 100644 (file)
@@ -32,7 +32,7 @@
 ;********************************************************************************/\r
 #include "cyfitter.h"\r
 \r
-#define CY_FLASH_SIZE       262144\r
+#define CY_FLASH_SIZE       131072\r
 #define CY_APPL_ORIGIN      0\r
 #define CY_FLASH_ROW_SIZE   256\r
 #define CY_ECC_ROW_SIZE     32\r
@@ -44,7 +44,7 @@
 #if (CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_LOADABLE)\r
     #define CY_APPL_NUM     1\r
     #define CY_APPL_MAX     1\r
-    #define CY_EE_IN_BTLDR  \r
+    #define CY_EE_IN_BTLDR  0\r
 \r
     #if CY_APPL_ORIGIN\r
         #define APPL1_START     CY_APPL_ORIGIN\r
@@ -97,7 +97,7 @@ APPLICATION APPL_START (CY_FLASH_SIZE - APPL_START)
         * (+RO)\r
     }\r
 \r
-    ISRVECTORS (0x20000000 - (65536 / 2)) UNINIT\r
+    ISRVECTORS (0x20000000 - (32768 / 2)) UNINIT\r
     {\r
         * (.ramvectors)\r
     }\r
@@ -112,11 +112,11 @@ APPLICATION APPL_START (CY_FLASH_SIZE - APPL_START)
         .ANY (+RW, +ZI)\r
     }\r
 \r
-    ARM_LIB_HEAP (0x20000000 + (65536 / 2) - 0x1000 - 0x4000) EMPTY 0x1000\r
+    ARM_LIB_HEAP (0x20000000 + (32768 / 2) - 0x1000 - 0x4000) EMPTY 0x1000\r
     {\r
     }\r
 \r
-    ARM_LIB_STACK (0x20000000 + (65536 / 2)) EMPTY -0x4000\r
+    ARM_LIB_STACK (0x20000000 + (32768 / 2)) EMPTY -0x4000\r
     {\r
     }\r
 }\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1.c
new file mode 100644 (file)
index 0000000..61d6b01
--- /dev/null
@@ -0,0 +1,1335 @@
+/*******************************************************************************\r
+* File Name: USBFS_1.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  API for USBFS Component.\r
+*\r
+* Note:\r
+*  Many of the functions use endpoint number.  RAM arrays are sized with 9\r
+*  elements so they are indexed directly by epNumber.  The SIE and ARB\r
+*  registers are indexed by variations of epNumber - 1.\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include <CyDmac.h>\r
+#include "USBFS_1.h"\r
+#include "USBFS_1_pvt.h"\r
+#include "USBFS_1_hid.h"\r
+#if(USBFS_1_DMA1_REMOVE == 0u)\r
+    #include "USBFS_1_ep1_dma.h"\r
+#endif   /* End USBFS_1_DMA1_REMOVE */\r
+#if(USBFS_1_DMA2_REMOVE == 0u)\r
+    #include "USBFS_1_ep2_dma.h"\r
+#endif   /* End USBFS_1_DMA2_REMOVE */\r
+#if(USBFS_1_DMA3_REMOVE == 0u)\r
+    #include "USBFS_1_ep3_dma.h"\r
+#endif   /* End USBFS_1_DMA3_REMOVE */\r
+#if(USBFS_1_DMA4_REMOVE == 0u)\r
+    #include "USBFS_1_ep4_dma.h"\r
+#endif   /* End USBFS_1_DMA4_REMOVE */\r
+#if(USBFS_1_DMA5_REMOVE == 0u)\r
+    #include "USBFS_1_ep5_dma.h"\r
+#endif   /* End USBFS_1_DMA5_REMOVE */\r
+#if(USBFS_1_DMA6_REMOVE == 0u)\r
+    #include "USBFS_1_ep6_dma.h"\r
+#endif   /* End USBFS_1_DMA6_REMOVE */\r
+#if(USBFS_1_DMA7_REMOVE == 0u)\r
+    #include "USBFS_1_ep7_dma.h"\r
+#endif   /* End USBFS_1_DMA7_REMOVE */\r
+#if(USBFS_1_DMA8_REMOVE == 0u)\r
+    #include "USBFS_1_ep8_dma.h"\r
+#endif   /* End USBFS_1_DMA8_REMOVE */\r
+\r
+\r
+/***************************************\r
+* Global data allocation\r
+***************************************/\r
+\r
+uint8 USBFS_1_initVar = 0u;\r
+#if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+    uint8 USBFS_1_DmaChan[USBFS_1_MAX_EP];\r
+    uint8 USBFS_1_DmaTd[USBFS_1_MAX_EP];\r
+#endif /* End USBFS_1_EP_MM */\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Start\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This function initialize the USB SIE, arbiter and the\r
+*  endpoint APIs, including setting the D+ Pullup\r
+*\r
+* Parameters:\r
+*  device: Contains the device number of the desired device descriptor.\r
+*          The device number can be found in the Device Descriptor Tab of\r
+*          "Configure" dialog, under the settings of desired Device Descriptor,\r
+*          in the "Device Number" field.\r
+*  mode: The operating voltage. This determines whether the voltage regulator\r
+*        is enabled for 5V operation or if pass through mode is used for 3.3V\r
+*        operation. Symbolic names and their associated values are given in the\r
+*        following table.\r
+*       USBFS_1_3V_OPERATION - Disable voltage regulator and pass-thru\r
+*                                       Vcc for pull-up\r
+*       USBFS_1_5V_OPERATION - Enable voltage regulator and use\r
+*                                       regulator for pull-up\r
+*       USBFS_1_DWR_VDDD_OPERATION - Enable or Disable voltage\r
+*                         regulator depend on Vddd Voltage configuration in DWR.\r
+*\r
+* Return:\r
+*   None.\r
+*\r
+* Global variables:\r
+*  The USBFS_1_intiVar variable is used to indicate initial\r
+*  configuration of this component. The variable is initialized to zero (0u)\r
+*  and set to one (1u) the first time USBFS_1_Start() is called.\r
+*  This allows for component Re-Start without unnecessary re-initialization\r
+*  in all subsequent calls to the USBFS_1_Start() routine.\r
+*  If re-initialization of the component is required the variable should be set\r
+*  to zero before call of UART_Start() routine, or the user may call\r
+*  USBFS_1_Init() and USBFS_1_InitComponent() as done\r
+*  in the USBFS_1_Start() routine.\r
+*\r
+* Side Effects:\r
+*   This function will reset all communication states to default.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_Start(uint8 device, uint8 mode) \r
+{\r
+    /* If not Initialized then initialize all required hardware and software */\r
+    if(USBFS_1_initVar == 0u)\r
+    {\r
+        USBFS_1_Init();\r
+        USBFS_1_initVar = 1u;\r
+    }\r
+    USBFS_1_InitComponent(device, mode);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Init\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Initialize component's hardware. Usually called in USBFS_1_Start().\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_Init(void) \r
+{\r
+    uint8 enableInterrupts;\r
+    #if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+        uint16 i;\r
+    #endif   /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+    enableInterrupts = CyEnterCriticalSection();\r
+\r
+    /* Enable USB block  */\r
+    USBFS_1_PM_ACT_CFG_REG |= USBFS_1_PM_ACT_EN_FSUSB;\r
+    /* Enable USB block for Standby Power Mode */\r
+    USBFS_1_PM_STBY_CFG_REG |= USBFS_1_PM_STBY_EN_FSUSB;\r
+\r
+    /* Enable core clock */\r
+    USBFS_1_USB_CLK_EN_REG = USBFS_1_USB_CLK_ENABLE;\r
+\r
+    USBFS_1_CR1_REG = USBFS_1_CR1_ENABLE_LOCK;\r
+\r
+    /* ENABLING USBIO PADS IN USB MODE FROM I/O MODE */\r
+    /* Ensure USB transmit enable is low (USB_USBIO_CR0.ten). - Manual Transmission - Disabled */\r
+    USBFS_1_USBIO_CR0_REG &= ((uint8)(~USBFS_1_USBIO_CR0_TEN));\r
+    CyDelayUs(0u);  /*~50ns delay */\r
+    /* Disable the USBIO by asserting PM.USB_CR0.fsusbio_pd_n(Inverted)\r
+    *  high. This will have been set low by the power manger out of reset.\r
+    *  Also confirm USBIO pull-up disabled\r
+    */\r
+    USBFS_1_PM_USB_CR0_REG &= ((uint8)(~(USBFS_1_PM_USB_CR0_PD_N |\r
+                                                  USBFS_1_PM_USB_CR0_PD_PULLUP_N)));\r
+\r
+    /* Select iomode to USB mode*/\r
+    USBFS_1_USBIO_CR1_REG &= ((uint8)(~USBFS_1_USBIO_CR1_IOMODE));\r
+\r
+    /* Enable the USBIO reference by setting PM.USB_CR0.fsusbio_ref_en.*/\r
+    USBFS_1_PM_USB_CR0_REG |= USBFS_1_PM_USB_CR0_REF_EN;\r
+    /* The reference will be available 1 us after the regulator is enabled */\r
+    CyDelayUs(1u);\r
+    /* OR 40us after power restored */\r
+    CyDelayUs(40u);\r
+    /* Ensure the single ended disable bits are low (PRT15.INP_DIS[7:6])(input receiver enabled). */\r
+    USBFS_1_DM_INP_DIS_REG &= ((uint8)(~USBFS_1_DM_MASK));\r
+    USBFS_1_DP_INP_DIS_REG &= ((uint8)(~USBFS_1_DP_MASK));\r
+\r
+    /* Enable USBIO */\r
+    USBFS_1_PM_USB_CR0_REG |= USBFS_1_PM_USB_CR0_PD_N;\r
+    CyDelayUs(2u);\r
+    /* Set the USBIO pull-up enable */\r
+    USBFS_1_PM_USB_CR0_REG |= USBFS_1_PM_USB_CR0_PD_PULLUP_N;\r
+\r
+    /* Write WAx */\r
+    CY_SET_REG8(USBFS_1_ARB_RW1_WA_PTR,     0u);\r
+    CY_SET_REG8(USBFS_1_ARB_RW1_WA_MSB_PTR, 0u);\r
+\r
+    #if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+        /* Init transfer descriptor. This will be used to detect the DMA state - initialized or not. */\r
+        for (i = 0u; i < USBFS_1_MAX_EP; i++)\r
+        {\r
+            USBFS_1_DmaTd[i] = DMA_INVALID_TD;\r
+        }\r
+    #endif   /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+    CyExitCriticalSection(enableInterrupts);\r
+\r
+\r
+    /* Set the bus reset Interrupt. */\r
+    (void) CyIntSetVector(USBFS_1_BUS_RESET_VECT_NUM,   &USBFS_1_BUS_RESET_ISR);\r
+    CyIntSetPriority(USBFS_1_BUS_RESET_VECT_NUM, USBFS_1_BUS_RESET_PRIOR);\r
+\r
+    /* Set the SOF Interrupt. */\r
+    #if(USBFS_1_SOF_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_SOF_VECT_NUM,   &USBFS_1_SOF_ISR);\r
+        CyIntSetPriority(USBFS_1_SOF_VECT_NUM, USBFS_1_SOF_PRIOR);\r
+    #endif   /* End USBFS_1_SOF_ISR_REMOVE */\r
+\r
+    /* Set the Control Endpoint Interrupt. */\r
+    (void) CyIntSetVector(USBFS_1_EP_0_VECT_NUM,   &USBFS_1_EP_0_ISR);\r
+    CyIntSetPriority(USBFS_1_EP_0_VECT_NUM, USBFS_1_EP_0_PRIOR);\r
+\r
+    /* Set the Data Endpoint 1 Interrupt. */\r
+    #if(USBFS_1_EP1_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_1_VECT_NUM,   &USBFS_1_EP_1_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_1_VECT_NUM, USBFS_1_EP_1_PRIOR);\r
+    #endif   /* End USBFS_1_EP1_ISR_REMOVE */\r
+\r
+    /* Set the Data Endpoint 2 Interrupt. */\r
+    #if(USBFS_1_EP2_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_2_VECT_NUM,   &USBFS_1_EP_2_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_2_VECT_NUM, USBFS_1_EP_2_PRIOR);\r
+    #endif   /* End USBFS_1_EP2_ISR_REMOVE */\r
+\r
+    /* Set the Data Endpoint 3 Interrupt. */\r
+    #if(USBFS_1_EP3_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_3_VECT_NUM,   &USBFS_1_EP_3_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_3_VECT_NUM, USBFS_1_EP_3_PRIOR);\r
+    #endif   /* End USBFS_1_EP3_ISR_REMOVE */\r
+\r
+    /* Set the Data Endpoint 4 Interrupt. */\r
+    #if(USBFS_1_EP4_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_4_VECT_NUM,   &USBFS_1_EP_4_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_4_VECT_NUM, USBFS_1_EP_4_PRIOR);\r
+    #endif   /* End USBFS_1_EP4_ISR_REMOVE */\r
+\r
+    /* Set the Data Endpoint 5 Interrupt. */\r
+    #if(USBFS_1_EP5_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_5_VECT_NUM,   &USBFS_1_EP_5_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_5_VECT_NUM, USBFS_1_EP_5_PRIOR);\r
+    #endif   /* End USBFS_1_EP5_ISR_REMOVE */\r
+\r
+    /* Set the Data Endpoint 6 Interrupt. */\r
+    #if(USBFS_1_EP6_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_6_VECT_NUM,   &USBFS_1_EP_6_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_6_VECT_NUM, USBFS_1_EP_6_PRIOR);\r
+    #endif   /* End USBFS_1_EP6_ISR_REMOVE */\r
+\r
+     /* Set the Data Endpoint 7 Interrupt. */\r
+    #if(USBFS_1_EP7_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_7_VECT_NUM,   &USBFS_1_EP_7_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_7_VECT_NUM, USBFS_1_EP_7_PRIOR);\r
+    #endif   /* End USBFS_1_EP7_ISR_REMOVE */\r
+\r
+    /* Set the Data Endpoint 8 Interrupt. */\r
+    #if(USBFS_1_EP8_ISR_REMOVE == 0u)\r
+        (void) CyIntSetVector(USBFS_1_EP_8_VECT_NUM,   &USBFS_1_EP_8_ISR);\r
+        CyIntSetPriority(USBFS_1_EP_8_VECT_NUM, USBFS_1_EP_8_PRIOR);\r
+    #endif   /* End USBFS_1_EP8_ISR_REMOVE */\r
+\r
+    #if((USBFS_1_EP_MM != USBFS_1__EP_MANUAL) && (USBFS_1_ARB_ISR_REMOVE == 0u))\r
+        /* Set the ARB Interrupt. */\r
+        (void) CyIntSetVector(USBFS_1_ARB_VECT_NUM,   &USBFS_1_ARB_ISR);\r
+        CyIntSetPriority(USBFS_1_ARB_VECT_NUM, USBFS_1_ARB_PRIOR);\r
+    #endif   /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_InitComponent\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Initialize the component, except for the HW which is done one time in\r
+*  the Start function.  This function pulls up D+.\r
+*\r
+* Parameters:\r
+*  device: Contains the device number of the desired device descriptor.\r
+*          The device number can be found in the Device Descriptor Tab of\r
+*          "Configure" dialog, under the settings of desired Device Descriptor,\r
+*          in the "Device Number" field.\r
+*  mode: The operating voltage. This determines whether the voltage regulator\r
+*        is enabled for 5V operation or if pass through mode is used for 3.3V\r
+*        operation. Symbolic names and their associated values are given in the\r
+*        following table.\r
+*       USBFS_1_3V_OPERATION - Disable voltage regulator and pass-thru\r
+*                                       Vcc for pull-up\r
+*       USBFS_1_5V_OPERATION - Enable voltage regulator and use\r
+*                                       regulator for pull-up\r
+*       USBFS_1_DWR_VDDD_OPERATION - Enable or Disable voltage\r
+*                         regulator depend on Vddd Voltage configuration in DWR.\r
+*\r
+* Return:\r
+*   None.\r
+*\r
+* Global variables:\r
+*   USBFS_1_device: Contains the device number of the desired device\r
+*       descriptor. The device number can be found in the Device Descriptor Tab\r
+*       of "Configure" dialog, under the settings of desired Device Descriptor,\r
+*       in the "Device Number" field.\r
+*   USBFS_1_transferState: This variable used by the communication\r
+*       functions to handle current transfer state. Initialized to\r
+*       TRANS_STATE_IDLE in this API.\r
+*   USBFS_1_configuration: Contains current configuration number\r
+*       which is set by the Host using SET_CONFIGURATION request.\r
+*       Initialized to zero in this API.\r
+*   USBFS_1_deviceAddress: Contains current device address. This\r
+*       variable is initialized to zero in this API. Host starts to communicate\r
+*      to device with address 0 and then set it to whatever value using\r
+*      SET_ADDRESS request.\r
+*   USBFS_1_deviceStatus: initialized to 0.\r
+*       This is two bit variable which contain power status in first bit\r
+*       (DEVICE_STATUS_BUS_POWERED or DEVICE_STATUS_SELF_POWERED) and remote\r
+*       wakeup status (DEVICE_STATUS_REMOTE_WAKEUP) in second bit.\r
+*   USBFS_1_lastPacketSize initialized to 0;\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_InitComponent(uint8 device, uint8 mode) \r
+{\r
+    /* Initialize _hidProtocol variable to comply with\r
+    *  HID 7.2.6 Set_Protocol Request:\r
+    *  "When initialized, all devices default to report protocol."\r
+    */\r
+    #if defined(USBFS_1_ENABLE_HID_CLASS)\r
+        uint8 i;\r
+\r
+        for (i = 0u; i < USBFS_1_MAX_INTERFACES_NUMBER; i++)\r
+        {\r
+            USBFS_1_hidProtocol[i] = USBFS_1_PROTOCOL_REPORT;\r
+        }\r
+    #endif /* USBFS_1_ENABLE_HID_CLASS */\r
+\r
+    /* Enable Interrupts. */\r
+    CyIntEnable(USBFS_1_BUS_RESET_VECT_NUM);\r
+    CyIntEnable(USBFS_1_EP_0_VECT_NUM);\r
+    #if(USBFS_1_EP1_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_1_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP1_ISR_REMOVE */\r
+    #if(USBFS_1_EP2_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_2_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP2_ISR_REMOVE */\r
+    #if(USBFS_1_EP3_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_3_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP3_ISR_REMOVE */\r
+    #if(USBFS_1_EP4_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_4_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP4_ISR_REMOVE */\r
+    #if(USBFS_1_EP5_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_5_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP5_ISR_REMOVE */\r
+    #if(USBFS_1_EP6_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_6_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP6_ISR_REMOVE */\r
+    #if(USBFS_1_EP7_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_7_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP7_ISR_REMOVE */\r
+    #if(USBFS_1_EP8_ISR_REMOVE == 0u)\r
+        CyIntEnable(USBFS_1_EP_8_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP8_ISR_REMOVE */\r
+    #if((USBFS_1_EP_MM != USBFS_1__EP_MANUAL) && (USBFS_1_ARB_ISR_REMOVE == 0u))\r
+        /* usb arb interrupt enable */\r
+        USBFS_1_ARB_INT_EN_REG = USBFS_1_ARB_INT_MASK;\r
+        CyIntEnable(USBFS_1_ARB_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+    /* Arbiter configuration for DMA transfers */\r
+    #if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL)\r
+            USBFS_1_ARB_CFG_REG = USBFS_1_ARB_CFG_MANUAL_DMA;\r
+        #endif   /* End USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL */\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)\r
+            /*Set cfg cmplt this rises DMA request when the full configuration is done */\r
+            USBFS_1_ARB_CFG_REG = USBFS_1_ARB_CFG_AUTO_DMA | USBFS_1_ARB_CFG_AUTO_MEM;\r
+        #endif   /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */\r
+    #endif   /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+    USBFS_1_transferState = USBFS_1_TRANS_STATE_IDLE;\r
+\r
+    /* USB Locking: Enabled, VRegulator: depend on mode or DWR Voltage configuration*/\r
+    switch(mode)\r
+    {\r
+        case USBFS_1_3V_OPERATION:\r
+            USBFS_1_CR1_REG = USBFS_1_CR1_ENABLE_LOCK;\r
+            break;\r
+        case USBFS_1_5V_OPERATION:\r
+            USBFS_1_CR1_REG = USBFS_1_CR1_ENABLE_LOCK | USBFS_1_CR1_REG_ENABLE;\r
+            break;\r
+        default:   /*USBFS_1_DWR_VDDD_OPERATION */\r
+            #if(USBFS_1_VDDD_MV < USBFS_1_3500MV)\r
+                USBFS_1_CR1_REG = USBFS_1_CR1_ENABLE_LOCK;\r
+            #else\r
+                USBFS_1_CR1_REG = USBFS_1_CR1_ENABLE_LOCK | USBFS_1_CR1_REG_ENABLE;\r
+            #endif /* End USBFS_1_VDDD_MV < USBFS_1_3500MV */\r
+            break;\r
+    }\r
+\r
+    /* Record the descriptor selection */\r
+    USBFS_1_device = device;\r
+\r
+    /* Clear all of the component data */\r
+    USBFS_1_configuration = 0u;\r
+    USBFS_1_interfaceNumber = 0u;\r
+    USBFS_1_configurationChanged = 0u;\r
+    USBFS_1_deviceAddress  = 0u;\r
+    USBFS_1_deviceStatus = 0u;\r
+\r
+    USBFS_1_lastPacketSize = 0u;\r
+\r
+    /*  ACK Setup, Stall IN/OUT */\r
+    CY_SET_REG8(USBFS_1_EP0_CR_PTR, USBFS_1_MODE_STALL_IN_OUT);\r
+\r
+    /* Enable the SIE with an address 0 */\r
+    CY_SET_REG8(USBFS_1_CR0_PTR, USBFS_1_CR0_ENABLE);\r
+\r
+    /* Workaround for PSOC5LP */\r
+    CyDelayCycles(1u);\r
+\r
+    /* Finally, Enable d+ pullup and select iomode to USB mode*/\r
+    CY_SET_REG8(USBFS_1_USBIO_CR1_PTR, USBFS_1_USBIO_CR1_USBPUEN);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_ReInitComponent\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This function reinitialize the component configuration and is\r
+*  intend to be called from the Reset interrupt.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*   None.\r
+*\r
+* Global variables:\r
+*   USBFS_1_device: Contains the device number of the desired device\r
+*        descriptor. The device number can be found in the Device Descriptor Tab\r
+*       of "Configure" dialog, under the settings of desired Device Descriptor,\r
+*       in the "Device Number" field.\r
+*   USBFS_1_transferState: This variable used by the communication\r
+*       functions to handle current transfer state. Initialized to\r
+*       TRANS_STATE_IDLE in this API.\r
+*   USBFS_1_configuration: Contains current configuration number\r
+*       which is set by the Host using SET_CONFIGURATION request.\r
+*       Initialized to zero in this API.\r
+*   USBFS_1_deviceAddress: Contains current device address. This\r
+*       variable is initialized to zero in this API. Host starts to communicate\r
+*      to device with address 0 and then set it to whatever value using\r
+*      SET_ADDRESS request.\r
+*   USBFS_1_deviceStatus: initialized to 0.\r
+*       This is two bit variable which contain power status in first bit\r
+*       (DEVICE_STATUS_BUS_POWERED or DEVICE_STATUS_SELF_POWERED) and remote\r
+*       wakeup status (DEVICE_STATUS_REMOTE_WAKEUP) in second bit.\r
+*   USBFS_1_lastPacketSize initialized to 0;\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_ReInitComponent(void) \r
+{\r
+    /* Initialize _hidProtocol variable to comply with HID 7.2.6 Set_Protocol\r
+    *  Request: "When initialized, all devices default to report protocol."\r
+    */\r
+    #if defined(USBFS_1_ENABLE_HID_CLASS)\r
+        uint8 i;\r
+\r
+        for (i = 0u; i < USBFS_1_MAX_INTERFACES_NUMBER; i++)\r
+        {\r
+            USBFS_1_hidProtocol[i] = USBFS_1_PROTOCOL_REPORT;\r
+        }\r
+    #endif /* USBFS_1_ENABLE_HID_CLASS */\r
+\r
+    USBFS_1_transferState = USBFS_1_TRANS_STATE_IDLE;\r
+\r
+    /* Clear all of the component data */\r
+    USBFS_1_configuration = 0u;\r
+    USBFS_1_interfaceNumber = 0u;\r
+    USBFS_1_configurationChanged = 0u;\r
+    USBFS_1_deviceAddress  = 0u;\r
+    USBFS_1_deviceStatus = 0u;\r
+\r
+    USBFS_1_lastPacketSize = 0u;\r
+\r
+\r
+    /*  ACK Setup, Stall IN/OUT */\r
+    CY_SET_REG8(USBFS_1_EP0_CR_PTR, USBFS_1_MODE_STALL_IN_OUT);\r
+\r
+    /* Enable the SIE with an address 0 */\r
+    CY_SET_REG8(USBFS_1_CR0_PTR, USBFS_1_CR0_ENABLE);\r
+\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Stop\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This function shuts down the USB function including to release\r
+*  the D+ Pullup and disabling the SIE.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+* Global variables:\r
+*   USBFS_1_configuration: Contains current configuration number\r
+*       which is set by the Host using SET_CONFIGURATION request.\r
+*       Initialized to zero in this API.\r
+*   USBFS_1_deviceAddress: Contains current device address. This\r
+*       variable is initialized to zero in this API. Host starts to communicate\r
+*      to device with address 0 and then set it to whatever value using\r
+*      SET_ADDRESS request.\r
+*   USBFS_1_deviceStatus: initialized to 0.\r
+*       This is two bit variable which contain power status in first bit\r
+*       (DEVICE_STATUS_BUS_POWERED or DEVICE_STATUS_SELF_POWERED) and remote\r
+*       wakeup status (DEVICE_STATUS_REMOTE_WAKEUP) in second bit.\r
+*   USBFS_1_configurationChanged: This variable is set to one after\r
+*       SET_CONFIGURATION request and cleared in this function.\r
+*   USBFS_1_intiVar variable is set to zero\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_Stop(void) \r
+{\r
+\r
+    #if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+        USBFS_1_Stop_DMA(USBFS_1_MAX_EP);     /* Stop all DMAs */\r
+    #endif   /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+    /* Disable the SIE */\r
+    USBFS_1_CR0_REG &= (uint8)(~USBFS_1_CR0_ENABLE);\r
+    /* Disable the d+ pullup */\r
+    USBFS_1_USBIO_CR1_REG &= (uint8)(~USBFS_1_USBIO_CR1_USBPUEN);\r
+    /* Disable USB in ACT PM */\r
+    USBFS_1_PM_ACT_CFG_REG &= (uint8)(~USBFS_1_PM_ACT_EN_FSUSB);\r
+    /* Disable USB block for Standby Power Mode */\r
+    USBFS_1_PM_STBY_CFG_REG &= (uint8)(~USBFS_1_PM_STBY_EN_FSUSB);\r
+\r
+    /* Disable the reset and EP interrupts */\r
+    CyIntDisable(USBFS_1_BUS_RESET_VECT_NUM);\r
+    CyIntDisable(USBFS_1_EP_0_VECT_NUM);\r
+    #if(USBFS_1_EP1_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_1_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP1_ISR_REMOVE */\r
+    #if(USBFS_1_EP2_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_2_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP2_ISR_REMOVE */\r
+    #if(USBFS_1_EP3_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_3_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP3_ISR_REMOVE */\r
+    #if(USBFS_1_EP4_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_4_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP4_ISR_REMOVE */\r
+    #if(USBFS_1_EP5_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_5_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP5_ISR_REMOVE */\r
+    #if(USBFS_1_EP6_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_6_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP6_ISR_REMOVE */\r
+    #if(USBFS_1_EP7_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_7_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP7_ISR_REMOVE */\r
+    #if(USBFS_1_EP8_ISR_REMOVE == 0u)\r
+        CyIntDisable(USBFS_1_EP_8_VECT_NUM);\r
+    #endif   /* End USBFS_1_EP8_ISR_REMOVE */\r
+\r
+    /* Clear all of the component data */\r
+    USBFS_1_configuration = 0u;\r
+    USBFS_1_interfaceNumber = 0u;\r
+    USBFS_1_configurationChanged = 0u;\r
+    USBFS_1_deviceAddress  = 0u;\r
+    USBFS_1_deviceStatus = 0u;\r
+    USBFS_1_initVar = 0u;\r
+\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_CheckActivity\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returns the activity status of the bus.  Clears the status hardware to\r
+*  provide fresh activity status on the next call of this routine.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  1 - If bus activity was detected since the last call to this function\r
+*  0 - If bus activity not was detected since the last call to this function\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_CheckActivity(void) \r
+{\r
+    uint8 r;\r
+\r
+    r = CY_GET_REG8(USBFS_1_CR1_PTR);\r
+    CY_SET_REG8(USBFS_1_CR1_PTR, (r & ((uint8)(~USBFS_1_CR1_BUS_ACTIVITY))));\r
+\r
+    return((r & USBFS_1_CR1_BUS_ACTIVITY) >> USBFS_1_CR1_BUS_ACTIVITY_SHIFT);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_GetConfiguration\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returns the current configuration setting\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  configuration.\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_GetConfiguration(void) \r
+{\r
+    return(USBFS_1_configuration);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_IsConfigurationChanged\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returns the clear on read configuration state. It is usefull when PC send\r
+*  double SET_CONFIGURATION request with same configuration number.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  Not zero value when new configuration has been changed, otherwise zero is\r
+*  returned.\r
+*\r
+* Global variables:\r
+*   USBFS_1_configurationChanged: This variable is set to one after\r
+*       SET_CONFIGURATION request and cleared in this function.\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_IsConfigurationChanged(void) \r
+{\r
+    uint8 res = 0u;\r
+\r
+    if(USBFS_1_configurationChanged != 0u)\r
+    {\r
+        res = USBFS_1_configurationChanged;\r
+        USBFS_1_configurationChanged = 0u;\r
+    }\r
+\r
+    return(res);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_GetInterfaceSetting\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returns the alternate setting from current interface\r
+*\r
+* Parameters:\r
+*  uint8 interfaceNumber, interface number\r
+*\r
+* Return:\r
+*  Alternate setting.\r
+*\r
+*******************************************************************************/\r
+uint8  USBFS_1_GetInterfaceSetting(uint8 interfaceNumber)\r
+                                                    \r
+{\r
+    return(USBFS_1_interfaceSetting[interfaceNumber]);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_GetEPState\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returned the state of the requested endpoint.\r
+*\r
+* Parameters:\r
+*  epNumber: Endpoint Number\r
+*\r
+* Return:\r
+*  State of the requested endpoint.\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_GetEPState(uint8 epNumber) \r
+{\r
+    return(USBFS_1_EP[epNumber].apiEpState);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_GetEPCount\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This function supports Data Endpoints only(EP1-EP8).\r
+*  Returns the transfer count for the requested endpoint.  The value from\r
+*  the count registers includes 2 counts for the two byte checksum of the\r
+*  packet.  This function subtracts the two counts.\r
+*\r
+* Parameters:\r
+*  epNumber: Data Endpoint Number.\r
+*            Valid values are between 1 and 8.\r
+*\r
+* Return:\r
+*  Returns the current byte count from the specified endpoint or 0 for an\r
+*  invalid endpoint.\r
+*\r
+*******************************************************************************/\r
+uint16 USBFS_1_GetEPCount(uint8 epNumber) \r
+{\r
+    uint8 ri;\r
+    uint16 result = 0u;\r
+\r
+    if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP))\r
+    {\r
+        ri = ((epNumber - USBFS_1_EP1) << USBFS_1_EPX_CNTX_ADDR_SHIFT);\r
+\r
+        result = (uint8)(CY_GET_REG8((reg8 *)(USBFS_1_SIE_EP1_CNT0_IND + ri)) &\r
+                          USBFS_1_EPX_CNT0_MASK);\r
+        result = (result << 8u) | CY_GET_REG8((reg8 *)(USBFS_1_SIE_EP1_CNT1_IND + ri));\r
+        result -= USBFS_1_EPX_CNTX_CRC_COUNT;\r
+    }\r
+    return(result);\r
+}\r
+\r
+\r
+#if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_InitEP_DMA\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  This function allocates and initializes a DMA channel to be used by the\r
+    *  USBFS_1_LoadInEP() or USBFS_1_ReadOutEP() APIs for data\r
+    *  transfer.\r
+    *\r
+    * Parameters:\r
+    *  epNumber: Contains the data endpoint number.\r
+    *            Valid values are between 1 and 8.\r
+    *  *pData: Pointer to a data array that is related to the EP transfers.\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_InitEP_DMA(uint8 epNumber, const uint8 *pData)\r
+                                                                    \r
+    {\r
+        uint16 src;\r
+        uint16 dst;\r
+        #if (CY_PSOC3)                  /* PSoC 3 */\r
+            src = HI16(CYDEV_SRAM_BASE);\r
+            dst = HI16(CYDEV_PERIPH_BASE);\r
+            pData = pData;\r
+        #else                           /* PSoC 5 */\r
+            if((USBFS_1_EP[epNumber].addr & USBFS_1_DIR_IN) != 0u )\r
+            {   /* for the IN EP source is the SRAM memory buffer */\r
+                src = HI16(pData);\r
+                dst = HI16(CYDEV_PERIPH_BASE);\r
+            }\r
+            else\r
+            {   /* for the OUT EP source is the SIE register */\r
+                src = HI16(CYDEV_PERIPH_BASE);\r
+                dst = HI16(pData);\r
+            }\r
+        #endif  /* End C51 */\r
+        switch(epNumber)\r
+        {\r
+            case USBFS_1_EP1:\r
+                #if(USBFS_1_DMA1_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep1_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA1_REMOVE */\r
+                break;\r
+            case USBFS_1_EP2:\r
+                #if(USBFS_1_DMA2_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep2_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA2_REMOVE */\r
+                break;\r
+            case USBFS_1_EP3:\r
+                #if(USBFS_1_DMA3_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep3_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA3_REMOVE */\r
+                break;\r
+            case USBFS_1_EP4:\r
+                #if(USBFS_1_DMA4_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep4_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA4_REMOVE */\r
+                break;\r
+            case USBFS_1_EP5:\r
+                #if(USBFS_1_DMA5_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep5_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA5_REMOVE */\r
+                break;\r
+            case USBFS_1_EP6:\r
+                #if(USBFS_1_DMA6_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep6_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA6_REMOVE */\r
+                break;\r
+            case USBFS_1_EP7:\r
+                #if(USBFS_1_DMA7_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep7_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA7_REMOVE */\r
+                break;\r
+            case USBFS_1_EP8:\r
+                #if(USBFS_1_DMA8_REMOVE == 0u)\r
+                    USBFS_1_DmaChan[epNumber] = USBFS_1_ep8_DmaInitialize(\r
+                        USBFS_1_DMA_BYTES_PER_BURST, USBFS_1_DMA_REQUEST_PER_BURST, src, dst);\r
+                #endif   /* End USBFS_1_DMA8_REMOVE */\r
+                break;\r
+            default:\r
+                /* Do not support EP0 DMA transfers */\r
+                break;\r
+        }\r
+        if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP))\r
+        {\r
+            USBFS_1_DmaTd[epNumber] = CyDmaTdAllocate();\r
+        }\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_Stop_DMA\r
+    ********************************************************************************\r
+    *\r
+    * Summary: Stops and free DMA\r
+    *\r
+    * Parameters:\r
+    *  epNumber: Contains the data endpoint number or\r
+    *           USBFS_1_MAX_EP to stop all DMAs\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_Stop_DMA(uint8 epNumber) \r
+    {\r
+        uint8 i;\r
+        i = (epNumber < USBFS_1_MAX_EP) ? epNumber : USBFS_1_EP1;\r
+        do\r
+        {\r
+            if(USBFS_1_DmaTd[i] != DMA_INVALID_TD)\r
+            {\r
+                (void) CyDmaChDisable(USBFS_1_DmaChan[i]);\r
+                CyDmaTdFree(USBFS_1_DmaTd[i]);\r
+                USBFS_1_DmaTd[i] = DMA_INVALID_TD;\r
+            }\r
+            i++;\r
+        }while((i < USBFS_1_MAX_EP) && (epNumber == USBFS_1_MAX_EP));\r
+    }\r
+\r
+#endif /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL */\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_LoadInEP\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Loads and enables the specified USB data endpoint for an IN interrupt or bulk\r
+*  transfer.\r
+*\r
+* Parameters:\r
+*  epNumber: Contains the data endpoint number.\r
+*            Valid values are between 1 and 8.\r
+*  *pData: A pointer to a data array from which the data for the endpoint space\r
+*          is loaded.\r
+*  length: The number of bytes to transfer from the array and then send as a\r
+*          result of an IN request. Valid values are between 0 and 512.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_LoadInEP(uint8 epNumber, const uint8 pData[], uint16 length)\r
+                                                                        \r
+{\r
+    uint8 ri;\r
+    reg8 *p;\r
+    #if(USBFS_1_EP_MM == USBFS_1__EP_MANUAL)\r
+        uint16 i;\r
+    #endif /* End USBFS_1_EP_MM == USBFS_1__EP_MANUAL */\r
+\r
+    if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP))\r
+    {\r
+        ri = ((epNumber - USBFS_1_EP1) << USBFS_1_EPX_CNTX_ADDR_SHIFT);\r
+        p = (reg8 *)(USBFS_1_ARB_RW1_DR_IND + ri);\r
+\r
+        #if(USBFS_1_EP_MM != USBFS_1__EP_DMAAUTO)\r
+            /* Limits length to available buffer space, auto MM could send packets up to 1024 bytes */\r
+            if(length > (USBFS_1_EPX_DATA_BUF_MAX - USBFS_1_EP[epNumber].buffOffset))\r
+            {\r
+                length = USBFS_1_EPX_DATA_BUF_MAX - USBFS_1_EP[epNumber].buffOffset;\r
+            }\r
+        #endif /* End USBFS_1_EP_MM != USBFS_1__EP_DMAAUTO */\r
+\r
+        /* Set the count and data toggle */\r
+        CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CNT0_IND + ri),\r
+                            (length >> 8u) | (USBFS_1_EP[epNumber].epToggle));\r
+        CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CNT1_IND + ri),  length & 0xFFu);\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_MANUAL)\r
+            if(pData != NULL)\r
+            {\r
+                /* Copy the data using the arbiter data register */\r
+                for (i = 0u; i < length; i++)\r
+                {\r
+                    CY_SET_REG8(p, pData[i]);\r
+                }\r
+            }\r
+            USBFS_1_EP[epNumber].apiEpState = USBFS_1_NO_EVENT_PENDING;\r
+            /* Write the Mode register */\r
+            CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CR0_IND + ri), USBFS_1_EP[epNumber].epMode);\r
+        #else\r
+            /* Init DMA if it was not initialized */\r
+            if(USBFS_1_DmaTd[epNumber] == DMA_INVALID_TD)\r
+            {\r
+                USBFS_1_InitEP_DMA(epNumber, pData);\r
+            }\r
+        #endif /* End USBFS_1_EP_MM == USBFS_1__EP_MANUAL */\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL)\r
+            USBFS_1_EP[epNumber].apiEpState = USBFS_1_NO_EVENT_PENDING;\r
+            if((pData != NULL) && (length > 0u))\r
+            {\r
+                /* Enable DMA in mode2 for transferring data */\r
+                (void) CyDmaChDisable(USBFS_1_DmaChan[epNumber]);\r
+                (void) CyDmaTdSetConfiguration(USBFS_1_DmaTd[epNumber], length, CY_DMA_DISABLE_TD,\r
+                                                                                 TD_TERMIN_EN | TD_INC_SRC_ADR);\r
+                (void) CyDmaTdSetAddress(USBFS_1_DmaTd[epNumber],  LO16((uint32)pData), LO16((uint32)p));\r
+                /* Enable the DMA */\r
+                (void) CyDmaChSetInitialTd(USBFS_1_DmaChan[epNumber], USBFS_1_DmaTd[epNumber]);\r
+                (void) CyDmaChEnable(USBFS_1_DmaChan[epNumber], 1u);\r
+                /* Generate DMA request */\r
+                * (reg8 *)(USBFS_1_ARB_EP1_CFG_IND + ri) |= USBFS_1_ARB_EPX_CFG_DMA_REQ;\r
+                * (reg8 *)(USBFS_1_ARB_EP1_CFG_IND + ri) &= ((uint8)(~USBFS_1_ARB_EPX_CFG_DMA_REQ));\r
+                /* Mode register will be written in arb ISR after DMA transfer complete */\r
+            }\r
+            else\r
+            {\r
+                /* When zero-length packet - write the Mode register directly */\r
+                CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CR0_IND + ri), USBFS_1_EP[epNumber].epMode);\r
+            }\r
+        #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL */\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)\r
+            if(pData != NULL)\r
+            {\r
+                /* Enable DMA in mode3 for transferring data */\r
+                (void) CyDmaChDisable(USBFS_1_DmaChan[epNumber]);\r
+                (void) CyDmaTdSetConfiguration(USBFS_1_DmaTd[epNumber], length,\r
+                                               USBFS_1_DmaTd[epNumber], TD_TERMIN_EN | TD_INC_SRC_ADR);\r
+                (void) CyDmaTdSetAddress(USBFS_1_DmaTd[epNumber],  LO16((uint32)pData), LO16((uint32)p));\r
+                /* Clear Any potential pending DMA requests before starting the DMA channel to transfer data */\r
+                (void) CyDmaClearPendingDrq(USBFS_1_DmaChan[epNumber]);\r
+                /* Enable the DMA */\r
+                (void) CyDmaChSetInitialTd(USBFS_1_DmaChan[epNumber], USBFS_1_DmaTd[epNumber]);\r
+                (void) CyDmaChEnable(USBFS_1_DmaChan[epNumber], 1u);\r
+            }\r
+            else\r
+            {\r
+                USBFS_1_EP[epNumber].apiEpState = USBFS_1_NO_EVENT_PENDING;\r
+                if(length > 0u)\r
+                {\r
+                    /* Set Data ready status, This will generate DMA request */\r
+                    * (reg8 *)(USBFS_1_ARB_EP1_CFG_IND + ri) |= USBFS_1_ARB_EPX_CFG_IN_DATA_RDY;\r
+                    /* Mode register will be written in arb ISR(In Buffer Full) after first DMA transfer complete */\r
+                }\r
+                else\r
+                {\r
+                    /* When zero-length packet - write the Mode register directly */\r
+                    CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CR0_IND + ri), USBFS_1_EP[epNumber].epMode);\r
+                }\r
+            }\r
+        #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */\r
+\r
+    }\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_ReadOutEP\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Read data from an endpoint.  The application must call\r
+*  USBFS_1_GetEPState to see if an event is pending.\r
+*\r
+* Parameters:\r
+*  epNumber: Contains the data endpoint number.\r
+*            Valid values are between 1 and 8.\r
+*  pData: A pointer to a data array from which the data for the endpoint space\r
+*         is loaded.\r
+*  length: The number of bytes to transfer from the USB Out endpoint and loads\r
+*          it into data array. Valid values are between 0 and 1023. The function\r
+*          moves fewer than the requested number of bytes if the host sends\r
+*          fewer bytes than requested.\r
+*\r
+* Returns:\r
+*  Number of bytes received, 0 for an invalid endpoint.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+uint16 USBFS_1_ReadOutEP(uint8 epNumber, uint8 pData[], uint16 length)\r
+                                                                        \r
+{\r
+    uint8 ri;\r
+    reg8 *p;\r
+    #if(USBFS_1_EP_MM == USBFS_1__EP_MANUAL)\r
+        uint16 i;\r
+    #endif /* End USBFS_1_EP_MM == USBFS_1__EP_MANUAL */\r
+    #if(USBFS_1_EP_MM != USBFS_1__EP_DMAAUTO)\r
+        uint16 xferCount;\r
+    #endif /* End USBFS_1_EP_MM != USBFS_1__EP_DMAAUTO */\r
+\r
+    if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP) && (pData != NULL))\r
+    {\r
+        ri = ((epNumber - USBFS_1_EP1) << USBFS_1_EPX_CNTX_ADDR_SHIFT);\r
+        p = (reg8 *)(USBFS_1_ARB_RW1_DR_IND + ri);\r
+\r
+        #if(USBFS_1_EP_MM != USBFS_1__EP_DMAAUTO)\r
+            /* Determine which is smaller the requested data or the available data */\r
+            xferCount = USBFS_1_GetEPCount(epNumber);\r
+            if (length > xferCount)\r
+            {\r
+                length = xferCount;\r
+            }\r
+        #endif /* End USBFS_1_EP_MM != USBFS_1__EP_DMAAUTO */\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_MANUAL)\r
+            /* Copy the data using the arbiter data register */\r
+            for (i = 0u; i < length; i++)\r
+            {\r
+                pData[i] = CY_GET_REG8(p);\r
+            }\r
+\r
+            /* (re)arming of OUT endpoint */\r
+            USBFS_1_EnableOutEP(epNumber);\r
+        #else\r
+            /*Init DMA if it was not initialized */\r
+            if(USBFS_1_DmaTd[epNumber] == DMA_INVALID_TD)\r
+            {\r
+                USBFS_1_InitEP_DMA(epNumber, pData);\r
+            }\r
+        #endif /* End USBFS_1_EP_MM == USBFS_1__EP_MANUAL */\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL)\r
+            /* Enable DMA in mode2 for transferring data */\r
+            (void) CyDmaChDisable(USBFS_1_DmaChan[epNumber]);\r
+            (void) CyDmaTdSetConfiguration(USBFS_1_DmaTd[epNumber], length, CY_DMA_DISABLE_TD,\r
+                                                                                TD_TERMIN_EN | TD_INC_DST_ADR);\r
+            (void) CyDmaTdSetAddress(USBFS_1_DmaTd[epNumber],  LO16((uint32)p), LO16((uint32)pData));\r
+            /* Enable the DMA */\r
+            (void) CyDmaChSetInitialTd(USBFS_1_DmaChan[epNumber], USBFS_1_DmaTd[epNumber]);\r
+            (void) CyDmaChEnable(USBFS_1_DmaChan[epNumber], 1u);\r
+\r
+            /* Generate DMA request */\r
+            * (reg8 *)(USBFS_1_ARB_EP1_CFG_IND + ri) |= USBFS_1_ARB_EPX_CFG_DMA_REQ;\r
+            * (reg8 *)(USBFS_1_ARB_EP1_CFG_IND + ri) &= ((uint8)(~USBFS_1_ARB_EPX_CFG_DMA_REQ));\r
+            /* Out EP will be (re)armed in arb ISR after transfer complete */\r
+        #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL */\r
+\r
+        #if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)\r
+            /* Enable DMA in mode3 for transferring data */\r
+            (void) CyDmaChDisable(USBFS_1_DmaChan[epNumber]);\r
+            (void) CyDmaTdSetConfiguration(USBFS_1_DmaTd[epNumber], length, USBFS_1_DmaTd[epNumber],\r
+                                                                                TD_TERMIN_EN | TD_INC_DST_ADR);\r
+            (void) CyDmaTdSetAddress(USBFS_1_DmaTd[epNumber],  LO16((uint32)p), LO16((uint32)pData));\r
+\r
+            /* Clear Any potential pending DMA requests before starting the DMA channel to transfer data */\r
+            (void) CyDmaClearPendingDrq(USBFS_1_DmaChan[epNumber]);\r
+            /* Enable the DMA */\r
+            (void) CyDmaChSetInitialTd(USBFS_1_DmaChan[epNumber], USBFS_1_DmaTd[epNumber]);\r
+            (void) CyDmaChEnable(USBFS_1_DmaChan[epNumber], 1u);\r
+            /* Out EP will be (re)armed in arb ISR after transfer complete */\r
+        #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */\r
+\r
+    }\r
+    else\r
+    {\r
+        length = 0u;\r
+    }\r
+\r
+    return(length);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_EnableOutEP\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This function enables an OUT endpoint.  It should not be\r
+*  called for an IN endpoint.\r
+*\r
+* Parameters:\r
+*  epNumber: Endpoint Number\r
+*            Valid values are between 1 and 8.\r
+*\r
+* Return:\r
+*   None.\r
+*\r
+* Global variables:\r
+*  USBFS_1_EP[epNumber].apiEpState - set to NO_EVENT_PENDING\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_EnableOutEP(uint8 epNumber) \r
+{\r
+    uint8 ri;\r
+\r
+    if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP))\r
+    {\r
+        ri = ((epNumber - USBFS_1_EP1) << USBFS_1_EPX_CNTX_ADDR_SHIFT);\r
+        USBFS_1_EP[epNumber].apiEpState = USBFS_1_NO_EVENT_PENDING;\r
+        /* Write the Mode register */\r
+        CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CR0_IND + ri), USBFS_1_EP[epNumber].epMode);\r
+    }\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_DisableOutEP\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This function disables an OUT endpoint.  It should not be\r
+*  called for an IN endpoint.\r
+*\r
+* Parameters:\r
+*  epNumber: Endpoint Number\r
+*            Valid values are between 1 and 8.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_DisableOutEP(uint8 epNumber) \r
+{\r
+    uint8 ri ;\r
+\r
+    if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP))\r
+    {\r
+        ri = ((epNumber - USBFS_1_EP1) << USBFS_1_EPX_CNTX_ADDR_SHIFT);\r
+        /* Write the Mode register */\r
+        CY_SET_REG8((reg8 *)(USBFS_1_SIE_EP1_CR0_IND + ri), USBFS_1_MODE_NAK_OUT);\r
+    }\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Force\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Forces the bus state\r
+*\r
+* Parameters:\r
+*  bState\r
+*    USBFS_1_FORCE_J\r
+*    USBFS_1_FORCE_K\r
+*    USBFS_1_FORCE_SE0\r
+*    USBFS_1_FORCE_NONE\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_Force(uint8 bState) \r
+{\r
+    CY_SET_REG8(USBFS_1_USBIO_CR0_PTR, bState);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_GetEPAckState\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returns the ACK of the CR0 Register (ACKD)\r
+*\r
+* Parameters:\r
+*  epNumber: Endpoint Number\r
+*            Valid values are between 1 and 8.\r
+*\r
+* Returns\r
+*  0 if nothing has been ACKD, non-=zero something has been ACKD\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_GetEPAckState(uint8 epNumber) \r
+{\r
+    uint8 ri;\r
+    uint8 cr = 0u;\r
+\r
+    if((epNumber > USBFS_1_EP0) && (epNumber < USBFS_1_MAX_EP))\r
+    {\r
+        ri = ((epNumber - USBFS_1_EP1) << USBFS_1_EPX_CNTX_ADDR_SHIFT);\r
+        cr = CY_GET_REG8((reg8 *)(USBFS_1_SIE_EP1_CR0_IND + ri)) & USBFS_1_MODE_ACKD;\r
+    }\r
+\r
+    return(cr);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_SetPowerStatus\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Sets the device power status for reporting in the Get Device Status\r
+*  request\r
+*\r
+* Parameters:\r
+*  powerStatus: USBFS_1_DEVICE_STATUS_BUS_POWERED(0) - Bus Powered,\r
+*               USBFS_1_DEVICE_STATUS_SELF_POWERED(1) - Self Powered\r
+*\r
+* Return:\r
+*   None.\r
+*\r
+* Global variables:\r
+*  USBFS_1_deviceStatus - set power status\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_SetPowerStatus(uint8 powerStatus) \r
+{\r
+    if (powerStatus != USBFS_1_DEVICE_STATUS_BUS_POWERED)\r
+    {\r
+        USBFS_1_deviceStatus |=  USBFS_1_DEVICE_STATUS_SELF_POWERED;\r
+    }\r
+    else\r
+    {\r
+        USBFS_1_deviceStatus &=  ((uint8)(~USBFS_1_DEVICE_STATUS_SELF_POWERED));\r
+    }\r
+}\r
+\r
+\r
+#if (USBFS_1_MON_VBUS == 1u)\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_VBusPresent\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Determines VBUS presence for Self Powered Devices.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  1 if VBUS is present, otherwise 0.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_VBusPresent(void) \r
+    {\r
+        return((0u != (CY_GET_REG8(USBFS_1_VBUS_PS_PTR) & USBFS_1_VBUS_MASK)) ? 1u : 0u);\r
+    }\r
+\r
+#endif /* USBFS_1_MON_VBUS */\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_RWUEnabled\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Returns TRUE if Remote Wake Up is enabled, otherwise FALSE\r
+*\r
+* Parameters:\r
+*   None.\r
+*\r
+* Return:\r
+*  TRUE -  Remote Wake Up Enabled\r
+*  FALSE - Remote Wake Up Disabled\r
+*\r
+* Global variables:\r
+*  USBFS_1_deviceStatus - checked to determine remote status\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_RWUEnabled(void) \r
+{\r
+    uint8 result = USBFS_1_FALSE;\r
+    if((USBFS_1_deviceStatus & USBFS_1_DEVICE_STATUS_REMOTE_WAKEUP) != 0u)\r
+    {\r
+        result = USBFS_1_TRUE;\r
+    }\r
+\r
+    return(result);\r
+}\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1.h
new file mode 100644 (file)
index 0000000..c9dc6cd
--- /dev/null
@@ -0,0 +1,1178 @@
+/*******************************************************************************\r
+* File Name: USBFS_1.h\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  Header File for the USFS component. Contains prototypes and constant values.\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_USBFS_USBFS_1_H)\r
+#define CY_USBFS_USBFS_1_H\r
+\r
+#include "cytypes.h"\r
+#include "cydevice_trm.h"\r
+#include "cyfitter.h"\r
+#include "CyLib.h"\r
+\r
+\r
+/***************************************\r
+* Conditional Compilation Parameters\r
+***************************************/\r
+\r
+/* Check to see if required defines such as CY_PSOC5LP are available */\r
+/* They are defined starting with cy_boot v3.0 */\r
+#if !defined (CY_PSOC5LP)\r
+    #error Component USBFS_v2_60 requires cy_boot v3.0 or later\r
+#endif /* (CY_PSOC5LP) */\r
+\r
+\r
+/***************************************\r
+*  Memory Type Definitions\r
+***************************************/\r
+\r
+/* Renamed Type Definitions for backward compatibility.\r
+*  Should not be used in new designs.\r
+*/\r
+#define USBFS_1_CODE CYCODE\r
+#define USBFS_1_FAR CYFAR\r
+#if defined(__C51__) || defined(__CX51__)\r
+    #define USBFS_1_DATA data\r
+    #define USBFS_1_XDATA xdata\r
+#else\r
+    #define USBFS_1_DATA\r
+    #define USBFS_1_XDATA\r
+#endif /* End __C51__ */\r
+#define USBFS_1_NULL       NULL\r
+\r
+\r
+/***************************************\r
+* Enumerated Types and Parameters\r
+***************************************/\r
+\r
+#define USBFS_1__EP_MANUAL 0\r
+#define USBFS_1__EP_DMAMANUAL 1\r
+#define USBFS_1__EP_DMAAUTO 2\r
+\r
+#define USBFS_1__MA_STATIC 0\r
+#define USBFS_1__MA_DYNAMIC 1\r
+\r
+\r
+\r
+/***************************************\r
+*    Initial Parameter Constants\r
+***************************************/\r
+\r
+#define USBFS_1_NUM_DEVICES   (1u)\r
+#define USBFS_1_MAX_REPORTID_NUMBER   (0u)\r
+\r
+#define USBFS_1_MON_VBUS                       (0u)\r
+#define USBFS_1_EXTERN_VBUS                    (0u)\r
+#define USBFS_1_EXTERN_VND                     (0u)\r
+#define USBFS_1_EXTERN_CLS                     (0u)\r
+#define USBFS_1_MAX_INTERFACES_NUMBER          (1u)\r
+#define USBFS_1_EP0_ISR_REMOVE                 (0u)\r
+#define USBFS_1_EP1_ISR_REMOVE                 (0u)\r
+#define USBFS_1_EP2_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP3_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP4_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP5_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP6_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP7_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP8_ISR_REMOVE                 (1u)\r
+#define USBFS_1_EP_MM                          (0u)\r
+#define USBFS_1_EP_MA                          (0u)\r
+#define USBFS_1_DMA1_REMOVE                    (1u)\r
+#define USBFS_1_DMA2_REMOVE                    (1u)\r
+#define USBFS_1_DMA3_REMOVE                    (1u)\r
+#define USBFS_1_DMA4_REMOVE                    (1u)\r
+#define USBFS_1_DMA5_REMOVE                    (1u)\r
+#define USBFS_1_DMA6_REMOVE                    (1u)\r
+#define USBFS_1_DMA7_REMOVE                    (1u)\r
+#define USBFS_1_DMA8_REMOVE                    (1u)\r
+#define USBFS_1_SOF_ISR_REMOVE                 (0u)\r
+#define USBFS_1_ARB_ISR_REMOVE                 (0u)\r
+#define USBFS_1_DP_ISR_REMOVE                  (0u)\r
+#define USBFS_1_ENABLE_CDC_CLASS_API           (1u)\r
+#define USBFS_1_ENABLE_MIDI_API                (1u)\r
+#define USBFS_1_MIDI_EXT_MODE                  (0u)\r
+\r
+\r
+/***************************************\r
+*    Data Struct Definition\r
+***************************************/\r
+\r
+typedef struct\r
+{\r
+    uint8  attrib;\r
+    uint8  apiEpState;\r
+    uint8  hwEpState;\r
+    uint8  epToggle;\r
+    uint8  addr;\r
+    uint8  epMode;\r
+    uint16 buffOffset;\r
+    uint16 bufferSize;\r
+    uint8  interface;\r
+} T_USBFS_1_EP_CTL_BLOCK;\r
+\r
+typedef struct\r
+{\r
+    uint8  interface;\r
+    uint8  altSetting;\r
+    uint8  addr;\r
+    uint8  attributes;\r
+    uint16 bufferSize;\r
+    uint8  bMisc;\r
+} T_USBFS_1_EP_SETTINGS_BLOCK;\r
+\r
+typedef struct\r
+{\r
+    uint8  status;\r
+    uint16 length;\r
+} T_USBFS_1_XFER_STATUS_BLOCK;\r
+\r
+typedef struct\r
+{\r
+    uint16  count;\r
+    volatile uint8 *pData;\r
+    T_USBFS_1_XFER_STATUS_BLOCK *pStatusBlock;\r
+} T_USBFS_1_TD;\r
+\r
+\r
+typedef struct\r
+{\r
+    uint8   c;\r
+    const void *p_list;\r
+} T_USBFS_1_LUT;\r
+\r
+/* Resume/Suspend API Support */\r
+typedef struct\r
+{\r
+    uint8 enableState;\r
+    uint8 mode;\r
+} USBFS_1_BACKUP_STRUCT;\r
+\r
+\r
+/* Renamed structure fields for backward compatibility.\r
+*  Should not be used in new designs.\r
+*/\r
+#define wBuffOffset         buffOffset\r
+#define wBufferSize         bufferSize\r
+#define bStatus             status\r
+#define wLength             length\r
+#define wCount              count\r
+\r
+/* Renamed global variable for backward compatibility.\r
+*  Should not be used in new designs.\r
+*/\r
+#define CurrentTD           USBFS_1_currentTD\r
+\r
+\r
+/***************************************\r
+*       Function Prototypes\r
+***************************************/\r
+\r
+void   USBFS_1_Start(uint8 device, uint8 mode) ;\r
+void   USBFS_1_Init(void) ;\r
+void   USBFS_1_InitComponent(uint8 device, uint8 mode) ;\r
+void   USBFS_1_Stop(void) ;\r
+uint8  USBFS_1_CheckActivity(void) ;\r
+uint8  USBFS_1_GetConfiguration(void) ;\r
+uint8  USBFS_1_IsConfigurationChanged(void) ;\r
+uint8  USBFS_1_GetInterfaceSetting(uint8 interfaceNumber)\r
+                                                        ;\r
+uint8  USBFS_1_GetEPState(uint8 epNumber) ;\r
+uint16 USBFS_1_GetEPCount(uint8 epNumber) ;\r
+void   USBFS_1_LoadInEP(uint8 epNumber, const uint8 pData[], uint16 length)\r
+                                                                    ;\r
+uint16 USBFS_1_ReadOutEP(uint8 epNumber, uint8 pData[], uint16 length)\r
+                                                                    ;\r
+void   USBFS_1_EnableOutEP(uint8 epNumber) ;\r
+void   USBFS_1_DisableOutEP(uint8 epNumber) ;\r
+void   USBFS_1_Force(uint8 bState) ;\r
+uint8  USBFS_1_GetEPAckState(uint8 epNumber) ;\r
+void   USBFS_1_SetPowerStatus(uint8 powerStatus) ;\r
+uint8  USBFS_1_RWUEnabled(void) ;\r
+void   USBFS_1_TerminateEP(uint8 ep) ;\r
+\r
+void   USBFS_1_Suspend(void) ;\r
+void   USBFS_1_Resume(void) ;\r
+\r
+#if defined(USBFS_1_ENABLE_FWSN_STRING)\r
+    void   USBFS_1_SerialNumString(uint8 snString[]) ;\r
+#endif  /* USBFS_1_ENABLE_FWSN_STRING */\r
+#if (USBFS_1_MON_VBUS == 1u)\r
+    uint8  USBFS_1_VBusPresent(void) ;\r
+#endif /* End USBFS_1_MON_VBUS */\r
+\r
+#if defined(CYDEV_BOOTLOADER_IO_COMP) && ((CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1) || \\r
+                                          (CYDEV_BOOTLOADER_IO_COMP == CyBtldr_Custom_Interface))\r
+\r
+    void USBFS_1_CyBtldrCommStart(void) ;\r
+    void USBFS_1_CyBtldrCommStop(void) ;\r
+    void USBFS_1_CyBtldrCommReset(void) ;\r
+    cystatus USBFS_1_CyBtldrCommWrite(uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL\r
+                                                        ;\r
+    cystatus USBFS_1_CyBtldrCommRead( uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL\r
+                                                        ;\r
+\r
+    #define USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER      (64u)    /* EP 1 OUT */\r
+    #define USBFS_1_BTLDR_SIZEOF_READ_BUFFER       (64u)    /* EP 2 IN */\r
+    #define USBFS_1_BTLDR_MAX_PACKET_SIZE          USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER\r
+\r
+    /* These defines active if used USBFS interface as an\r
+    *  IO Component for bootloading. When Custom_Interface selected\r
+    *  in Bootloder configuration as the IO Component, user must\r
+    *  provide these functions\r
+    */\r
+    #if (CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1)\r
+        #define CyBtldrCommStart        USBFS_1_CyBtldrCommStart\r
+        #define CyBtldrCommStop         USBFS_1_CyBtldrCommStop\r
+        #define CyBtldrCommReset        USBFS_1_CyBtldrCommReset\r
+        #define CyBtldrCommWrite        USBFS_1_CyBtldrCommWrite\r
+        #define CyBtldrCommRead         USBFS_1_CyBtldrCommRead\r
+    #endif  /*End   CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1 */\r
+\r
+#endif /* End CYDEV_BOOTLOADER_IO_COMP  */\r
+\r
+#if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)\r
+    void USBFS_1_InitEP_DMA(uint8 epNumber, const uint8 *pData)\r
+                                                    ;\r
+    void USBFS_1_Stop_DMA(uint8 epNumber) ;\r
+#endif /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL) */\r
+\r
+#if defined(USBFS_1_ENABLE_MIDI_STREAMING) && (USBFS_1_ENABLE_MIDI_API != 0u)\r
+    void USBFS_1_MIDI_EP_Init(void) ;\r
+\r
+    #if (USBFS_1_MIDI_IN_BUFF_SIZE > 0)\r
+        void USBFS_1_MIDI_IN_Service(void) ;\r
+        uint8 USBFS_1_PutUsbMidiIn(uint8 ic, const uint8 midiMsg[], uint8 cable)\r
+                                                                ;\r
+    #endif /* USBFS_1_MIDI_IN_BUFF_SIZE > 0 */\r
+\r
+    #if (USBFS_1_MIDI_OUT_BUFF_SIZE > 0)\r
+        void USBFS_1_MIDI_OUT_EP_Service(void) ;\r
+    #endif /* USBFS_1_MIDI_OUT_BUFF_SIZE > 0 */\r
+\r
+#endif /* End USBFS_1_ENABLE_MIDI_API != 0u */\r
+\r
+/* Renamed Functions for backward compatibility.\r
+*  Should not be used in new designs.\r
+*/\r
+\r
+#define USBFS_1_bCheckActivity             USBFS_1_CheckActivity\r
+#define USBFS_1_bGetConfiguration          USBFS_1_GetConfiguration\r
+#define USBFS_1_bGetInterfaceSetting       USBFS_1_GetInterfaceSetting\r
+#define USBFS_1_bGetEPState                USBFS_1_GetEPState\r
+#define USBFS_1_wGetEPCount                USBFS_1_GetEPCount\r
+#define USBFS_1_bGetEPAckState             USBFS_1_GetEPAckState\r
+#define USBFS_1_bRWUEnabled                USBFS_1_RWUEnabled\r
+#define USBFS_1_bVBusPresent               USBFS_1_VBusPresent\r
+\r
+#define USBFS_1_bConfiguration             USBFS_1_configuration\r
+#define USBFS_1_bInterfaceSetting          USBFS_1_interfaceSetting\r
+#define USBFS_1_bDeviceAddress             USBFS_1_deviceAddress\r
+#define USBFS_1_bDeviceStatus              USBFS_1_deviceStatus\r
+#define USBFS_1_bDevice                    USBFS_1_device\r
+#define USBFS_1_bTransferState             USBFS_1_transferState\r
+#define USBFS_1_bLastPacketSize            USBFS_1_lastPacketSize\r
+\r
+#define USBFS_1_LoadEP                     USBFS_1_LoadInEP\r
+#define USBFS_1_LoadInISOCEP               USBFS_1_LoadInEP\r
+#define USBFS_1_EnableOutISOCEP            USBFS_1_EnableOutEP\r
+\r
+#define USBFS_1_SetVector                  CyIntSetVector\r
+#define USBFS_1_SetPriority                CyIntSetPriority\r
+#define USBFS_1_EnableInt                  CyIntEnable\r
+\r
+\r
+/***************************************\r
+*          API Constants\r
+***************************************/\r
+\r
+#define USBFS_1_EP0                        (0u)\r
+#define USBFS_1_EP1                        (1u)\r
+#define USBFS_1_EP2                        (2u)\r
+#define USBFS_1_EP3                        (3u)\r
+#define USBFS_1_EP4                        (4u)\r
+#define USBFS_1_EP5                        (5u)\r
+#define USBFS_1_EP6                        (6u)\r
+#define USBFS_1_EP7                        (7u)\r
+#define USBFS_1_EP8                        (8u)\r
+#define USBFS_1_MAX_EP                     (9u)\r
+\r
+#define USBFS_1_TRUE                       (1u)\r
+#define USBFS_1_FALSE                      (0u)\r
+\r
+#define USBFS_1_NO_EVENT_ALLOWED           (2u)\r
+#define USBFS_1_EVENT_PENDING              (1u)\r
+#define USBFS_1_NO_EVENT_PENDING           (0u)\r
+\r
+#define USBFS_1_IN_BUFFER_FULL             USBFS_1_NO_EVENT_PENDING\r
+#define USBFS_1_IN_BUFFER_EMPTY            USBFS_1_EVENT_PENDING\r
+#define USBFS_1_OUT_BUFFER_FULL            USBFS_1_EVENT_PENDING\r
+#define USBFS_1_OUT_BUFFER_EMPTY           USBFS_1_NO_EVENT_PENDING\r
+\r
+#define USBFS_1_FORCE_J                    (0xA0u)\r
+#define USBFS_1_FORCE_K                    (0x80u)\r
+#define USBFS_1_FORCE_SE0                  (0xC0u)\r
+#define USBFS_1_FORCE_NONE                 (0x00u)\r
+\r
+#define USBFS_1_IDLE_TIMER_RUNNING         (0x02u)\r
+#define USBFS_1_IDLE_TIMER_EXPIRED         (0x01u)\r
+#define USBFS_1_IDLE_TIMER_INDEFINITE      (0x00u)\r
+\r
+#define USBFS_1_DEVICE_STATUS_BUS_POWERED  (0x00u)\r
+#define USBFS_1_DEVICE_STATUS_SELF_POWERED (0x01u)\r
+\r
+#define USBFS_1_3V_OPERATION               (0x00u)\r
+#define USBFS_1_5V_OPERATION               (0x01u)\r
+#define USBFS_1_DWR_VDDD_OPERATION         (0x02u)\r
+\r
+#define USBFS_1_MODE_DISABLE               (0x00u)\r
+#define USBFS_1_MODE_NAK_IN_OUT            (0x01u)\r
+#define USBFS_1_MODE_STATUS_OUT_ONLY       (0x02u)\r
+#define USBFS_1_MODE_STALL_IN_OUT          (0x03u)\r
+#define USBFS_1_MODE_RESERVED_0100         (0x04u)\r
+#define USBFS_1_MODE_ISO_OUT               (0x05u)\r
+#define USBFS_1_MODE_STATUS_IN_ONLY        (0x06u)\r
+#define USBFS_1_MODE_ISO_IN                (0x07u)\r
+#define USBFS_1_MODE_NAK_OUT               (0x08u)\r
+#define USBFS_1_MODE_ACK_OUT               (0x09u)\r
+#define USBFS_1_MODE_RESERVED_1010         (0x0Au)\r
+#define USBFS_1_MODE_ACK_OUT_STATUS_IN     (0x0Bu)\r
+#define USBFS_1_MODE_NAK_IN                (0x0Cu)\r
+#define USBFS_1_MODE_ACK_IN                (0x0Du)\r
+#define USBFS_1_MODE_RESERVED_1110         (0x0Eu)\r
+#define USBFS_1_MODE_ACK_IN_STATUS_OUT     (0x0Fu)\r
+#define USBFS_1_MODE_MASK                  (0x0Fu)\r
+#define USBFS_1_MODE_STALL_DATA_EP         (0x80u)\r
+\r
+#define USBFS_1_MODE_ACKD                  (0x10u)\r
+#define USBFS_1_MODE_OUT_RCVD              (0x20u)\r
+#define USBFS_1_MODE_IN_RCVD               (0x40u)\r
+#define USBFS_1_MODE_SETUP_RCVD            (0x80u)\r
+\r
+#define USBFS_1_RQST_TYPE_MASK             (0x60u)\r
+#define USBFS_1_RQST_TYPE_STD              (0x00u)\r
+#define USBFS_1_RQST_TYPE_CLS              (0x20u)\r
+#define USBFS_1_RQST_TYPE_VND              (0x40u)\r
+#define USBFS_1_RQST_DIR_MASK              (0x80u)\r
+#define USBFS_1_RQST_DIR_D2H               (0x80u)\r
+#define USBFS_1_RQST_DIR_H2D               (0x00u)\r
+#define USBFS_1_RQST_RCPT_MASK             (0x03u)\r
+#define USBFS_1_RQST_RCPT_DEV              (0x00u)\r
+#define USBFS_1_RQST_RCPT_IFC              (0x01u)\r
+#define USBFS_1_RQST_RCPT_EP               (0x02u)\r
+#define USBFS_1_RQST_RCPT_OTHER            (0x03u)\r
+\r
+/* USB Class Codes */\r
+#define USBFS_1_CLASS_DEVICE               (0x00u)     /* Use class code info from Interface Descriptors */\r
+#define USBFS_1_CLASS_AUDIO                (0x01u)     /* Audio device */\r
+#define USBFS_1_CLASS_CDC                  (0x02u)     /* Communication device class */\r
+#define USBFS_1_CLASS_HID                  (0x03u)     /* Human Interface Device */\r
+#define USBFS_1_CLASS_PDC                  (0x05u)     /* Physical device class */\r
+#define USBFS_1_CLASS_IMAGE                (0x06u)     /* Still Imaging device */\r
+#define USBFS_1_CLASS_PRINTER              (0x07u)     /* Printer device  */\r
+#define USBFS_1_CLASS_MSD                  (0x08u)     /* Mass Storage device  */\r
+#define USBFS_1_CLASS_HUB                  (0x09u)     /* Full/Hi speed Hub */\r
+#define USBFS_1_CLASS_CDC_DATA             (0x0Au)     /* CDC data device */\r
+#define USBFS_1_CLASS_SMART_CARD           (0x0Bu)     /* Smart Card device */\r
+#define USBFS_1_CLASS_CSD                  (0x0Du)     /* Content Security device */\r
+#define USBFS_1_CLASS_VIDEO                (0x0Eu)     /* Video device */\r
+#define USBFS_1_CLASS_PHD                  (0x0Fu)     /* Personal Healthcare device */\r
+#define USBFS_1_CLASS_WIRELESSD            (0xDCu)     /* Wireless Controller */\r
+#define USBFS_1_CLASS_MIS                  (0xE0u)     /* Miscellaneous */\r
+#define USBFS_1_CLASS_APP                  (0xEFu)     /* Application Specific */\r
+#define USBFS_1_CLASS_VENDOR               (0xFFu)     /* Vendor specific */\r
+\r
+\r
+/* Standard Request Types (Table 9-4) */\r
+#define USBFS_1_GET_STATUS                 (0x00u)\r
+#define USBFS_1_CLEAR_FEATURE              (0x01u)\r
+#define USBFS_1_SET_FEATURE                (0x03u)\r
+#define USBFS_1_SET_ADDRESS                (0x05u)\r
+#define USBFS_1_GET_DESCRIPTOR             (0x06u)\r
+#define USBFS_1_SET_DESCRIPTOR             (0x07u)\r
+#define USBFS_1_GET_CONFIGURATION          (0x08u)\r
+#define USBFS_1_SET_CONFIGURATION          (0x09u)\r
+#define USBFS_1_GET_INTERFACE              (0x0Au)\r
+#define USBFS_1_SET_INTERFACE              (0x0Bu)\r
+#define USBFS_1_SYNCH_FRAME                (0x0Cu)\r
+\r
+/* Vendor Specific Request Types */\r
+/* Request for Microsoft OS String Descriptor */\r
+#define USBFS_1_GET_EXTENDED_CONFIG_DESCRIPTOR (0x01u)\r
+\r
+/* Descriptor Types (Table 9-5) */\r
+#define USBFS_1_DESCR_DEVICE                   (1u)\r
+#define USBFS_1_DESCR_CONFIG                   (2u)\r
+#define USBFS_1_DESCR_STRING                   (3u)\r
+#define USBFS_1_DESCR_INTERFACE                (4u)\r
+#define USBFS_1_DESCR_ENDPOINT                 (5u)\r
+#define USBFS_1_DESCR_DEVICE_QUALIFIER         (6u)\r
+#define USBFS_1_DESCR_OTHER_SPEED              (7u)\r
+#define USBFS_1_DESCR_INTERFACE_POWER          (8u)\r
+\r
+/* Device Descriptor Defines */\r
+#define USBFS_1_DEVICE_DESCR_LENGTH            (18u)\r
+#define USBFS_1_DEVICE_DESCR_SN_SHIFT          (16u)\r
+\r
+/* Config Descriptor Shifts and Masks */\r
+#define USBFS_1_CONFIG_DESCR_LENGTH                (0u)\r
+#define USBFS_1_CONFIG_DESCR_TYPE                  (1u)\r
+#define USBFS_1_CONFIG_DESCR_TOTAL_LENGTH_LOW      (2u)\r
+#define USBFS_1_CONFIG_DESCR_TOTAL_LENGTH_HI       (3u)\r
+#define USBFS_1_CONFIG_DESCR_NUM_INTERFACES        (4u)\r
+#define USBFS_1_CONFIG_DESCR_CONFIG_VALUE          (5u)\r
+#define USBFS_1_CONFIG_DESCR_CONFIGURATION         (6u)\r
+#define USBFS_1_CONFIG_DESCR_ATTRIB                (7u)\r
+#define USBFS_1_CONFIG_DESCR_ATTRIB_SELF_POWERED   (0x40u)\r
+#define USBFS_1_CONFIG_DESCR_ATTRIB_RWU_EN         (0x20u)\r
+\r
+/* Feature Selectors (Table 9-6) */\r
+#define USBFS_1_DEVICE_REMOTE_WAKEUP           (0x01u)\r
+#define USBFS_1_ENDPOINT_HALT                  (0x00u)\r
+#define USBFS_1_TEST_MODE                      (0x02u)\r
+\r
+/* USB Device Status (Figure 9-4) */\r
+#define USBFS_1_DEVICE_STATUS_BUS_POWERED      (0x00u)\r
+#define USBFS_1_DEVICE_STATUS_SELF_POWERED     (0x01u)\r
+#define USBFS_1_DEVICE_STATUS_REMOTE_WAKEUP    (0x02u)\r
+\r
+/* USB Endpoint Status (Figure 9-4) */\r
+#define USBFS_1_ENDPOINT_STATUS_HALT           (0x01u)\r
+\r
+/* USB Endpoint Directions */\r
+#define USBFS_1_DIR_IN                         (0x80u)\r
+#define USBFS_1_DIR_OUT                        (0x00u)\r
+#define USBFS_1_DIR_UNUSED                     (0x7Fu)\r
+\r
+/* USB Endpoint Attributes */\r
+#define USBFS_1_EP_TYPE_CTRL                   (0x00u)\r
+#define USBFS_1_EP_TYPE_ISOC                   (0x01u)\r
+#define USBFS_1_EP_TYPE_BULK                   (0x02u)\r
+#define USBFS_1_EP_TYPE_INT                    (0x03u)\r
+#define USBFS_1_EP_TYPE_MASK                   (0x03u)\r
+\r
+#define USBFS_1_EP_SYNC_TYPE_NO_SYNC           (0x00u)\r
+#define USBFS_1_EP_SYNC_TYPE_ASYNC             (0x04u)\r
+#define USBFS_1_EP_SYNC_TYPE_ADAPTIVE          (0x08u)\r
+#define USBFS_1_EP_SYNC_TYPE_SYNCHRONOUS       (0x0Cu)\r
+#define USBFS_1_EP_SYNC_TYPE_MASK              (0x0Cu)\r
+\r
+#define USBFS_1_EP_USAGE_TYPE_DATA             (0x00u)\r
+#define USBFS_1_EP_USAGE_TYPE_FEEDBACK         (0x10u)\r
+#define USBFS_1_EP_USAGE_TYPE_IMPLICIT         (0x20u)\r
+#define USBFS_1_EP_USAGE_TYPE_RESERVED         (0x30u)\r
+#define USBFS_1_EP_USAGE_TYPE_MASK             (0x30u)\r
+\r
+/* Endpoint Status defines */\r
+#define USBFS_1_EP_STATUS_LENGTH               (0x02u)\r
+\r
+/* Endpoint Device defines */\r
+#define USBFS_1_DEVICE_STATUS_LENGTH           (0x02u)\r
+\r
+#define USBFS_1_STATUS_LENGTH_MAX \\r
+                 ( (USBFS_1_EP_STATUS_LENGTH > USBFS_1_DEVICE_STATUS_LENGTH) ? \\r
+                    USBFS_1_EP_STATUS_LENGTH : USBFS_1_DEVICE_STATUS_LENGTH )\r
+/* Transfer Completion Notification */\r
+#define USBFS_1_XFER_IDLE                      (0x00u)\r
+#define USBFS_1_XFER_STATUS_ACK                (0x01u)\r
+#define USBFS_1_XFER_PREMATURE                 (0x02u)\r
+#define USBFS_1_XFER_ERROR                     (0x03u)\r
+\r
+/* Driver State defines */\r
+#define USBFS_1_TRANS_STATE_IDLE               (0x00u)\r
+#define USBFS_1_TRANS_STATE_CONTROL_READ       (0x02u)\r
+#define USBFS_1_TRANS_STATE_CONTROL_WRITE      (0x04u)\r
+#define USBFS_1_TRANS_STATE_NO_DATA_CONTROL    (0x06u)\r
+\r
+/* String Descriptor defines */\r
+#define USBFS_1_STRING_MSOS                    (0xEEu)\r
+#define USBFS_1_MSOS_DESCRIPTOR_LENGTH         (18u)\r
+#define USBFS_1_MSOS_CONF_DESCR_LENGTH         (40u)\r
+\r
+#if(USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL)\r
+    /* DMA manual mode defines */\r
+    #define USBFS_1_DMA_BYTES_PER_BURST        (0u)\r
+    #define USBFS_1_DMA_REQUEST_PER_BURST      (0u)\r
+#endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL */\r
+#if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)\r
+    /* DMA automatic mode defines */\r
+    #define USBFS_1_DMA_BYTES_PER_BURST        (32u)\r
+    /* BUF_SIZE-BYTES_PER_BURST examples: 55-32 bytes  44-16 bytes 33-8 bytes 22-4 bytes 11-2 bytes */\r
+    #define USBFS_1_DMA_BUF_SIZE               (0x55u)\r
+    #define USBFS_1_DMA_REQUEST_PER_BURST      (1u)\r
+#endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */\r
+\r
+/* DIE ID string descriptor defines */\r
+#if defined(USBFS_1_ENABLE_IDSN_STRING)\r
+    #define USBFS_1_IDSN_DESCR_LENGTH          (0x22u)\r
+#endif /* USBFS_1_ENABLE_IDSN_STRING */\r
+\r
+\r
+/***************************************\r
+* External data references\r
+***************************************/\r
+\r
+extern uint8 USBFS_1_initVar;\r
+extern volatile uint8 USBFS_1_device;\r
+extern volatile uint8 USBFS_1_transferState;\r
+extern volatile uint8 USBFS_1_configuration;\r
+extern volatile uint8 USBFS_1_configurationChanged;\r
+extern volatile uint8 USBFS_1_deviceStatus;\r
+\r
+/* HID Variables */\r
+#if defined(USBFS_1_ENABLE_HID_CLASS)\r
+    extern volatile uint8 USBFS_1_hidProtocol[USBFS_1_MAX_INTERFACES_NUMBER];\r
+    extern volatile uint8 USBFS_1_hidIdleRate[USBFS_1_MAX_INTERFACES_NUMBER];\r
+    extern volatile uint8 USBFS_1_hidIdleTimer[USBFS_1_MAX_INTERFACES_NUMBER];\r
+#endif /* USBFS_1_ENABLE_HID_CLASS */\r
+\r
+\r
+/***************************************\r
+*              Registers\r
+***************************************/\r
+\r
+#define USBFS_1_ARB_CFG_PTR        (  (reg8 *) USBFS_1_USB__ARB_CFG)\r
+#define USBFS_1_ARB_CFG_REG        (* (reg8 *) USBFS_1_USB__ARB_CFG)\r
+\r
+#define USBFS_1_ARB_EP1_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP1_CFG)\r
+#define USBFS_1_ARB_EP1_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP1_CFG)\r
+#define USBFS_1_ARB_EP1_CFG_IND    USBFS_1_USB__ARB_EP1_CFG\r
+#define USBFS_1_ARB_EP1_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP1_INT_EN)\r
+#define USBFS_1_ARB_EP1_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP1_INT_EN)\r
+#define USBFS_1_ARB_EP1_INT_EN_IND USBFS_1_USB__ARB_EP1_INT_EN\r
+#define USBFS_1_ARB_EP1_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP1_SR)\r
+#define USBFS_1_ARB_EP1_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP1_SR)\r
+#define USBFS_1_ARB_EP1_SR_IND     USBFS_1_USB__ARB_EP1_SR\r
+\r
+#define USBFS_1_ARB_EP2_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP2_CFG)\r
+#define USBFS_1_ARB_EP2_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP2_CFG)\r
+#define USBFS_1_ARB_EP2_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP2_INT_EN)\r
+#define USBFS_1_ARB_EP2_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP2_INT_EN)\r
+#define USBFS_1_ARB_EP2_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP2_SR)\r
+#define USBFS_1_ARB_EP2_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP2_SR)\r
+\r
+#define USBFS_1_ARB_EP3_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP3_CFG)\r
+#define USBFS_1_ARB_EP3_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP3_CFG)\r
+#define USBFS_1_ARB_EP3_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP3_INT_EN)\r
+#define USBFS_1_ARB_EP3_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP3_INT_EN)\r
+#define USBFS_1_ARB_EP3_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP3_SR)\r
+#define USBFS_1_ARB_EP3_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP3_SR)\r
+\r
+#define USBFS_1_ARB_EP4_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP4_CFG)\r
+#define USBFS_1_ARB_EP4_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP4_CFG)\r
+#define USBFS_1_ARB_EP4_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP4_INT_EN)\r
+#define USBFS_1_ARB_EP4_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP4_INT_EN)\r
+#define USBFS_1_ARB_EP4_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP4_SR)\r
+#define USBFS_1_ARB_EP4_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP4_SR)\r
+\r
+#define USBFS_1_ARB_EP5_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP5_CFG)\r
+#define USBFS_1_ARB_EP5_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP5_CFG)\r
+#define USBFS_1_ARB_EP5_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP5_INT_EN)\r
+#define USBFS_1_ARB_EP5_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP5_INT_EN)\r
+#define USBFS_1_ARB_EP5_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP5_SR)\r
+#define USBFS_1_ARB_EP5_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP5_SR)\r
+\r
+#define USBFS_1_ARB_EP6_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP6_CFG)\r
+#define USBFS_1_ARB_EP6_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP6_CFG)\r
+#define USBFS_1_ARB_EP6_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP6_INT_EN)\r
+#define USBFS_1_ARB_EP6_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP6_INT_EN)\r
+#define USBFS_1_ARB_EP6_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP6_SR)\r
+#define USBFS_1_ARB_EP6_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP6_SR)\r
+\r
+#define USBFS_1_ARB_EP7_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP7_CFG)\r
+#define USBFS_1_ARB_EP7_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP7_CFG)\r
+#define USBFS_1_ARB_EP7_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP7_INT_EN)\r
+#define USBFS_1_ARB_EP7_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP7_INT_EN)\r
+#define USBFS_1_ARB_EP7_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP7_SR)\r
+#define USBFS_1_ARB_EP7_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP7_SR)\r
+\r
+#define USBFS_1_ARB_EP8_CFG_PTR    (  (reg8 *) USBFS_1_USB__ARB_EP8_CFG)\r
+#define USBFS_1_ARB_EP8_CFG_REG    (* (reg8 *) USBFS_1_USB__ARB_EP8_CFG)\r
+#define USBFS_1_ARB_EP8_INT_EN_PTR (  (reg8 *) USBFS_1_USB__ARB_EP8_INT_EN)\r
+#define USBFS_1_ARB_EP8_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP8_INT_EN)\r
+#define USBFS_1_ARB_EP8_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_EP8_SR)\r
+#define USBFS_1_ARB_EP8_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_EP8_SR)\r
+\r
+#define USBFS_1_ARB_INT_EN_PTR     (  (reg8 *) USBFS_1_USB__ARB_INT_EN)\r
+#define USBFS_1_ARB_INT_EN_REG     (* (reg8 *) USBFS_1_USB__ARB_INT_EN)\r
+#define USBFS_1_ARB_INT_SR_PTR     (  (reg8 *) USBFS_1_USB__ARB_INT_SR)\r
+#define USBFS_1_ARB_INT_SR_REG     (* (reg8 *) USBFS_1_USB__ARB_INT_SR)\r
+\r
+#define USBFS_1_ARB_RW1_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW1_DR)\r
+#define USBFS_1_ARB_RW1_DR_IND     USBFS_1_USB__ARB_RW1_DR\r
+#define USBFS_1_ARB_RW1_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW1_RA)\r
+#define USBFS_1_ARB_RW1_RA_IND     USBFS_1_USB__ARB_RW1_RA\r
+#define USBFS_1_ARB_RW1_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_RA_MSB)\r
+#define USBFS_1_ARB_RW1_RA_MSB_IND USBFS_1_USB__ARB_RW1_RA_MSB\r
+#define USBFS_1_ARB_RW1_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW1_WA)\r
+#define USBFS_1_ARB_RW1_WA_IND     USBFS_1_USB__ARB_RW1_WA\r
+#define USBFS_1_ARB_RW1_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_WA_MSB)\r
+#define USBFS_1_ARB_RW1_WA_MSB_IND USBFS_1_USB__ARB_RW1_WA_MSB\r
+\r
+#define USBFS_1_ARB_RW2_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW2_DR)\r
+#define USBFS_1_ARB_RW2_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW2_RA)\r
+#define USBFS_1_ARB_RW2_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_RA_MSB)\r
+#define USBFS_1_ARB_RW2_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW2_WA)\r
+#define USBFS_1_ARB_RW2_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_WA_MSB)\r
+\r
+#define USBFS_1_ARB_RW3_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW3_DR)\r
+#define USBFS_1_ARB_RW3_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW3_RA)\r
+#define USBFS_1_ARB_RW3_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_RA_MSB)\r
+#define USBFS_1_ARB_RW3_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW3_WA)\r
+#define USBFS_1_ARB_RW3_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_WA_MSB)\r
+\r
+#define USBFS_1_ARB_RW4_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW4_DR)\r
+#define USBFS_1_ARB_RW4_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW4_RA)\r
+#define USBFS_1_ARB_RW4_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_RA_MSB)\r
+#define USBFS_1_ARB_RW4_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW4_WA)\r
+#define USBFS_1_ARB_RW4_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_WA_MSB)\r
+\r
+#define USBFS_1_ARB_RW5_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW5_DR)\r
+#define USBFS_1_ARB_RW5_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW5_RA)\r
+#define USBFS_1_ARB_RW5_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_RA_MSB)\r
+#define USBFS_1_ARB_RW5_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW5_WA)\r
+#define USBFS_1_ARB_RW5_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_WA_MSB)\r
+\r
+#define USBFS_1_ARB_RW6_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW6_DR)\r
+#define USBFS_1_ARB_RW6_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW6_RA)\r
+#define USBFS_1_ARB_RW6_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_RA_MSB)\r
+#define USBFS_1_ARB_RW6_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW6_WA)\r
+#define USBFS_1_ARB_RW6_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_WA_MSB)\r
+\r
+#define USBFS_1_ARB_RW7_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW7_DR)\r
+#define USBFS_1_ARB_RW7_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW7_RA)\r
+#define USBFS_1_ARB_RW7_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_RA_MSB)\r
+#define USBFS_1_ARB_RW7_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW7_WA)\r
+#define USBFS_1_ARB_RW7_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_WA_MSB)\r
+\r
+#define USBFS_1_ARB_RW8_DR_PTR     ((reg8 *) USBFS_1_USB__ARB_RW8_DR)\r
+#define USBFS_1_ARB_RW8_RA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW8_RA)\r
+#define USBFS_1_ARB_RW8_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_RA_MSB)\r
+#define USBFS_1_ARB_RW8_WA_PTR     ((reg8 *) USBFS_1_USB__ARB_RW8_WA)\r
+#define USBFS_1_ARB_RW8_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_WA_MSB)\r
+\r
+#define USBFS_1_BUF_SIZE_PTR       (  (reg8 *) USBFS_1_USB__BUF_SIZE)\r
+#define USBFS_1_BUF_SIZE_REG       (* (reg8 *) USBFS_1_USB__BUF_SIZE)\r
+#define USBFS_1_BUS_RST_CNT_PTR    (  (reg8 *) USBFS_1_USB__BUS_RST_CNT)\r
+#define USBFS_1_BUS_RST_CNT_REG    (* (reg8 *) USBFS_1_USB__BUS_RST_CNT)\r
+#define USBFS_1_CWA_PTR            (  (reg8 *) USBFS_1_USB__CWA)\r
+#define USBFS_1_CWA_REG            (* (reg8 *) USBFS_1_USB__CWA)\r
+#define USBFS_1_CWA_MSB_PTR        (  (reg8 *) USBFS_1_USB__CWA_MSB)\r
+#define USBFS_1_CWA_MSB_REG        (* (reg8 *) USBFS_1_USB__CWA_MSB)\r
+#define USBFS_1_CR0_PTR            (  (reg8 *) USBFS_1_USB__CR0)\r
+#define USBFS_1_CR0_REG            (* (reg8 *) USBFS_1_USB__CR0)\r
+#define USBFS_1_CR1_PTR            (  (reg8 *) USBFS_1_USB__CR1)\r
+#define USBFS_1_CR1_REG            (* (reg8 *) USBFS_1_USB__CR1)\r
+\r
+#define USBFS_1_DMA_THRES_PTR      (  (reg8 *) USBFS_1_USB__DMA_THRES)\r
+#define USBFS_1_DMA_THRES_REG      (* (reg8 *) USBFS_1_USB__DMA_THRES)\r
+#define USBFS_1_DMA_THRES_MSB_PTR  (  (reg8 *) USBFS_1_USB__DMA_THRES_MSB)\r
+#define USBFS_1_DMA_THRES_MSB_REG  (* (reg8 *) USBFS_1_USB__DMA_THRES_MSB)\r
+\r
+#define USBFS_1_EP_ACTIVE_PTR      (  (reg8 *) USBFS_1_USB__EP_ACTIVE)\r
+#define USBFS_1_EP_ACTIVE_REG      (* (reg8 *) USBFS_1_USB__EP_ACTIVE)\r
+#define USBFS_1_EP_TYPE_PTR        (  (reg8 *) USBFS_1_USB__EP_TYPE)\r
+#define USBFS_1_EP_TYPE_REG        (* (reg8 *) USBFS_1_USB__EP_TYPE)\r
+\r
+#define USBFS_1_EP0_CNT_PTR        (  (reg8 *) USBFS_1_USB__EP0_CNT)\r
+#define USBFS_1_EP0_CNT_REG        (* (reg8 *) USBFS_1_USB__EP0_CNT)\r
+#define USBFS_1_EP0_CR_PTR         (  (reg8 *) USBFS_1_USB__EP0_CR)\r
+#define USBFS_1_EP0_CR_REG         (* (reg8 *) USBFS_1_USB__EP0_CR)\r
+#define USBFS_1_EP0_DR0_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR0)\r
+#define USBFS_1_EP0_DR0_REG        (* (reg8 *) USBFS_1_USB__EP0_DR0)\r
+#define USBFS_1_EP0_DR0_IND        USBFS_1_USB__EP0_DR0\r
+#define USBFS_1_EP0_DR1_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR1)\r
+#define USBFS_1_EP0_DR1_REG        (* (reg8 *) USBFS_1_USB__EP0_DR1)\r
+#define USBFS_1_EP0_DR2_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR2)\r
+#define USBFS_1_EP0_DR2_REG        (* (reg8 *) USBFS_1_USB__EP0_DR2)\r
+#define USBFS_1_EP0_DR3_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR3)\r
+#define USBFS_1_EP0_DR3_REG        (* (reg8 *) USBFS_1_USB__EP0_DR3)\r
+#define USBFS_1_EP0_DR4_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR4)\r
+#define USBFS_1_EP0_DR4_REG        (* (reg8 *) USBFS_1_USB__EP0_DR4)\r
+#define USBFS_1_EP0_DR5_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR5)\r
+#define USBFS_1_EP0_DR5_REG        (* (reg8 *) USBFS_1_USB__EP0_DR5)\r
+#define USBFS_1_EP0_DR6_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR6)\r
+#define USBFS_1_EP0_DR6_REG        (* (reg8 *) USBFS_1_USB__EP0_DR6)\r
+#define USBFS_1_EP0_DR7_PTR        (  (reg8 *) USBFS_1_USB__EP0_DR7)\r
+#define USBFS_1_EP0_DR7_REG        (* (reg8 *) USBFS_1_USB__EP0_DR7)\r
+\r
+#define USBFS_1_OSCLK_DR0_PTR      (  (reg8 *) USBFS_1_USB__OSCLK_DR0)\r
+#define USBFS_1_OSCLK_DR0_REG      (* (reg8 *) USBFS_1_USB__OSCLK_DR0)\r
+#define USBFS_1_OSCLK_DR1_PTR      (  (reg8 *) USBFS_1_USB__OSCLK_DR1)\r
+#define USBFS_1_OSCLK_DR1_REG      (* (reg8 *) USBFS_1_USB__OSCLK_DR1)\r
+\r
+#define USBFS_1_PM_ACT_CFG_PTR     (  (reg8 *) USBFS_1_USB__PM_ACT_CFG)\r
+#define USBFS_1_PM_ACT_CFG_REG     (* (reg8 *) USBFS_1_USB__PM_ACT_CFG)\r
+#define USBFS_1_PM_STBY_CFG_PTR    (  (reg8 *) USBFS_1_USB__PM_STBY_CFG)\r
+#define USBFS_1_PM_STBY_CFG_REG    (* (reg8 *) USBFS_1_USB__PM_STBY_CFG)\r
+\r
+#define USBFS_1_SIE_EP_INT_EN_PTR  (  (reg8 *) USBFS_1_USB__SIE_EP_INT_EN)\r
+#define USBFS_1_SIE_EP_INT_EN_REG  (* (reg8 *) USBFS_1_USB__SIE_EP_INT_EN)\r
+#define USBFS_1_SIE_EP_INT_SR_PTR  (  (reg8 *) USBFS_1_USB__SIE_EP_INT_SR)\r
+#define USBFS_1_SIE_EP_INT_SR_REG  (* (reg8 *) USBFS_1_USB__SIE_EP_INT_SR)\r
+\r
+#define USBFS_1_SIE_EP1_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP1_CNT0)\r
+#define USBFS_1_SIE_EP1_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP1_CNT0)\r
+#define USBFS_1_SIE_EP1_CNT0_IND   USBFS_1_USB__SIE_EP1_CNT0\r
+#define USBFS_1_SIE_EP1_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP1_CNT1)\r
+#define USBFS_1_SIE_EP1_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP1_CNT1)\r
+#define USBFS_1_SIE_EP1_CNT1_IND   USBFS_1_USB__SIE_EP1_CNT1\r
+#define USBFS_1_SIE_EP1_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP1_CR0)\r
+#define USBFS_1_SIE_EP1_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP1_CR0)\r
+#define USBFS_1_SIE_EP1_CR0_IND    USBFS_1_USB__SIE_EP1_CR0\r
+\r
+#define USBFS_1_SIE_EP2_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP2_CNT0)\r
+#define USBFS_1_SIE_EP2_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP2_CNT0)\r
+#define USBFS_1_SIE_EP2_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP2_CNT1)\r
+#define USBFS_1_SIE_EP2_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP2_CNT1)\r
+#define USBFS_1_SIE_EP2_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP2_CR0)\r
+#define USBFS_1_SIE_EP2_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP2_CR0)\r
+\r
+#define USBFS_1_SIE_EP3_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP3_CNT0)\r
+#define USBFS_1_SIE_EP3_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP3_CNT0)\r
+#define USBFS_1_SIE_EP3_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP3_CNT1)\r
+#define USBFS_1_SIE_EP3_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP3_CNT1)\r
+#define USBFS_1_SIE_EP3_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP3_CR0)\r
+#define USBFS_1_SIE_EP3_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP3_CR0)\r
+\r
+#define USBFS_1_SIE_EP4_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP4_CNT0)\r
+#define USBFS_1_SIE_EP4_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP4_CNT0)\r
+#define USBFS_1_SIE_EP4_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP4_CNT1)\r
+#define USBFS_1_SIE_EP4_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP4_CNT1)\r
+#define USBFS_1_SIE_EP4_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP4_CR0)\r
+#define USBFS_1_SIE_EP4_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP4_CR0)\r
+\r
+#define USBFS_1_SIE_EP5_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP5_CNT0)\r
+#define USBFS_1_SIE_EP5_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP5_CNT0)\r
+#define USBFS_1_SIE_EP5_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP5_CNT1)\r
+#define USBFS_1_SIE_EP5_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP5_CNT1)\r
+#define USBFS_1_SIE_EP5_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP5_CR0)\r
+#define USBFS_1_SIE_EP5_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP5_CR0)\r
+\r
+#define USBFS_1_SIE_EP6_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP6_CNT0)\r
+#define USBFS_1_SIE_EP6_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP6_CNT0)\r
+#define USBFS_1_SIE_EP6_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP6_CNT1)\r
+#define USBFS_1_SIE_EP6_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP6_CNT1)\r
+#define USBFS_1_SIE_EP6_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP6_CR0)\r
+#define USBFS_1_SIE_EP6_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP6_CR0)\r
+\r
+#define USBFS_1_SIE_EP7_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP7_CNT0)\r
+#define USBFS_1_SIE_EP7_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP7_CNT0)\r
+#define USBFS_1_SIE_EP7_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP7_CNT1)\r
+#define USBFS_1_SIE_EP7_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP7_CNT1)\r
+#define USBFS_1_SIE_EP7_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP7_CR0)\r
+#define USBFS_1_SIE_EP7_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP7_CR0)\r
+\r
+#define USBFS_1_SIE_EP8_CNT0_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP8_CNT0)\r
+#define USBFS_1_SIE_EP8_CNT0_REG   (* (reg8 *) USBFS_1_USB__SIE_EP8_CNT0)\r
+#define USBFS_1_SIE_EP8_CNT1_PTR   (  (reg8 *) USBFS_1_USB__SIE_EP8_CNT1)\r
+#define USBFS_1_SIE_EP8_CNT1_REG   (* (reg8 *) USBFS_1_USB__SIE_EP8_CNT1)\r
+#define USBFS_1_SIE_EP8_CR0_PTR    (  (reg8 *) USBFS_1_USB__SIE_EP8_CR0)\r
+#define USBFS_1_SIE_EP8_CR0_REG    (* (reg8 *) USBFS_1_USB__SIE_EP8_CR0)\r
+\r
+#define USBFS_1_SOF0_PTR           (  (reg8 *) USBFS_1_USB__SOF0)\r
+#define USBFS_1_SOF0_REG           (* (reg8 *) USBFS_1_USB__SOF0)\r
+#define USBFS_1_SOF1_PTR           (  (reg8 *) USBFS_1_USB__SOF1)\r
+#define USBFS_1_SOF1_REG           (* (reg8 *) USBFS_1_USB__SOF1)\r
+\r
+#define USBFS_1_USB_CLK_EN_PTR     (  (reg8 *) USBFS_1_USB__USB_CLK_EN)\r
+#define USBFS_1_USB_CLK_EN_REG     (* (reg8 *) USBFS_1_USB__USB_CLK_EN)\r
+\r
+#define USBFS_1_USBIO_CR0_PTR      (  (reg8 *) USBFS_1_USB__USBIO_CR0)\r
+#define USBFS_1_USBIO_CR0_REG      (* (reg8 *) USBFS_1_USB__USBIO_CR0)\r
+#define USBFS_1_USBIO_CR1_PTR      (  (reg8 *) USBFS_1_USB__USBIO_CR1)\r
+#define USBFS_1_USBIO_CR1_REG      (* (reg8 *) USBFS_1_USB__USBIO_CR1)\r
+#if(!CY_PSOC5LP)\r
+    #define USBFS_1_USBIO_CR2_PTR      (  (reg8 *) USBFS_1_USB__USBIO_CR2)\r
+    #define USBFS_1_USBIO_CR2_REG      (* (reg8 *) USBFS_1_USB__USBIO_CR2)\r
+#endif /* End CY_PSOC5LP */\r
+\r
+#define USBFS_1_DIE_ID             CYDEV_FLSHID_CUST_TABLES_BASE\r
+\r
+#define USBFS_1_PM_USB_CR0_PTR     (  (reg8 *) CYREG_PM_USB_CR0)\r
+#define USBFS_1_PM_USB_CR0_REG     (* (reg8 *) CYREG_PM_USB_CR0)\r
+#define USBFS_1_DYN_RECONFIG_PTR   (  (reg8 *) USBFS_1_USB__DYN_RECONFIG)\r
+#define USBFS_1_DYN_RECONFIG_REG   (* (reg8 *) USBFS_1_USB__DYN_RECONFIG)\r
+\r
+#define USBFS_1_DM_INP_DIS_PTR     (  (reg8 *) USBFS_1_Dm__INP_DIS)\r
+#define USBFS_1_DM_INP_DIS_REG     (* (reg8 *) USBFS_1_Dm__INP_DIS)\r
+#define USBFS_1_DP_INP_DIS_PTR     (  (reg8 *) USBFS_1_Dp__INP_DIS)\r
+#define USBFS_1_DP_INP_DIS_REG     (* (reg8 *) USBFS_1_Dp__INP_DIS)\r
+#define USBFS_1_DP_INTSTAT_PTR     (  (reg8 *) USBFS_1_Dp__INTSTAT)\r
+#define USBFS_1_DP_INTSTAT_REG     (* (reg8 *) USBFS_1_Dp__INTSTAT)\r
+\r
+#if (USBFS_1_MON_VBUS == 1u)\r
+    #if (USBFS_1_EXTERN_VBUS == 0u)\r
+        #define USBFS_1_VBUS_DR_PTR        (  (reg8 *) USBFS_1_VBUS__DR)\r
+        #define USBFS_1_VBUS_DR_REG        (* (reg8 *) USBFS_1_VBUS__DR)\r
+        #define USBFS_1_VBUS_PS_PTR        (  (reg8 *) USBFS_1_VBUS__PS)\r
+        #define USBFS_1_VBUS_PS_REG        (* (reg8 *) USBFS_1_VBUS__PS)\r
+        #define USBFS_1_VBUS_MASK          USBFS_1_VBUS__MASK\r
+    #else\r
+        #define USBFS_1_VBUS_PS_PTR        (  (reg8 *) USBFS_1_Vbus_ps_sts_sts_reg__STATUS_REG )\r
+        #define USBFS_1_VBUS_MASK          (0x01u)\r
+    #endif /* End USBFS_1_EXTERN_VBUS == 0u */\r
+#endif /* End USBFS_1_MON_VBUS */\r
+\r
+/* Renamed Registers for backward compatibility.\r
+*  Should not be used in new designs.\r
+*/\r
+#define USBFS_1_ARB_CFG        USBFS_1_ARB_CFG_PTR\r
+\r
+#define USBFS_1_ARB_EP1_CFG    USBFS_1_ARB_EP1_CFG_PTR\r
+#define USBFS_1_ARB_EP1_INT_EN USBFS_1_ARB_EP1_INT_EN_PTR\r
+#define USBFS_1_ARB_EP1_SR     USBFS_1_ARB_EP1_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP2_CFG    USBFS_1_ARB_EP2_CFG_PTR\r
+#define USBFS_1_ARB_EP2_INT_EN USBFS_1_ARB_EP2_INT_EN_PTR\r
+#define USBFS_1_ARB_EP2_SR     USBFS_1_ARB_EP2_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP3_CFG    USBFS_1_ARB_EP3_CFG_PTR\r
+#define USBFS_1_ARB_EP3_INT_EN USBFS_1_ARB_EP3_INT_EN_PTR\r
+#define USBFS_1_ARB_EP3_SR     USBFS_1_ARB_EP3_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP4_CFG    USBFS_1_ARB_EP4_CFG_PTR\r
+#define USBFS_1_ARB_EP4_INT_EN USBFS_1_ARB_EP4_INT_EN_PTR\r
+#define USBFS_1_ARB_EP4_SR     USBFS_1_ARB_EP4_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP5_CFG    USBFS_1_ARB_EP5_CFG_PTR\r
+#define USBFS_1_ARB_EP5_INT_EN USBFS_1_ARB_EP5_INT_EN_PTR\r
+#define USBFS_1_ARB_EP5_SR     USBFS_1_ARB_EP5_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP6_CFG    USBFS_1_ARB_EP6_CFG_PTR\r
+#define USBFS_1_ARB_EP6_INT_EN USBFS_1_ARB_EP6_INT_EN_PTR\r
+#define USBFS_1_ARB_EP6_SR     USBFS_1_ARB_EP6_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP7_CFG    USBFS_1_ARB_EP7_CFG_PTR\r
+#define USBFS_1_ARB_EP7_INT_EN USBFS_1_ARB_EP7_INT_EN_PTR\r
+#define USBFS_1_ARB_EP7_SR     USBFS_1_ARB_EP7_SR_PTR\r
+\r
+#define USBFS_1_ARB_EP8_CFG    USBFS_1_ARB_EP8_CFG_PTR\r
+#define USBFS_1_ARB_EP8_INT_EN USBFS_1_ARB_EP8_INT_EN_PTR\r
+#define USBFS_1_ARB_EP8_SR     USBFS_1_ARB_EP8_SR_PTR\r
+\r
+#define USBFS_1_ARB_INT_EN     USBFS_1_ARB_INT_EN_PTR\r
+#define USBFS_1_ARB_INT_SR     USBFS_1_ARB_INT_SR_PTR\r
+\r
+#define USBFS_1_ARB_RW1_DR     USBFS_1_ARB_RW1_DR_PTR\r
+#define USBFS_1_ARB_RW1_RA     USBFS_1_ARB_RW1_RA_PTR\r
+#define USBFS_1_ARB_RW1_RA_MSB USBFS_1_ARB_RW1_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW1_WA     USBFS_1_ARB_RW1_WA_PTR\r
+#define USBFS_1_ARB_RW1_WA_MSB USBFS_1_ARB_RW1_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW2_DR     USBFS_1_ARB_RW2_DR_PTR\r
+#define USBFS_1_ARB_RW2_RA     USBFS_1_ARB_RW2_RA_PTR\r
+#define USBFS_1_ARB_RW2_RA_MSB USBFS_1_ARB_RW2_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW2_WA     USBFS_1_ARB_RW2_WA_PTR\r
+#define USBFS_1_ARB_RW2_WA_MSB USBFS_1_ARB_RW2_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW3_DR     USBFS_1_ARB_RW3_DR_PTR\r
+#define USBFS_1_ARB_RW3_RA     USBFS_1_ARB_RW3_RA_PTR\r
+#define USBFS_1_ARB_RW3_RA_MSB USBFS_1_ARB_RW3_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW3_WA     USBFS_1_ARB_RW3_WA_PTR\r
+#define USBFS_1_ARB_RW3_WA_MSB USBFS_1_ARB_RW3_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW4_DR     USBFS_1_ARB_RW4_DR_PTR\r
+#define USBFS_1_ARB_RW4_RA     USBFS_1_ARB_RW4_RA_PTR\r
+#define USBFS_1_ARB_RW4_RA_MSB USBFS_1_ARB_RW4_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW4_WA     USBFS_1_ARB_RW4_WA_PTR\r
+#define USBFS_1_ARB_RW4_WA_MSB USBFS_1_ARB_RW4_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW5_DR     USBFS_1_ARB_RW5_DR_PTR\r
+#define USBFS_1_ARB_RW5_RA     USBFS_1_ARB_RW5_RA_PTR\r
+#define USBFS_1_ARB_RW5_RA_MSB USBFS_1_ARB_RW5_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW5_WA     USBFS_1_ARB_RW5_WA_PTR\r
+#define USBFS_1_ARB_RW5_WA_MSB USBFS_1_ARB_RW5_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW6_DR     USBFS_1_ARB_RW6_DR_PTR\r
+#define USBFS_1_ARB_RW6_RA     USBFS_1_ARB_RW6_RA_PTR\r
+#define USBFS_1_ARB_RW6_RA_MSB USBFS_1_ARB_RW6_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW6_WA     USBFS_1_ARB_RW6_WA_PTR\r
+#define USBFS_1_ARB_RW6_WA_MSB USBFS_1_ARB_RW6_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW7_DR     USBFS_1_ARB_RW7_DR_PTR\r
+#define USBFS_1_ARB_RW7_RA     USBFS_1_ARB_RW7_RA_PTR\r
+#define USBFS_1_ARB_RW7_RA_MSB USBFS_1_ARB_RW7_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW7_WA     USBFS_1_ARB_RW7_WA_PTR\r
+#define USBFS_1_ARB_RW7_WA_MSB USBFS_1_ARB_RW7_WA_MSB_PTR\r
+\r
+#define USBFS_1_ARB_RW8_DR     USBFS_1_ARB_RW8_DR_PTR\r
+#define USBFS_1_ARB_RW8_RA     USBFS_1_ARB_RW8_RA_PTR\r
+#define USBFS_1_ARB_RW8_RA_MSB USBFS_1_ARB_RW8_RA_MSB_PTR\r
+#define USBFS_1_ARB_RW8_WA     USBFS_1_ARB_RW8_WA_PTR\r
+#define USBFS_1_ARB_RW8_WA_MSB USBFS_1_ARB_RW8_WA_MSB_PTR\r
+\r
+#define USBFS_1_BUF_SIZE       USBFS_1_BUF_SIZE_PTR\r
+#define USBFS_1_BUS_RST_CNT    USBFS_1_BUS_RST_CNT_PTR\r
+#define USBFS_1_CR0            USBFS_1_CR0_PTR\r
+#define USBFS_1_CR1            USBFS_1_CR1_PTR\r
+#define USBFS_1_CWA            USBFS_1_CWA_PTR\r
+#define USBFS_1_CWA_MSB        USBFS_1_CWA_MSB_PTR\r
+\r
+#define USBFS_1_DMA_THRES      USBFS_1_DMA_THRES_PTR\r
+#define USBFS_1_DMA_THRES_MSB  USBFS_1_DMA_THRES_MSB_PTR\r
+\r
+#define USBFS_1_EP_ACTIVE      USBFS_1_EP_ACTIVE_PTR\r
+#define USBFS_1_EP_TYPE        USBFS_1_EP_TYPE_PTR\r
+\r
+#define USBFS_1_EP0_CNT        USBFS_1_EP0_CNT_PTR\r
+#define USBFS_1_EP0_CR         USBFS_1_EP0_CR_PTR\r
+#define USBFS_1_EP0_DR0        USBFS_1_EP0_DR0_PTR\r
+#define USBFS_1_EP0_DR1        USBFS_1_EP0_DR1_PTR\r
+#define USBFS_1_EP0_DR2        USBFS_1_EP0_DR2_PTR\r
+#define USBFS_1_EP0_DR3        USBFS_1_EP0_DR3_PTR\r
+#define USBFS_1_EP0_DR4        USBFS_1_EP0_DR4_PTR\r
+#define USBFS_1_EP0_DR5        USBFS_1_EP0_DR5_PTR\r
+#define USBFS_1_EP0_DR6        USBFS_1_EP0_DR6_PTR\r
+#define USBFS_1_EP0_DR7        USBFS_1_EP0_DR7_PTR\r
+\r
+#define USBFS_1_OSCLK_DR0      USBFS_1_OSCLK_DR0_PTR\r
+#define USBFS_1_OSCLK_DR1      USBFS_1_OSCLK_DR1_PTR\r
+\r
+#define USBFS_1_PM_ACT_CFG     USBFS_1_PM_ACT_CFG_PTR\r
+#define USBFS_1_PM_STBY_CFG    USBFS_1_PM_STBY_CFG_PTR\r
+\r
+#define USBFS_1_SIE_EP_INT_EN  USBFS_1_SIE_EP_INT_EN_PTR\r
+#define USBFS_1_SIE_EP_INT_SR  USBFS_1_SIE_EP_INT_SR_PTR\r
+\r
+#define USBFS_1_SIE_EP1_CNT0   USBFS_1_SIE_EP1_CNT0_PTR\r
+#define USBFS_1_SIE_EP1_CNT1   USBFS_1_SIE_EP1_CNT1_PTR\r
+#define USBFS_1_SIE_EP1_CR0    USBFS_1_SIE_EP1_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP2_CNT0   USBFS_1_SIE_EP2_CNT0_PTR\r
+#define USBFS_1_SIE_EP2_CNT1   USBFS_1_SIE_EP2_CNT1_PTR\r
+#define USBFS_1_SIE_EP2_CR0    USBFS_1_SIE_EP2_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP3_CNT0   USBFS_1_SIE_EP3_CNT0_PTR\r
+#define USBFS_1_SIE_EP3_CNT1   USBFS_1_SIE_EP3_CNT1_PTR\r
+#define USBFS_1_SIE_EP3_CR0    USBFS_1_SIE_EP3_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP4_CNT0   USBFS_1_SIE_EP4_CNT0_PTR\r
+#define USBFS_1_SIE_EP4_CNT1   USBFS_1_SIE_EP4_CNT1_PTR\r
+#define USBFS_1_SIE_EP4_CR0    USBFS_1_SIE_EP4_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP5_CNT0   USBFS_1_SIE_EP5_CNT0_PTR\r
+#define USBFS_1_SIE_EP5_CNT1   USBFS_1_SIE_EP5_CNT1_PTR\r
+#define USBFS_1_SIE_EP5_CR0    USBFS_1_SIE_EP5_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP6_CNT0   USBFS_1_SIE_EP6_CNT0_PTR\r
+#define USBFS_1_SIE_EP6_CNT1   USBFS_1_SIE_EP6_CNT1_PTR\r
+#define USBFS_1_SIE_EP6_CR0    USBFS_1_SIE_EP6_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP7_CNT0   USBFS_1_SIE_EP7_CNT0_PTR\r
+#define USBFS_1_SIE_EP7_CNT1   USBFS_1_SIE_EP7_CNT1_PTR\r
+#define USBFS_1_SIE_EP7_CR0    USBFS_1_SIE_EP7_CR0_PTR\r
+\r
+#define USBFS_1_SIE_EP8_CNT0   USBFS_1_SIE_EP8_CNT0_PTR\r
+#define USBFS_1_SIE_EP8_CNT1   USBFS_1_SIE_EP8_CNT1_PTR\r
+#define USBFS_1_SIE_EP8_CR0    USBFS_1_SIE_EP8_CR0_PTR\r
+\r
+#define USBFS_1_SOF0           USBFS_1_SOF0_PTR\r
+#define USBFS_1_SOF1           USBFS_1_SOF1_PTR\r
+\r
+#define USBFS_1_USB_CLK_EN     USBFS_1_USB_CLK_EN_PTR\r
+\r
+#define USBFS_1_USBIO_CR0      USBFS_1_USBIO_CR0_PTR\r
+#define USBFS_1_USBIO_CR1      USBFS_1_USBIO_CR1_PTR\r
+#define USBFS_1_USBIO_CR2      USBFS_1_USBIO_CR2_PTR\r
+\r
+#define USBFS_1_USB_MEM        ((reg8 *) CYDEV_USB_MEM_BASE)\r
+\r
+#if(CYDEV_CHIP_DIE_EXPECT == CYDEV_CHIP_DIE_LEOPARD)\r
+    /* PSoC3 interrupt registers*/\r
+    #define USBFS_1_USB_ISR_PRIOR  ((reg8 *) CYDEV_INTC_PRIOR0)\r
+    #define USBFS_1_USB_ISR_SET_EN ((reg8 *) CYDEV_INTC_SET_EN0)\r
+    #define USBFS_1_USB_ISR_CLR_EN ((reg8 *) CYDEV_INTC_CLR_EN0)\r
+    #define USBFS_1_USB_ISR_VECT   ((cyisraddress *) CYDEV_INTC_VECT_MBASE)\r
+#elif(CYDEV_CHIP_DIE_EXPECT == CYDEV_CHIP_DIE_PANTHER)\r
+    /* PSoC5 interrupt registers*/\r
+    #define USBFS_1_USB_ISR_PRIOR  ((reg8 *) CYDEV_NVIC_PRI_0)\r
+    #define USBFS_1_USB_ISR_SET_EN ((reg8 *) CYDEV_NVIC_SETENA0)\r
+    #define USBFS_1_USB_ISR_CLR_EN ((reg8 *) CYDEV_NVIC_CLRENA0)\r
+    #define USBFS_1_USB_ISR_VECT   ((cyisraddress *) CYDEV_NVIC_VECT_OFFSET)\r
+#endif /* End CYDEV_CHIP_DIE_EXPECT */\r
+\r
+\r
+/***************************************\r
+* Interrupt vectors, masks and priorities\r
+***************************************/\r
+\r
+#define USBFS_1_BUS_RESET_PRIOR    USBFS_1_bus_reset__INTC_PRIOR_NUM\r
+#define USBFS_1_BUS_RESET_MASK     USBFS_1_bus_reset__INTC_MASK\r
+#define USBFS_1_BUS_RESET_VECT_NUM USBFS_1_bus_reset__INTC_NUMBER\r
+\r
+#define USBFS_1_SOF_PRIOR          USBFS_1_sof_int__INTC_PRIOR_NUM\r
+#define USBFS_1_SOF_MASK           USBFS_1_sof_int__INTC_MASK\r
+#define USBFS_1_SOF_VECT_NUM       USBFS_1_sof_int__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_0_PRIOR         USBFS_1_ep_0__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_0_MASK          USBFS_1_ep_0__INTC_MASK\r
+#define USBFS_1_EP_0_VECT_NUM      USBFS_1_ep_0__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_1_PRIOR         USBFS_1_ep_1__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_1_MASK          USBFS_1_ep_1__INTC_MASK\r
+#define USBFS_1_EP_1_VECT_NUM      USBFS_1_ep_1__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_2_PRIOR         USBFS_1_ep_2__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_2_MASK          USBFS_1_ep_2__INTC_MASK\r
+#define USBFS_1_EP_2_VECT_NUM      USBFS_1_ep_2__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_3_PRIOR         USBFS_1_ep_3__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_3_MASK          USBFS_1_ep_3__INTC_MASK\r
+#define USBFS_1_EP_3_VECT_NUM      USBFS_1_ep_3__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_4_PRIOR         USBFS_1_ep_4__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_4_MASK          USBFS_1_ep_4__INTC_MASK\r
+#define USBFS_1_EP_4_VECT_NUM      USBFS_1_ep_4__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_5_PRIOR         USBFS_1_ep_5__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_5_MASK          USBFS_1_ep_5__INTC_MASK\r
+#define USBFS_1_EP_5_VECT_NUM      USBFS_1_ep_5__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_6_PRIOR         USBFS_1_ep_6__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_6_MASK          USBFS_1_ep_6__INTC_MASK\r
+#define USBFS_1_EP_6_VECT_NUM      USBFS_1_ep_6__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_7_PRIOR         USBFS_1_ep_7__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_7_MASK          USBFS_1_ep_7__INTC_MASK\r
+#define USBFS_1_EP_7_VECT_NUM      USBFS_1_ep_7__INTC_NUMBER\r
+\r
+#define USBFS_1_EP_8_PRIOR         USBFS_1_ep_8__INTC_PRIOR_NUM\r
+#define USBFS_1_EP_8_MASK          USBFS_1_ep_8__INTC_MASK\r
+#define USBFS_1_EP_8_VECT_NUM      USBFS_1_ep_8__INTC_NUMBER\r
+\r
+#define USBFS_1_DP_INTC_PRIOR      USBFS_1_dp_int__INTC_PRIOR_NUM\r
+#define USBFS_1_DP_INTC_MASK       USBFS_1_dp_int__INTC_MASK\r
+#define USBFS_1_DP_INTC_VECT_NUM   USBFS_1_dp_int__INTC_NUMBER\r
+\r
+/* ARB ISR should have higher priority from EP_X ISR, therefore it is defined to highest (0) */\r
+#define USBFS_1_ARB_PRIOR          (0u)\r
+#define USBFS_1_ARB_MASK           USBFS_1_arb_int__INTC_MASK\r
+#define USBFS_1_ARB_VECT_NUM       USBFS_1_arb_int__INTC_NUMBER\r
+\r
+/***************************************\r
+ *  Endpoint 0 offsets (Table 9-2)\r
+ **************************************/\r
+\r
+#define USBFS_1_bmRequestType      USBFS_1_EP0_DR0_PTR\r
+#define USBFS_1_bRequest           USBFS_1_EP0_DR1_PTR\r
+#define USBFS_1_wValue             USBFS_1_EP0_DR2_PTR\r
+#define USBFS_1_wValueHi           USBFS_1_EP0_DR3_PTR\r
+#define USBFS_1_wValueLo           USBFS_1_EP0_DR2_PTR\r
+#define USBFS_1_wIndex             USBFS_1_EP0_DR4_PTR\r
+#define USBFS_1_wIndexHi           USBFS_1_EP0_DR5_PTR\r
+#define USBFS_1_wIndexLo           USBFS_1_EP0_DR4_PTR\r
+#define USBFS_1_length             USBFS_1_EP0_DR6_PTR\r
+#define USBFS_1_lengthHi           USBFS_1_EP0_DR7_PTR\r
+#define USBFS_1_lengthLo           USBFS_1_EP0_DR6_PTR\r
+\r
+\r
+/***************************************\r
+*       Register Constants\r
+***************************************/\r
+#define USBFS_1_VDDD_MV                    CYDEV_VDDD_MV\r
+#define USBFS_1_3500MV                     (3500u)\r
+\r
+#define USBFS_1_CR1_REG_ENABLE             (0x01u)\r
+#define USBFS_1_CR1_ENABLE_LOCK            (0x02u)\r
+#define USBFS_1_CR1_BUS_ACTIVITY_SHIFT     (0x02u)\r
+#define USBFS_1_CR1_BUS_ACTIVITY           ((uint8)(0x01u << USBFS_1_CR1_BUS_ACTIVITY_SHIFT))\r
+#define USBFS_1_CR1_TRIM_MSB_EN            (0x08u)\r
+\r
+#define USBFS_1_EP0_CNT_DATA_TOGGLE        (0x80u)\r
+#define USBFS_1_EPX_CNT_DATA_TOGGLE        (0x80u)\r
+#define USBFS_1_EPX_CNT0_MASK              (0x0Fu)\r
+#define USBFS_1_EPX_CNTX_MSB_MASK          (0x07u)\r
+#define USBFS_1_EPX_CNTX_ADDR_SHIFT        (0x04u)\r
+#define USBFS_1_EPX_CNTX_ADDR_OFFSET       (0x10u)\r
+#define USBFS_1_EPX_CNTX_CRC_COUNT         (0x02u)\r
+#define USBFS_1_EPX_DATA_BUF_MAX           (512u)\r
+\r
+#define USBFS_1_CR0_ENABLE                 (0x80u)\r
+\r
+/* A 100 KHz clock is used for BUS reset count. Recommended is to count 10 pulses */\r
+#define USBFS_1_BUS_RST_COUNT              (0x0au)\r
+\r
+#define USBFS_1_USBIO_CR1_IOMODE           (0x20u)\r
+#define USBFS_1_USBIO_CR1_USBPUEN          (0x04u)\r
+#define USBFS_1_USBIO_CR1_DP0              (0x02u)\r
+#define USBFS_1_USBIO_CR1_DM0              (0x01u)\r
+\r
+#define USBFS_1_USBIO_CR0_TEN              (0x80u)\r
+#define USBFS_1_USBIO_CR0_TSE0             (0x40u)\r
+#define USBFS_1_USBIO_CR0_TD               (0x20u)\r
+#define USBFS_1_USBIO_CR0_RD               (0x01u)\r
+\r
+#define USBFS_1_FASTCLK_IMO_CR_USBCLK_ON   (0x40u)\r
+#define USBFS_1_FASTCLK_IMO_CR_XCLKEN      (0x20u)\r
+#define USBFS_1_FASTCLK_IMO_CR_FX2ON       (0x10u)\r
+\r
+#define USBFS_1_ARB_EPX_CFG_RESET          (0x08u)\r
+#define USBFS_1_ARB_EPX_CFG_CRC_BYPASS     (0x04u)\r
+#define USBFS_1_ARB_EPX_CFG_DMA_REQ        (0x02u)\r
+#define USBFS_1_ARB_EPX_CFG_IN_DATA_RDY    (0x01u)\r
+\r
+#define USBFS_1_ARB_EPX_SR_IN_BUF_FULL     (0x01u)\r
+#define USBFS_1_ARB_EPX_SR_DMA_GNT         (0x02u)\r
+#define USBFS_1_ARB_EPX_SR_BUF_OVER        (0x04u)\r
+#define USBFS_1_ARB_EPX_SR_BUF_UNDER       (0x08u)\r
+\r
+#define USBFS_1_ARB_CFG_AUTO_MEM           (0x10u)\r
+#define USBFS_1_ARB_CFG_MANUAL_DMA         (0x20u)\r
+#define USBFS_1_ARB_CFG_AUTO_DMA           (0x40u)\r
+#define USBFS_1_ARB_CFG_CFG_CPM            (0x80u)\r
+\r
+#if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)\r
+    #define USBFS_1_ARB_EPX_INT_MASK           (0x1Du)\r
+#else\r
+    #define USBFS_1_ARB_EPX_INT_MASK           (0x1Fu)\r
+#endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */\r
+#define USBFS_1_ARB_INT_MASK       (uint8)((USBFS_1_DMA1_REMOVE ^ 1u) | \\r
+                                            (uint8)((USBFS_1_DMA2_REMOVE ^ 1u) << 1u) | \\r
+                                            (uint8)((USBFS_1_DMA3_REMOVE ^ 1u) << 2u) | \\r
+                                            (uint8)((USBFS_1_DMA4_REMOVE ^ 1u) << 3u) | \\r
+                                            (uint8)((USBFS_1_DMA5_REMOVE ^ 1u) << 4u) | \\r
+                                            (uint8)((USBFS_1_DMA6_REMOVE ^ 1u) << 5u) | \\r
+                                            (uint8)((USBFS_1_DMA7_REMOVE ^ 1u) << 6u) | \\r
+                                            (uint8)((USBFS_1_DMA8_REMOVE ^ 1u) << 7u) )\r
+\r
+#define USBFS_1_SIE_EP_INT_EP1_MASK        (0x01u)\r
+#define USBFS_1_SIE_EP_INT_EP2_MASK        (0x02u)\r
+#define USBFS_1_SIE_EP_INT_EP3_MASK        (0x04u)\r
+#define USBFS_1_SIE_EP_INT_EP4_MASK        (0x08u)\r
+#define USBFS_1_SIE_EP_INT_EP5_MASK        (0x10u)\r
+#define USBFS_1_SIE_EP_INT_EP6_MASK        (0x20u)\r
+#define USBFS_1_SIE_EP_INT_EP7_MASK        (0x40u)\r
+#define USBFS_1_SIE_EP_INT_EP8_MASK        (0x80u)\r
+\r
+#define USBFS_1_PM_ACT_EN_FSUSB            USBFS_1_USB__PM_ACT_MSK\r
+#define USBFS_1_PM_STBY_EN_FSUSB           USBFS_1_USB__PM_STBY_MSK\r
+#define USBFS_1_PM_AVAIL_EN_FSUSBIO        (0x10u)\r
+\r
+#define USBFS_1_PM_USB_CR0_REF_EN          (0x01u)\r
+#define USBFS_1_PM_USB_CR0_PD_N            (0x02u)\r
+#define USBFS_1_PM_USB_CR0_PD_PULLUP_N     (0x04u)\r
+\r
+#define USBFS_1_USB_CLK_ENABLE             (0x01u)\r
+\r
+#define USBFS_1_DM_MASK                    USBFS_1_Dm__0__MASK\r
+#define USBFS_1_DP_MASK                    USBFS_1_Dp__0__MASK\r
+\r
+#define USBFS_1_DYN_RECONFIG_ENABLE        (0x01u)\r
+#define USBFS_1_DYN_RECONFIG_EP_SHIFT      (0x01u)\r
+#define USBFS_1_DYN_RECONFIG_RDY_STS       (0x10u)\r
+\r
+\r
+#endif /* End CY_USBFS_USBFS_1_H */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm.c
new file mode 100644 (file)
index 0000000..06f9327
--- /dev/null
@@ -0,0 +1,137 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_Dm.c  \r
+* Version 1.90\r
+*\r
+* Description:\r
+*  This file contains API to enable firmware control of a Pins component.\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2012, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions, \r
+* disclaimers, and limitations in the end user license agreement accompanying \r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "cytypes.h"\r
+#include "USBFS_1_Dm.h"\r
+\r
+/* APIs are not generated for P15[7:6] on PSoC 5 */\r
+#if !(CY_PSOC5A &&\\r
+        USBFS_1_Dm__PORT == 15 && ((USBFS_1_Dm__MASK & 0xC0) != 0))\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dm_Write\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Assign a new value to the digital port's data output register.  \r
+*\r
+* Parameters:  \r
+*  prtValue:  The value to be assigned to the Digital Port. \r
+*\r
+* Return: \r
+*  None\r
+*  \r
+*******************************************************************************/\r
+void USBFS_1_Dm_Write(uint8 value) \r
+{\r
+    uint8 staticBits = (USBFS_1_Dm_DR & (uint8)(~USBFS_1_Dm_MASK));\r
+    USBFS_1_Dm_DR = staticBits | ((uint8)(value << USBFS_1_Dm_SHIFT) & USBFS_1_Dm_MASK);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dm_SetDriveMode\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Change the drive mode on the pins of the port.\r
+* \r
+* Parameters:  \r
+*  mode:  Change the pins to this drive mode.\r
+*\r
+* Return: \r
+*  None\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_Dm_SetDriveMode(uint8 mode) \r
+{\r
+       CyPins_SetPinDriveMode(USBFS_1_Dm_0, mode);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dm_Read\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Read the current value on the pins of the Digital Port in right justified \r
+*  form.\r
+*\r
+* Parameters:  \r
+*  None\r
+*\r
+* Return: \r
+*  Returns the current value of the Digital Port as a right justified number\r
+*  \r
+* Note:\r
+*  Macro USBFS_1_Dm_ReadPS calls this function. \r
+*  \r
+*******************************************************************************/\r
+uint8 USBFS_1_Dm_Read(void) \r
+{\r
+    return (USBFS_1_Dm_PS & USBFS_1_Dm_MASK) >> USBFS_1_Dm_SHIFT;\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dm_ReadDataReg\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Read the current value assigned to a Digital Port's data output register\r
+*\r
+* Parameters:  \r
+*  None \r
+*\r
+* Return: \r
+*  Returns the current value assigned to the Digital Port's data output register\r
+*  \r
+*******************************************************************************/\r
+uint8 USBFS_1_Dm_ReadDataReg(void) \r
+{\r
+    return (USBFS_1_Dm_DR & USBFS_1_Dm_MASK) >> USBFS_1_Dm_SHIFT;\r
+}\r
+\r
+\r
+/* If Interrupts Are Enabled for this Pins component */ \r
+#if defined(USBFS_1_Dm_INTSTAT) \r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_Dm_ClearInterrupt\r
+    ********************************************************************************\r
+    * Summary:\r
+    *  Clears any active interrupts attached to port and returns the value of the \r
+    *  interrupt status register.\r
+    *\r
+    * Parameters:  \r
+    *  None \r
+    *\r
+    * Return: \r
+    *  Returns the value of the interrupt status register\r
+    *  \r
+    *******************************************************************************/\r
+    uint8 USBFS_1_Dm_ClearInterrupt(void) \r
+    {\r
+        return (USBFS_1_Dm_INTSTAT & USBFS_1_Dm_MASK) >> USBFS_1_Dm_SHIFT;\r
+    }\r
+\r
+#endif /* If Interrupts Are Enabled for this Pins component */ \r
+\r
+#endif /* CY_PSOC5A... */\r
+\r
+    \r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm.h
new file mode 100644 (file)
index 0000000..b331e92
--- /dev/null
@@ -0,0 +1,130 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_Dm.h  \r
+* Version 1.90\r
+*\r
+* Description:\r
+*  This file containts Control Register function prototypes and register defines\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2012, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions, \r
+* disclaimers, and limitations in the end user license agreement accompanying \r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_PINS_USBFS_1_Dm_H) /* Pins USBFS_1_Dm_H */\r
+#define CY_PINS_USBFS_1_Dm_H\r
+\r
+#include "cytypes.h"\r
+#include "cyfitter.h"\r
+#include "cypins.h"\r
+#include "USBFS_1_Dm_aliases.h"\r
+\r
+/* Check to see if required defines such as CY_PSOC5A are available */\r
+/* They are defined starting with cy_boot v3.0 */\r
+#if !defined (CY_PSOC5A)\r
+    #error Component cy_pins_v1_90 requires cy_boot v3.0 or later\r
+#endif /* (CY_PSOC5A) */\r
+\r
+/* APIs are not generated for P15[7:6] */\r
+#if !(CY_PSOC5A &&\\r
+        USBFS_1_Dm__PORT == 15 && ((USBFS_1_Dm__MASK & 0xC0) != 0))\r
+\r
+\r
+/***************************************\r
+*        Function Prototypes             \r
+***************************************/    \r
+\r
+void    USBFS_1_Dm_Write(uint8 value) ;\r
+void    USBFS_1_Dm_SetDriveMode(uint8 mode) ;\r
+uint8   USBFS_1_Dm_ReadDataReg(void) ;\r
+uint8   USBFS_1_Dm_Read(void) ;\r
+uint8   USBFS_1_Dm_ClearInterrupt(void) ;\r
+\r
+\r
+/***************************************\r
+*           API Constants        \r
+***************************************/\r
+\r
+/* Drive Modes */\r
+#define USBFS_1_Dm_DM_ALG_HIZ         PIN_DM_ALG_HIZ\r
+#define USBFS_1_Dm_DM_DIG_HIZ         PIN_DM_DIG_HIZ\r
+#define USBFS_1_Dm_DM_RES_UP          PIN_DM_RES_UP\r
+#define USBFS_1_Dm_DM_RES_DWN         PIN_DM_RES_DWN\r
+#define USBFS_1_Dm_DM_OD_LO           PIN_DM_OD_LO\r
+#define USBFS_1_Dm_DM_OD_HI           PIN_DM_OD_HI\r
+#define USBFS_1_Dm_DM_STRONG          PIN_DM_STRONG\r
+#define USBFS_1_Dm_DM_RES_UPDWN       PIN_DM_RES_UPDWN\r
+\r
+/* Digital Port Constants */\r
+#define USBFS_1_Dm_MASK               USBFS_1_Dm__MASK\r
+#define USBFS_1_Dm_SHIFT              USBFS_1_Dm__SHIFT\r
+#define USBFS_1_Dm_WIDTH              1u\r
+\r
+\r
+/***************************************\r
+*             Registers        \r
+***************************************/\r
+\r
+/* Main Port Registers */\r
+/* Pin State */\r
+#define USBFS_1_Dm_PS                     (* (reg8 *) USBFS_1_Dm__PS)\r
+/* Data Register */\r
+#define USBFS_1_Dm_DR                     (* (reg8 *) USBFS_1_Dm__DR)\r
+/* Port Number */\r
+#define USBFS_1_Dm_PRT_NUM                (* (reg8 *) USBFS_1_Dm__PRT) \r
+/* Connect to Analog Globals */                                                  \r
+#define USBFS_1_Dm_AG                     (* (reg8 *) USBFS_1_Dm__AG)                       \r
+/* Analog MUX bux enable */\r
+#define USBFS_1_Dm_AMUX                   (* (reg8 *) USBFS_1_Dm__AMUX) \r
+/* Bidirectional Enable */                                                        \r
+#define USBFS_1_Dm_BIE                    (* (reg8 *) USBFS_1_Dm__BIE)\r
+/* Bit-mask for Aliased Register Access */\r
+#define USBFS_1_Dm_BIT_MASK               (* (reg8 *) USBFS_1_Dm__BIT_MASK)\r
+/* Bypass Enable */\r
+#define USBFS_1_Dm_BYP                    (* (reg8 *) USBFS_1_Dm__BYP)\r
+/* Port wide control signals */                                                   \r
+#define USBFS_1_Dm_CTL                    (* (reg8 *) USBFS_1_Dm__CTL)\r
+/* Drive Modes */\r
+#define USBFS_1_Dm_DM0                    (* (reg8 *) USBFS_1_Dm__DM0) \r
+#define USBFS_1_Dm_DM1                    (* (reg8 *) USBFS_1_Dm__DM1)\r
+#define USBFS_1_Dm_DM2                    (* (reg8 *) USBFS_1_Dm__DM2) \r
+/* Input Buffer Disable Override */\r
+#define USBFS_1_Dm_INP_DIS                (* (reg8 *) USBFS_1_Dm__INP_DIS)\r
+/* LCD Common or Segment Drive */\r
+#define USBFS_1_Dm_LCD_COM_SEG            (* (reg8 *) USBFS_1_Dm__LCD_COM_SEG)\r
+/* Enable Segment LCD */\r
+#define USBFS_1_Dm_LCD_EN                 (* (reg8 *) USBFS_1_Dm__LCD_EN)\r
+/* Slew Rate Control */\r
+#define USBFS_1_Dm_SLW                    (* (reg8 *) USBFS_1_Dm__SLW)\r
+\r
+/* DSI Port Registers */\r
+/* Global DSI Select Register */\r
+#define USBFS_1_Dm_PRTDSI__CAPS_SEL       (* (reg8 *) USBFS_1_Dm__PRTDSI__CAPS_SEL) \r
+/* Double Sync Enable */\r
+#define USBFS_1_Dm_PRTDSI__DBL_SYNC_IN    (* (reg8 *) USBFS_1_Dm__PRTDSI__DBL_SYNC_IN) \r
+/* Output Enable Select Drive Strength */\r
+#define USBFS_1_Dm_PRTDSI__OE_SEL0        (* (reg8 *) USBFS_1_Dm__PRTDSI__OE_SEL0) \r
+#define USBFS_1_Dm_PRTDSI__OE_SEL1        (* (reg8 *) USBFS_1_Dm__PRTDSI__OE_SEL1) \r
+/* Port Pin Output Select Registers */\r
+#define USBFS_1_Dm_PRTDSI__OUT_SEL0       (* (reg8 *) USBFS_1_Dm__PRTDSI__OUT_SEL0) \r
+#define USBFS_1_Dm_PRTDSI__OUT_SEL1       (* (reg8 *) USBFS_1_Dm__PRTDSI__OUT_SEL1) \r
+/* Sync Output Enable Registers */\r
+#define USBFS_1_Dm_PRTDSI__SYNC_OUT       (* (reg8 *) USBFS_1_Dm__PRTDSI__SYNC_OUT) \r
+\r
+\r
+#if defined(USBFS_1_Dm__INTSTAT)  /* Interrupt Registers */\r
+\r
+    #define USBFS_1_Dm_INTSTAT                (* (reg8 *) USBFS_1_Dm__INTSTAT)\r
+    #define USBFS_1_Dm_SNAP                   (* (reg8 *) USBFS_1_Dm__SNAP)\r
+\r
+#endif /* Interrupt Registers */\r
+\r
+#endif /* CY_PSOC5A... */\r
+\r
+#endif /*  CY_PINS_USBFS_1_Dm_H */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm_aliases.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dm_aliases.h
new file mode 100644 (file)
index 0000000..c1e6145
--- /dev/null
@@ -0,0 +1,32 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_Dm.h  \r
+* Version 1.90\r
+*\r
+* Description:\r
+*  This file containts Control Register function prototypes and register defines\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2012, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions, \r
+* disclaimers, and limitations in the end user license agreement accompanying \r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_PINS_USBFS_1_Dm_ALIASES_H) /* Pins USBFS_1_Dm_ALIASES_H */\r
+#define CY_PINS_USBFS_1_Dm_ALIASES_H\r
+\r
+#include "cytypes.h"\r
+#include "cyfitter.h"\r
+\r
+\r
+\r
+/***************************************\r
+*              Constants        \r
+***************************************/\r
+#define USBFS_1_Dm_0           USBFS_1_Dm__0__PC\r
+\r
+#endif /* End Pins USBFS_1_Dm_ALIASES_H */\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp.c
new file mode 100644 (file)
index 0000000..e805597
--- /dev/null
@@ -0,0 +1,137 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_Dp.c  \r
+* Version 1.90\r
+*\r
+* Description:\r
+*  This file contains API to enable firmware control of a Pins component.\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2012, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions, \r
+* disclaimers, and limitations in the end user license agreement accompanying \r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "cytypes.h"\r
+#include "USBFS_1_Dp.h"\r
+\r
+/* APIs are not generated for P15[7:6] on PSoC 5 */\r
+#if !(CY_PSOC5A &&\\r
+        USBFS_1_Dp__PORT == 15 && ((USBFS_1_Dp__MASK & 0xC0) != 0))\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dp_Write\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Assign a new value to the digital port's data output register.  \r
+*\r
+* Parameters:  \r
+*  prtValue:  The value to be assigned to the Digital Port. \r
+*\r
+* Return: \r
+*  None\r
+*  \r
+*******************************************************************************/\r
+void USBFS_1_Dp_Write(uint8 value) \r
+{\r
+    uint8 staticBits = (USBFS_1_Dp_DR & (uint8)(~USBFS_1_Dp_MASK));\r
+    USBFS_1_Dp_DR = staticBits | ((uint8)(value << USBFS_1_Dp_SHIFT) & USBFS_1_Dp_MASK);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dp_SetDriveMode\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Change the drive mode on the pins of the port.\r
+* \r
+* Parameters:  \r
+*  mode:  Change the pins to this drive mode.\r
+*\r
+* Return: \r
+*  None\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_Dp_SetDriveMode(uint8 mode) \r
+{\r
+       CyPins_SetPinDriveMode(USBFS_1_Dp_0, mode);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dp_Read\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Read the current value on the pins of the Digital Port in right justified \r
+*  form.\r
+*\r
+* Parameters:  \r
+*  None\r
+*\r
+* Return: \r
+*  Returns the current value of the Digital Port as a right justified number\r
+*  \r
+* Note:\r
+*  Macro USBFS_1_Dp_ReadPS calls this function. \r
+*  \r
+*******************************************************************************/\r
+uint8 USBFS_1_Dp_Read(void) \r
+{\r
+    return (USBFS_1_Dp_PS & USBFS_1_Dp_MASK) >> USBFS_1_Dp_SHIFT;\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_Dp_ReadDataReg\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Read the current value assigned to a Digital Port's data output register\r
+*\r
+* Parameters:  \r
+*  None \r
+*\r
+* Return: \r
+*  Returns the current value assigned to the Digital Port's data output register\r
+*  \r
+*******************************************************************************/\r
+uint8 USBFS_1_Dp_ReadDataReg(void) \r
+{\r
+    return (USBFS_1_Dp_DR & USBFS_1_Dp_MASK) >> USBFS_1_Dp_SHIFT;\r
+}\r
+\r
+\r
+/* If Interrupts Are Enabled for this Pins component */ \r
+#if defined(USBFS_1_Dp_INTSTAT) \r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_Dp_ClearInterrupt\r
+    ********************************************************************************\r
+    * Summary:\r
+    *  Clears any active interrupts attached to port and returns the value of the \r
+    *  interrupt status register.\r
+    *\r
+    * Parameters:  \r
+    *  None \r
+    *\r
+    * Return: \r
+    *  Returns the value of the interrupt status register\r
+    *  \r
+    *******************************************************************************/\r
+    uint8 USBFS_1_Dp_ClearInterrupt(void) \r
+    {\r
+        return (USBFS_1_Dp_INTSTAT & USBFS_1_Dp_MASK) >> USBFS_1_Dp_SHIFT;\r
+    }\r
+\r
+#endif /* If Interrupts Are Enabled for this Pins component */ \r
+\r
+#endif /* CY_PSOC5A... */\r
+\r
+    \r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp.h
new file mode 100644 (file)
index 0000000..bbda80a
--- /dev/null
@@ -0,0 +1,130 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_Dp.h  \r
+* Version 1.90\r
+*\r
+* Description:\r
+*  This file containts Control Register function prototypes and register defines\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2012, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions, \r
+* disclaimers, and limitations in the end user license agreement accompanying \r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_PINS_USBFS_1_Dp_H) /* Pins USBFS_1_Dp_H */\r
+#define CY_PINS_USBFS_1_Dp_H\r
+\r
+#include "cytypes.h"\r
+#include "cyfitter.h"\r
+#include "cypins.h"\r
+#include "USBFS_1_Dp_aliases.h"\r
+\r
+/* Check to see if required defines such as CY_PSOC5A are available */\r
+/* They are defined starting with cy_boot v3.0 */\r
+#if !defined (CY_PSOC5A)\r
+    #error Component cy_pins_v1_90 requires cy_boot v3.0 or later\r
+#endif /* (CY_PSOC5A) */\r
+\r
+/* APIs are not generated for P15[7:6] */\r
+#if !(CY_PSOC5A &&\\r
+        USBFS_1_Dp__PORT == 15 && ((USBFS_1_Dp__MASK & 0xC0) != 0))\r
+\r
+\r
+/***************************************\r
+*        Function Prototypes             \r
+***************************************/    \r
+\r
+void    USBFS_1_Dp_Write(uint8 value) ;\r
+void    USBFS_1_Dp_SetDriveMode(uint8 mode) ;\r
+uint8   USBFS_1_Dp_ReadDataReg(void) ;\r
+uint8   USBFS_1_Dp_Read(void) ;\r
+uint8   USBFS_1_Dp_ClearInterrupt(void) ;\r
+\r
+\r
+/***************************************\r
+*           API Constants        \r
+***************************************/\r
+\r
+/* Drive Modes */\r
+#define USBFS_1_Dp_DM_ALG_HIZ         PIN_DM_ALG_HIZ\r
+#define USBFS_1_Dp_DM_DIG_HIZ         PIN_DM_DIG_HIZ\r
+#define USBFS_1_Dp_DM_RES_UP          PIN_DM_RES_UP\r
+#define USBFS_1_Dp_DM_RES_DWN         PIN_DM_RES_DWN\r
+#define USBFS_1_Dp_DM_OD_LO           PIN_DM_OD_LO\r
+#define USBFS_1_Dp_DM_OD_HI           PIN_DM_OD_HI\r
+#define USBFS_1_Dp_DM_STRONG          PIN_DM_STRONG\r
+#define USBFS_1_Dp_DM_RES_UPDWN       PIN_DM_RES_UPDWN\r
+\r
+/* Digital Port Constants */\r
+#define USBFS_1_Dp_MASK               USBFS_1_Dp__MASK\r
+#define USBFS_1_Dp_SHIFT              USBFS_1_Dp__SHIFT\r
+#define USBFS_1_Dp_WIDTH              1u\r
+\r
+\r
+/***************************************\r
+*             Registers        \r
+***************************************/\r
+\r
+/* Main Port Registers */\r
+/* Pin State */\r
+#define USBFS_1_Dp_PS                     (* (reg8 *) USBFS_1_Dp__PS)\r
+/* Data Register */\r
+#define USBFS_1_Dp_DR                     (* (reg8 *) USBFS_1_Dp__DR)\r
+/* Port Number */\r
+#define USBFS_1_Dp_PRT_NUM                (* (reg8 *) USBFS_1_Dp__PRT) \r
+/* Connect to Analog Globals */                                                  \r
+#define USBFS_1_Dp_AG                     (* (reg8 *) USBFS_1_Dp__AG)                       \r
+/* Analog MUX bux enable */\r
+#define USBFS_1_Dp_AMUX                   (* (reg8 *) USBFS_1_Dp__AMUX) \r
+/* Bidirectional Enable */                                                        \r
+#define USBFS_1_Dp_BIE                    (* (reg8 *) USBFS_1_Dp__BIE)\r
+/* Bit-mask for Aliased Register Access */\r
+#define USBFS_1_Dp_BIT_MASK               (* (reg8 *) USBFS_1_Dp__BIT_MASK)\r
+/* Bypass Enable */\r
+#define USBFS_1_Dp_BYP                    (* (reg8 *) USBFS_1_Dp__BYP)\r
+/* Port wide control signals */                                                   \r
+#define USBFS_1_Dp_CTL                    (* (reg8 *) USBFS_1_Dp__CTL)\r
+/* Drive Modes */\r
+#define USBFS_1_Dp_DM0                    (* (reg8 *) USBFS_1_Dp__DM0) \r
+#define USBFS_1_Dp_DM1                    (* (reg8 *) USBFS_1_Dp__DM1)\r
+#define USBFS_1_Dp_DM2                    (* (reg8 *) USBFS_1_Dp__DM2) \r
+/* Input Buffer Disable Override */\r
+#define USBFS_1_Dp_INP_DIS                (* (reg8 *) USBFS_1_Dp__INP_DIS)\r
+/* LCD Common or Segment Drive */\r
+#define USBFS_1_Dp_LCD_COM_SEG            (* (reg8 *) USBFS_1_Dp__LCD_COM_SEG)\r
+/* Enable Segment LCD */\r
+#define USBFS_1_Dp_LCD_EN                 (* (reg8 *) USBFS_1_Dp__LCD_EN)\r
+/* Slew Rate Control */\r
+#define USBFS_1_Dp_SLW                    (* (reg8 *) USBFS_1_Dp__SLW)\r
+\r
+/* DSI Port Registers */\r
+/* Global DSI Select Register */\r
+#define USBFS_1_Dp_PRTDSI__CAPS_SEL       (* (reg8 *) USBFS_1_Dp__PRTDSI__CAPS_SEL) \r
+/* Double Sync Enable */\r
+#define USBFS_1_Dp_PRTDSI__DBL_SYNC_IN    (* (reg8 *) USBFS_1_Dp__PRTDSI__DBL_SYNC_IN) \r
+/* Output Enable Select Drive Strength */\r
+#define USBFS_1_Dp_PRTDSI__OE_SEL0        (* (reg8 *) USBFS_1_Dp__PRTDSI__OE_SEL0) \r
+#define USBFS_1_Dp_PRTDSI__OE_SEL1        (* (reg8 *) USBFS_1_Dp__PRTDSI__OE_SEL1) \r
+/* Port Pin Output Select Registers */\r
+#define USBFS_1_Dp_PRTDSI__OUT_SEL0       (* (reg8 *) USBFS_1_Dp__PRTDSI__OUT_SEL0) \r
+#define USBFS_1_Dp_PRTDSI__OUT_SEL1       (* (reg8 *) USBFS_1_Dp__PRTDSI__OUT_SEL1) \r
+/* Sync Output Enable Registers */\r
+#define USBFS_1_Dp_PRTDSI__SYNC_OUT       (* (reg8 *) USBFS_1_Dp__PRTDSI__SYNC_OUT) \r
+\r
+\r
+#if defined(USBFS_1_Dp__INTSTAT)  /* Interrupt Registers */\r
+\r
+    #define USBFS_1_Dp_INTSTAT                (* (reg8 *) USBFS_1_Dp__INTSTAT)\r
+    #define USBFS_1_Dp_SNAP                   (* (reg8 *) USBFS_1_Dp__SNAP)\r
+\r
+#endif /* Interrupt Registers */\r
+\r
+#endif /* CY_PSOC5A... */\r
+\r
+#endif /*  CY_PINS_USBFS_1_Dp_H */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp_aliases.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_Dp_aliases.h
new file mode 100644 (file)
index 0000000..bd02d71
--- /dev/null
@@ -0,0 +1,32 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_Dp.h  \r
+* Version 1.90\r
+*\r
+* Description:\r
+*  This file containts Control Register function prototypes and register defines\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2012, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions, \r
+* disclaimers, and limitations in the end user license agreement accompanying \r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_PINS_USBFS_1_Dp_ALIASES_H) /* Pins USBFS_1_Dp_ALIASES_H */\r
+#define CY_PINS_USBFS_1_Dp_ALIASES_H\r
+\r
+#include "cytypes.h"\r
+#include "cyfitter.h"\r
+\r
+\r
+\r
+/***************************************\r
+*              Constants        \r
+***************************************/\r
+#define USBFS_1_Dp_0           USBFS_1_Dp__0__PC\r
+\r
+#endif /* End Pins USBFS_1_Dp_ALIASES_H */\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_audio.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_audio.c
new file mode 100644 (file)
index 0000000..03db53e
--- /dev/null
@@ -0,0 +1,318 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_audio.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  USB AUDIO Class request handler.\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "USBFS_1.h"\r
+\r
+#if defined(USBFS_1_ENABLE_AUDIO_CLASS)\r
+\r
+#include "USBFS_1_audio.h"\r
+#include "USBFS_1_pvt.h"\r
+#if defined(USBFS_1_ENABLE_MIDI_STREAMING) \r
+    #include "USBFS_1_midi.h"\r
+#endif /* End USBFS_1_ENABLE_MIDI_STREAMING*/\r
+\r
+\r
+/***************************************\r
+* Custom Declarations\r
+***************************************/\r
+\r
+/* `#START CUSTOM_DECLARATIONS` Place your declaration here */\r
+\r
+/* `#END` */\r
+\r
+\r
+#if !defined(USER_SUPPLIED_AUDIO_HANDLER)\r
+\r
+\r
+/***************************************\r
+*    AUDIO Variables\r
+***************************************/\r
+\r
+#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)\r
+    volatile uint8 USBFS_1_currentSampleFrequency[USBFS_1_MAX_EP][USBFS_1_SAMPLE_FREQ_LEN];\r
+    volatile uint8 USBFS_1_frequencyChanged;\r
+    volatile uint8 USBFS_1_currentMute;\r
+    volatile uint8 USBFS_1_currentVolume[USBFS_1_VOLUME_LEN];\r
+    volatile uint8 USBFS_1_minimumVolume[USBFS_1_VOLUME_LEN] = {USBFS_1_VOL_MIN_LSB,\r
+                                                                                  USBFS_1_VOL_MIN_MSB};\r
+    volatile uint8 USBFS_1_maximumVolume[USBFS_1_VOLUME_LEN] = {USBFS_1_VOL_MAX_LSB,\r
+                                                                                  USBFS_1_VOL_MAX_MSB};\r
+    volatile uint8 USBFS_1_resolutionVolume[USBFS_1_VOLUME_LEN] = {USBFS_1_VOL_RES_LSB,\r
+                                                                                     USBFS_1_VOL_RES_MSB};\r
+#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_DispatchAUDIOClassRqst\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This routine dispatches class requests\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  requestHandled\r
+*\r
+* Global variables:\r
+*   USBFS_1_currentSampleFrequency: Contains the current audio Sample\r
+*       Frequency. It is set by the Host using SET_CUR request to the endpoint.\r
+*   USBFS_1_frequencyChanged: This variable is used as a flag for the\r
+*       user code, to be aware that Host has been sent request for changing\r
+*       Sample Frequency. Sample frequency will be sent on the next OUT\r
+*       transaction. It is contains endpoint address when set. The following\r
+*       code is recommended for detecting new Sample Frequency in main code:\r
+*       if((USBFS_1_frequencyChanged != 0) &&\r
+*       (USBFS_1_transferState == USBFS_1_TRANS_STATE_IDLE))\r
+*       {\r
+*          USBFS_1_frequencyChanged = 0;\r
+*       }\r
+*       USBFS_1_transferState variable is checked to be sure that\r
+*             transfer completes.\r
+*   USBFS_1_currentMute: Contains mute configuration set by Host.\r
+*   USBFS_1_currentVolume: Contains volume level set by Host.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_DispatchAUDIOClassRqst(void) \r
+{\r
+    uint8 requestHandled = USBFS_1_FALSE;\r
+\r
+    #if defined(USBFS_1_ENABLE_AUDIO_STREAMING)\r
+        uint8 epNumber;\r
+        epNumber = CY_GET_REG8(USBFS_1_wIndexLo) & USBFS_1_DIR_UNUSED;\r
+    #endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */\r
+\r
+    if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == USBFS_1_RQST_DIR_D2H)\r
+    {\r
+        /* Control Read */\r
+        if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \\r
+                                                                                    USBFS_1_RQST_RCPT_EP)\r
+        {\r
+            /* Endpoint */\r
+            switch (CY_GET_REG8(USBFS_1_bRequest))\r
+            {\r
+                case USBFS_1_GET_CUR:\r
+                #if defined(USBFS_1_ENABLE_AUDIO_STREAMING)\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_SAMPLING_FREQ_CONTROL)\r
+                    {\r
+                         /* Endpoint Control Selector is Sampling Frequency */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_SAMPLE_FREQ_LEN;\r
+                        USBFS_1_currentTD.pData  = USBFS_1_currentSampleFrequency[epNumber];\r
+                        requestHandled   = USBFS_1_InitControlRead();\r
+                    }\r
+                #endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */\r
+\r
+                /* `#START AUDIO_READ_REQUESTS` Place other request handler here */\r
+\r
+                /* `#END` */\r
+                    break;\r
+                default:\r
+                    break;\r
+            }\r
+        }\r
+        else if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \\r
+                                                                                    USBFS_1_RQST_RCPT_IFC)\r
+        {\r
+            /* Interface or Entity ID */\r
+            switch (CY_GET_REG8(USBFS_1_bRequest))\r
+            {\r
+                case USBFS_1_GET_CUR:\r
+                #if defined(USBFS_1_ENABLE_AUDIO_STREAMING)\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_MUTE_CONTROL)\r
+                    {\r
+                        /* `#START MUTE_CONTROL_GET_REQUEST` Place multi-channel handler here */\r
+\r
+                        /* `#END` */\r
+                        \r
+                         /* Entity ID Control Selector is MUTE */\r
+                        USBFS_1_currentTD.wCount = 1u;\r
+                        USBFS_1_currentTD.pData  = &USBFS_1_currentMute;\r
+                        requestHandled   = USBFS_1_InitControlRead();\r
+                    }\r
+                    else if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)\r
+                    {\r
+                        /* `#START VOLUME_CONTROL_GET_REQUEST` Place multi-channel handler here */\r
+\r
+                        /* `#END` */\r
+\r
+                        /* Entity ID Control Selector is VOLUME, */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;\r
+                        USBFS_1_currentTD.pData  = USBFS_1_currentVolume;\r
+                        requestHandled   = USBFS_1_InitControlRead();\r
+                    }\r
+                    else\r
+                    {\r
+                        /* `#START OTHER_GET_CUR_REQUESTS` Place other request handler here */\r
+\r
+                        /* `#END` */\r
+                    }\r
+                    break;\r
+                case USBFS_1_GET_MIN:    /* GET_MIN */\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)\r
+                    {\r
+                        /* Entity ID Control Selector is VOLUME, */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;\r
+                        USBFS_1_currentTD.pData  = &USBFS_1_minimumVolume[0];\r
+                        requestHandled   = USBFS_1_InitControlRead();\r
+                    }\r
+                    break;\r
+                case USBFS_1_GET_MAX:    /* GET_MAX */\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)\r
+                    {\r
+                        /* Entity ID Control Selector is VOLUME, */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;\r
+                        USBFS_1_currentTD.pData  = &USBFS_1_maximumVolume[0];\r
+                        requestHandled   = USBFS_1_InitControlRead();\r
+                    }\r
+                    break;\r
+                case USBFS_1_GET_RES:    /* GET_RES */\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)\r
+                    {\r
+                         /* Entity ID Control Selector is VOLUME, */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;\r
+                        USBFS_1_currentTD.pData  = &USBFS_1_resolutionVolume[0];\r
+                        requestHandled   = USBFS_1_InitControlRead();\r
+                    }\r
+                    break;\r
+                /* The contents of the status message is reserved for future use.\r
+                *  For the time being, a null packet should be returned in the data stage of the\r
+                *  control transfer, and the received null packet should be ACKed.\r
+                */\r
+                case USBFS_1_GET_STAT:\r
+                        USBFS_1_currentTD.wCount = 0u;\r
+                        requestHandled   = USBFS_1_InitControlWrite();\r
+\r
+                #endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */\r
+\r
+                /* `#START AUDIO_WRITE_REQUESTS` Place other request handler here */\r
+\r
+                /* `#END` */\r
+                    break;\r
+                default:\r
+                    break;\r
+            }\r
+        }\r
+        else\r
+        {   /* USBFS_1_RQST_RCPT_OTHER */\r
+        }\r
+    }\r
+    else if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == \\r
+                                                                                    USBFS_1_RQST_DIR_H2D)\r
+    {\r
+        /* Control Write */\r
+        if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \\r
+                                                                                    USBFS_1_RQST_RCPT_EP)\r
+        {\r
+            /* Endpoint */\r
+            switch (CY_GET_REG8(USBFS_1_bRequest))\r
+            {\r
+                case USBFS_1_SET_CUR:\r
+                #if defined(USBFS_1_ENABLE_AUDIO_STREAMING)\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_SAMPLING_FREQ_CONTROL)\r
+                    {\r
+                         /* Endpoint Control Selector is Sampling Frequency */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_SAMPLE_FREQ_LEN;\r
+                        USBFS_1_currentTD.pData  = USBFS_1_currentSampleFrequency[epNumber];\r
+                        requestHandled   = USBFS_1_InitControlWrite();\r
+                        USBFS_1_frequencyChanged = epNumber;\r
+                    }\r
+                #endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */\r
+\r
+                /* `#START AUDIO_SAMPLING_FREQ_REQUESTS` Place other request handler here */\r
+\r
+                /* `#END` */\r
+                    break;\r
+                default:\r
+                    break;\r
+            }\r
+        }\r
+        else if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \\r
+                                                                                    USBFS_1_RQST_RCPT_IFC)\r
+        {\r
+            /* Interface or Entity ID */\r
+            switch (CY_GET_REG8(USBFS_1_bRequest))\r
+            {\r
+                case USBFS_1_SET_CUR:\r
+                #if defined(USBFS_1_ENABLE_AUDIO_STREAMING)\r
+                    if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_MUTE_CONTROL)\r
+                    {\r
+                        /* `#START MUTE_SET_REQUEST` Place multi-channel handler here */\r
+\r
+                        /* `#END` */\r
+\r
+                        /* Entity ID Control Selector is MUTE */\r
+                        USBFS_1_currentTD.wCount = 1u;\r
+                        USBFS_1_currentTD.pData  = &USBFS_1_currentMute;\r
+                        requestHandled   = USBFS_1_InitControlWrite();\r
+                    }\r
+                    else if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)\r
+                    {\r
+                        /* `#START VOLUME_CONTROL_SET_REQUEST` Place multi-channel handler here */\r
+\r
+                        /* `#END` */\r
+\r
+                        /* Entity ID Control Selector is VOLUME */\r
+                        USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;\r
+                        USBFS_1_currentTD.pData  = USBFS_1_currentVolume;\r
+                        requestHandled   = USBFS_1_InitControlWrite();\r
+                    }\r
+                    else\r
+                    {\r
+                        /* `#START OTHER_SET_CUR_REQUESTS` Place other request handler here */\r
+\r
+                        /* `#END` */\r
+                    }\r
+                #endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */\r
+\r
+                /* `#START AUDIO_CONTROL_SEL_REQUESTS` Place other request handler here */\r
+\r
+                /* `#END` */\r
+                    break;\r
+                default:\r
+                    break;\r
+            }\r
+        }\r
+        else\r
+        {   /* USBFS_1_RQST_RCPT_OTHER */\r
+        }\r
+    }\r
+    else\r
+    {   /* requestHandled is initialized as FALSE by default */\r
+    }\r
+\r
+    return(requestHandled);\r
+}\r
+\r
+\r
+#endif /* USER_SUPPLIED_AUDIO_HANDLER */\r
+\r
+\r
+/*******************************************************************************\r
+* Additional user functions supporting AUDIO Requests\r
+********************************************************************************/\r
+\r
+/* `#START AUDIO_FUNCTIONS` Place any additional functions here */\r
+\r
+/* `#END` */\r
+\r
+#endif  /* End USBFS_1_ENABLE_AUDIO_CLASS*/\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_audio.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_audio.h
new file mode 100644 (file)
index 0000000..613d8c1
--- /dev/null
@@ -0,0 +1,95 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_audio.h\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  Header File for the USFS component. Contains prototypes and constant values.\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_USBFS_USBFS_1_audio_H)\r
+#define CY_USBFS_USBFS_1_audio_H\r
+\r
+#include "cytypes.h"\r
+\r
+\r
+/***************************************\r
+* Custom Declarations\r
+***************************************/\r
+\r
+/* `#START CUSTOM_CONSTANTS` Place your declaration here */\r
+\r
+/* `#END` */\r
+\r
+\r
+/***************************************\r
+*  Constants for USBFS_1_audio API.\r
+***************************************/\r
+\r
+/* Audio Class-Specific Request Codes (AUDIO Table A-9) */\r
+#define USBFS_1_REQUEST_CODE_UNDEFINED     (0x00u)\r
+#define USBFS_1_SET_CUR                    (0x01u)\r
+#define USBFS_1_GET_CUR                    (0x81u)\r
+#define USBFS_1_SET_MIN                    (0x02u)\r
+#define USBFS_1_GET_MIN                    (0x82u)\r
+#define USBFS_1_SET_MAX                    (0x03u)\r
+#define USBFS_1_GET_MAX                    (0x83u)\r
+#define USBFS_1_SET_RES                    (0x04u)\r
+#define USBFS_1_GET_RES                    (0x84u)\r
+#define USBFS_1_SET_MEM                    (0x05u)\r
+#define USBFS_1_GET_MEM                    (0x85u)\r
+#define USBFS_1_GET_STAT                   (0xFFu)\r
+\r
+/* Endpoint Control Selectors (AUDIO Table A-19) */\r
+#define USBFS_1_EP_CONTROL_UNDEFINED       (0x00u)\r
+#define USBFS_1_SAMPLING_FREQ_CONTROL      (0x01u)\r
+#define USBFS_1_PITCH_CONTROL              (0x02u)\r
+\r
+/* Feature Unit Control Selectors (AUDIO Table A-11) */\r
+#define USBFS_1_FU_CONTROL_UNDEFINED       (0x00u)\r
+#define USBFS_1_MUTE_CONTROL               (0x01u)\r
+#define USBFS_1_VOLUME_CONTROL             (0x02u)\r
+#define USBFS_1_BASS_CONTROL               (0x03u)\r
+#define USBFS_1_MID_CONTROL                (0x04u)\r
+#define USBFS_1_TREBLE_CONTROL             (0x05u)\r
+#define USBFS_1_GRAPHIC_EQUALIZER_CONTROL  (0x06u)\r
+#define USBFS_1_AUTOMATIC_GAIN_CONTROL     (0x07u)\r
+#define USBFS_1_DELAY_CONTROL              (0x08u)\r
+#define USBFS_1_BASS_BOOST_CONTROL         (0x09u)\r
+#define USBFS_1_LOUDNESS_CONTROL           (0x0Au)\r
+\r
+#define USBFS_1_SAMPLE_FREQ_LEN            (3u)\r
+#define USBFS_1_VOLUME_LEN                 (2u)\r
+\r
+#if !defined(USER_SUPPLIED_DEFAULT_VOLUME_VALUE)\r
+    #define USBFS_1_VOL_MIN_MSB            (0x80u)\r
+    #define USBFS_1_VOL_MIN_LSB            (0x01u)\r
+    #define USBFS_1_VOL_MAX_MSB            (0x7Fu)\r
+    #define USBFS_1_VOL_MAX_LSB            (0xFFu)\r
+    #define USBFS_1_VOL_RES_MSB            (0x00u)\r
+    #define USBFS_1_VOL_RES_LSB            (0x01u)\r
+#endif /* USER_SUPPLIED_DEFAULT_VOLUME_VALUE */\r
+\r
+\r
+/***************************************\r
+* External data references\r
+***************************************/\r
+\r
+extern volatile uint8 USBFS_1_currentSampleFrequency[USBFS_1_MAX_EP]\r
+                                                             [USBFS_1_SAMPLE_FREQ_LEN];\r
+extern volatile uint8 USBFS_1_frequencyChanged;\r
+extern volatile uint8 USBFS_1_currentMute;\r
+extern volatile uint8 USBFS_1_currentVolume[USBFS_1_VOLUME_LEN];\r
+extern volatile uint8 USBFS_1_minimumVolume[USBFS_1_VOLUME_LEN];\r
+extern volatile uint8 USBFS_1_maximumVolume[USBFS_1_VOLUME_LEN];\r
+extern volatile uint8 USBFS_1_resolutionVolume[USBFS_1_VOLUME_LEN];\r
+\r
+#endif /* End CY_USBFS_USBFS_1_audio_H */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_boot.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_boot.c
new file mode 100644 (file)
index 0000000..75eea55
--- /dev/null
@@ -0,0 +1,262 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_boot.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  Boot loader API for USBFS Component.\r
+*\r
+*  Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "USBFS_1.h"\r
+\r
+#if defined(CYDEV_BOOTLOADER_IO_COMP) && ((CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1) || \\r
+                                          (CYDEV_BOOTLOADER_IO_COMP == CyBtldr_Custom_Interface))\r
+\r
+\r
+/***************************************\r
+*    Bootloader defines\r
+***************************************/\r
+\r
+#define USBFS_1_CyBtLdrStarttimer(X, T)         {USBFS_1_universalTime = T * 10; X = 0u;}\r
+#define USBFS_1_CyBtLdrChecktimer(X)            ((X++ < USBFS_1_universalTime) ? 1u : 0u)\r
+\r
+#define USBFS_1_BTLDR_OUT_EP      (0x01u)\r
+#define USBFS_1_BTLDR_IN_EP       (0x02u)\r
+\r
+\r
+/***************************************\r
+*    Bootloader Variables\r
+***************************************/\r
+\r
+static uint16 USBFS_1_universalTime;\r
+static uint8 USBFS_1_started = 0u;\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_CyBtldrCommStart\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Starts the component and enables the interrupt.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+* Side Effects:\r
+*  This function starts the USB with 3V or 5V operation.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_CyBtldrCommStart(void) \r
+{\r
+    CyGlobalIntEnable;      /* Enable Global Interrupts */\r
+\r
+    /*Start USBFS Operation/device 0 and with 5V or 3V operation depend on Voltage Configuration in DWR */\r
+    USBFS_1_Start(0u, USBFS_1_DWR_VDDD_OPERATION);\r
+\r
+    /* USB component started, the correct enumeration will be checked in first Read operation */\r
+    USBFS_1_started = 1u;\r
+\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_CyBtldrCommStop.\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Disable the component and disable the interrupt.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_CyBtldrCommStop(void) \r
+{\r
+    USBFS_1_Stop();\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_CyBtldrCommReset.\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Resets the receive and transmit communication Buffers.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_CyBtldrCommReset(void) \r
+{\r
+    USBFS_1_EnableOutEP(USBFS_1_BTLDR_OUT_EP);  /* Enable the OUT endpoint */\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_CyBtldrCommWrite.\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Allows the caller to write data to the boot loader host. The function will\r
+*  handle polling to allow a block of data to be completely sent to the host\r
+*  device.\r
+*\r
+* Parameters:\r
+*  pData:    A pointer to the block of data to send to the device\r
+*  size:     The number of bytes to write.\r
+*  count:    Pointer to an unsigned short variable to write the number of\r
+*             bytes actually written.\r
+*  timeOut:  Number of units to wait before returning because of a timeout.\r
+*\r
+* Return:\r
+*  Returns the value that best describes the problem.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+cystatus USBFS_1_CyBtldrCommWrite(uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL\r
+                                                            \r
+{\r
+    uint16 time;\r
+    cystatus status;\r
+\r
+    /* Enable IN transfer */\r
+    USBFS_1_LoadInEP(USBFS_1_BTLDR_IN_EP, pData, USBFS_1_BTLDR_SIZEOF_READ_BUFFER);\r
+\r
+    /* Start a timer to wait on. */\r
+    USBFS_1_CyBtLdrStarttimer(time, timeOut);\r
+\r
+    /* Wait for the master to read it. */\r
+    while((USBFS_1_GetEPState(USBFS_1_BTLDR_IN_EP) == USBFS_1_IN_BUFFER_FULL) && \\r
+           USBFS_1_CyBtLdrChecktimer(time))\r
+    {\r
+        CyDelay(1u); /* 1ms delay */\r
+    }\r
+\r
+    if (USBFS_1_GetEPState(USBFS_1_BTLDR_IN_EP) == USBFS_1_IN_BUFFER_FULL)\r
+    {\r
+        status = CYRET_TIMEOUT;\r
+    }\r
+    else\r
+    {\r
+        *count = size;\r
+        status = CYRET_SUCCESS;\r
+    }\r
+\r
+    return(status);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_CyBtldrCommRead.\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  Allows the caller to read data from the boot loader host. The function will\r
+*  handle polling to allow a block of data to be completely received from the\r
+*  host device.\r
+*\r
+* Parameters:\r
+*  pData:    A pointer to the area to store the block of data received\r
+*             from the device.\r
+*  size:     The number of bytes to read.\r
+*  count:    Pointer to an unsigned short variable to write the number\r
+*             of bytes actually read.\r
+*  timeOut:  Number of units to wait before returning because of a timeOut.\r
+*            Timeout is measured in 10s of ms.\r
+*\r
+* Return:\r
+*  Returns the value that best describes the problem.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+cystatus USBFS_1_CyBtldrCommRead(uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL\r
+                                                            \r
+{\r
+    cystatus status;\r
+    uint16 time;\r
+\r
+    if(size > USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER)\r
+    {\r
+        size = USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER;\r
+    }\r
+    /* Start a timer to wait on. */\r
+    USBFS_1_CyBtLdrStarttimer(time, timeOut);\r
+\r
+    /* Wait on enumeration in first time */\r
+    if(USBFS_1_started)\r
+    {\r
+        /* Wait for Device to enumerate */\r
+        while(!USBFS_1_GetConfiguration() && USBFS_1_CyBtLdrChecktimer(time))\r
+        {\r
+            CyDelay(1u); /* 1ms delay */\r
+        }\r
+        /* Enable first OUT, if enumeration complete */\r
+        if(USBFS_1_GetConfiguration())\r
+        {\r
+            USBFS_1_IsConfigurationChanged();  /* Clear configuration changes state status */\r
+            USBFS_1_CyBtldrCommReset();\r
+            USBFS_1_started = 0u;\r
+        }\r
+    }\r
+    else /* Check for configuration changes, has been done by Host */\r
+    {\r
+        if(USBFS_1_IsConfigurationChanged() != 0u) /* Host could send double SET_INTERFACE request or RESET */\r
+        {\r
+            if(USBFS_1_GetConfiguration() != 0u)   /* Init OUT endpoints when device reconfigured */\r
+            {\r
+                USBFS_1_CyBtldrCommReset();\r
+            }\r
+        }\r
+    }\r
+    /* Wait on next packet */\r
+    while((USBFS_1_GetEPState(USBFS_1_BTLDR_OUT_EP) != USBFS_1_OUT_BUFFER_FULL) && \\r
+           USBFS_1_CyBtLdrChecktimer(time))\r
+    {\r
+        CyDelay(1u); /* 1ms delay */\r
+    }\r
+\r
+    /* OUT EP has completed */\r
+    if (USBFS_1_GetEPState(USBFS_1_BTLDR_OUT_EP) == USBFS_1_OUT_BUFFER_FULL)\r
+    {\r
+        *count = USBFS_1_ReadOutEP(USBFS_1_BTLDR_OUT_EP, pData, size);\r
+        status = CYRET_SUCCESS;\r
+    }\r
+    else\r
+    {\r
+        *count = 0u;\r
+        status = CYRET_TIMEOUT;\r
+    }\r
+    return(status);\r
+}\r
+\r
+#endif /* End CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1 */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.c
new file mode 100644 (file)
index 0000000..b498c2c
--- /dev/null
@@ -0,0 +1,706 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_cdc.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  USB HID Class request handler.\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2012-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "USBFS_1.h"\r
+\r
+#if defined(USBFS_1_ENABLE_CDC_CLASS)\r
+\r
+#include "USBFS_1_cdc.h"\r
+#include "USBFS_1_pvt.h"\r
+\r
+\r
+/***************************************\r
+*    CDC Variables\r
+***************************************/\r
+\r
+volatile uint8 USBFS_1_lineCoding[USBFS_1_LINE_CODING_SIZE];\r
+volatile uint8 USBFS_1_lineChanged;\r
+volatile uint16 USBFS_1_lineControlBitmap;\r
+volatile uint8 USBFS_1_cdc_data_in_ep;\r
+volatile uint8 USBFS_1_cdc_data_out_ep;\r
+\r
+\r
+/***************************************\r
+*     Static Function Prototypes\r
+***************************************/\r
+static uint16 USBFS_1_StrLen(const char8 string[]) ;\r
+\r
+\r
+/***************************************\r
+* Custom Declarations\r
+***************************************/\r
+\r
+/* `#START CDC_CUSTOM_DECLARATIONS` Place your declaration here */\r
+\r
+/* `#END` */\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_DispatchCDCClassRqst\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This routine dispatches CDC class requests.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  requestHandled\r
+*\r
+* Global variables:\r
+*   USBFS_1_lineCoding: Contains the current line coding structure.\r
+*     It is set by the Host using SET_LINE_CODING request and returned to the\r
+*     user code by the USBFS_GetDTERate(), USBFS_GetCharFormat(),\r
+*     USBFS_GetParityType(), USBFS_GetDataBits() APIs.\r
+*   USBFS_1_lineControlBitmap: Contains the current control signal\r
+*     bitmap. It is set by the Host using SET_CONTROL_LINE request and returned\r
+*     to the user code by the USBFS_GetLineControl() API.\r
+*   USBFS_1_lineChanged: This variable is used as a flag for the\r
+*     USBFS_IsLineChanged() API, to be aware that Host has been sent request\r
+*     for changing Line Coding or Control Bitmap.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_DispatchCDCClassRqst(void) \r
+{\r
+    uint8 requestHandled = USBFS_1_FALSE;\r
+\r
+    if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == USBFS_1_RQST_DIR_D2H)\r
+    {   /* Control Read */\r
+        switch (CY_GET_REG8(USBFS_1_bRequest))\r
+        {\r
+            case USBFS_1_CDC_GET_LINE_CODING:\r
+                USBFS_1_currentTD.count = USBFS_1_LINE_CODING_SIZE;\r
+                USBFS_1_currentTD.pData = USBFS_1_lineCoding;\r
+                requestHandled  = USBFS_1_InitControlRead();\r
+                break;\r
+\r
+            /* `#START CDC_READ_REQUESTS` Place other request handler here */\r
+\r
+            /* `#END` */\r
+\r
+            default:    /* requestHandled is initialized as FALSE by default */\r
+                break;\r
+        }\r
+    }\r
+    else if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == \\r
+                                                                            USBFS_1_RQST_DIR_H2D)\r
+    {   /* Control Write */\r
+        switch (CY_GET_REG8(USBFS_1_bRequest))\r
+        {\r
+            case USBFS_1_CDC_SET_LINE_CODING:\r
+                USBFS_1_currentTD.count = USBFS_1_LINE_CODING_SIZE;\r
+                USBFS_1_currentTD.pData = USBFS_1_lineCoding;\r
+                USBFS_1_lineChanged |= USBFS_1_LINE_CODING_CHANGED;\r
+                requestHandled = USBFS_1_InitControlWrite();\r
+                break;\r
+\r
+            case USBFS_1_CDC_SET_CONTROL_LINE_STATE:\r
+                USBFS_1_lineControlBitmap = CY_GET_REG8(USBFS_1_wValueLo);\r
+                USBFS_1_lineChanged |= USBFS_1_LINE_CONTROL_CHANGED;\r
+                requestHandled = USBFS_1_InitNoDataControlTransfer();\r
+                break;\r
+\r
+            /* `#START CDC_WRITE_REQUESTS` Place other request handler here */\r
+\r
+            /* `#END` */\r
+\r
+            default:    /* requestHandled is initialized as FALSE by default */\r
+                break;\r
+        }\r
+    }\r
+    else\r
+    {   /* requestHandled is initialized as FALSE by default */\r
+    }\r
+\r
+    return(requestHandled);\r
+}\r
+\r
+\r
+/***************************************\r
+* Optional CDC APIs\r
+***************************************/\r
+#if (USBFS_1_ENABLE_CDC_CLASS_API != 0u)\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_CDC_Init\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  This function initialize the CDC interface to be ready for the receive data\r
+    *  from the PC.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_lineChanged: Initialized to zero.\r
+    *   USBFS_1_cdc_data_out_ep: Used as an OUT endpoint number.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_CDC_Init(void) \r
+    {\r
+        USBFS_1_lineChanged = 0u;\r
+        USBFS_1_EnableOutEP(USBFS_1_cdc_data_out_ep);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_PutData\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Sends a specified number of bytes from the location specified by a\r
+    *  pointer to the PC.\r
+    *\r
+    * Parameters:\r
+    *  pData: pointer to the buffer containing data to be sent.\r
+    *  length: Specifies the number of bytes to send from the pData\r
+    *  buffer. Maximum length will be limited by the maximum packet\r
+    *  size for the endpoint.\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending\r
+    *     data.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_PutData(const uint8* pData, uint16 length) \r
+    {\r
+        /* Limits length to maximum packet size for the EP */\r
+        if(length > USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize)\r
+        {\r
+            /* Caution: Data will be lost if length is greater than Max Packet Length */\r
+            length = USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize;\r
+             /* Halt CPU in debug mode */\r
+            CYASSERT(0u != 0u);\r
+        }\r
+        USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, pData, length);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_StrLen\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Calculates length of a null terminated string.\r
+    *\r
+    * Parameters:\r
+    *  string: pointer to the string.\r
+    *\r
+    * Return:\r
+    *  Length of the string\r
+    *\r
+    *******************************************************************************/\r
+    static uint16 USBFS_1_StrLen(const char8 string[]) \r
+    {\r
+        uint16 len = 0u;\r
+\r
+        while (string[len] != (char8)0)\r
+        {\r
+            len++;\r
+        }\r
+\r
+        return (len);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_PutString\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Sends a null terminated string to the PC.\r
+    *\r
+    * Parameters:\r
+    *  string: pointer to the string to be sent to the PC\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending\r
+    *     data.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    * Theory:\r
+    *  This function will block if there is not enough memory to place the whole\r
+    *  string, it will block until the entire string has been written to the\r
+    *  transmit buffer.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_PutString(const char8 string[]) \r
+    {\r
+        uint16 str_length;\r
+        uint16 send_length;\r
+        uint16 buf_index = 0u;\r
+\r
+        /* Get length of the null terminated string */\r
+        str_length = USBFS_1_StrLen(string);\r
+        do\r
+        {\r
+            /* Limits length to maximum packet size for the EP */\r
+            send_length = (str_length > USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize) ?\r
+                          USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize : str_length;\r
+             /* Enable IN transfer */\r
+            USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, (const uint8 *)&string[buf_index], send_length);\r
+            str_length -= send_length;\r
+\r
+            /* If more data are present to send */\r
+            if(str_length > 0u)\r
+            {\r
+                buf_index += send_length;\r
+                /* Wait for the Host to read it. */\r
+                while(USBFS_1_EP[USBFS_1_cdc_data_in_ep].apiEpState ==\r
+                                          USBFS_1_IN_BUFFER_FULL)\r
+                {\r
+                    ;\r
+                }\r
+            }\r
+        }while(str_length > 0u);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_PutChar\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Writes a single character to the PC.\r
+    *\r
+    * Parameters:\r
+    *  txDataByte: Character to be sent to the PC.\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending\r
+    *     data.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_PutChar(char8 txDataByte) \r
+    {\r
+        uint8 dataByte;\r
+        dataByte = (uint8)txDataByte;\r
+\r
+        USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, &dataByte, 1u);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_PutCRLF\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Sends a carriage return (0x0D) and line feed (0x0A) to the PC\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  None.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending\r
+    *     data.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    void USBFS_1_PutCRLF(void) \r
+    {\r
+        const uint8 CYCODE txData[] = {0x0Du, 0x0Au};\r
+\r
+        USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, (const uint8 *)txData, 2u);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetCount\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  This function returns the number of bytes that were received from the PC.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Returns the number of received bytes.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.\r
+    *\r
+    *******************************************************************************/\r
+    uint16 USBFS_1_GetCount(void) \r
+    {\r
+        uint16 bytesCount = 0u;\r
+\r
+        if (USBFS_1_EP[USBFS_1_cdc_data_out_ep].apiEpState == USBFS_1_OUT_BUFFER_FULL)\r
+        {\r
+            bytesCount = USBFS_1_GetEPCount(USBFS_1_cdc_data_out_ep);\r
+        }\r
+\r
+        return(bytesCount);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_DataIsReady\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns a nonzero value if the component received data or received\r
+    *  zero-length packet. The GetAll() or GetData() API should be called to read\r
+    *  data from the buffer and re-init OUT endpoint even when zero-length packet\r
+    *  received.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  If the OUT packet received this function returns a nonzero value.\r
+    *  Otherwise zero is returned.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_DataIsReady(void) \r
+    {\r
+        return(USBFS_1_EP[USBFS_1_cdc_data_out_ep].apiEpState);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_CDCIsReady\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns a nonzero value if the component is ready to send more data to the\r
+    *  PC. Otherwise returns zero. Should be called before sending new data to\r
+    *  ensure the previous data has finished sending.This function returns the\r
+    *  number of bytes that were received from the PC.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  If the buffer can accept new data then this function returns a nonzero value.\r
+    *  Otherwise zero is returned.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_in_ep: CDC IN endpoint number used.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_CDCIsReady(void) \r
+    {\r
+        return(USBFS_1_EP[USBFS_1_cdc_data_in_ep].apiEpState);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetData\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Gets a specified number of bytes from the input buffer and places it in a\r
+    *  data array specified by the passed pointer.\r
+    *  USBFS_1_DataIsReady() API should be called before, to be sure\r
+    *  that data is received from the Host.\r
+    *\r
+    * Parameters:\r
+    *  pData: Pointer to the data array where data will be placed.\r
+    *  Length: Number of bytes to read into the data array from the RX buffer.\r
+    *          Maximum length is limited by the the number of received bytes.\r
+    *\r
+    * Return:\r
+    *  Number of bytes received.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    uint16 USBFS_1_GetData(uint8* pData, uint16 length) \r
+    {\r
+        return(USBFS_1_ReadOutEP(USBFS_1_cdc_data_out_ep, pData, length));\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetAll\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Gets all bytes of received data from the input buffer and places it into a\r
+    *  specified data array. USBFS_1_DataIsReady() API should be called\r
+    *  before, to be sure that data is received from the Host.\r
+    *\r
+    * Parameters:\r
+    *  pData: Pointer to the data array where data will be placed.\r
+    *\r
+    * Return:\r
+    *  Number of bytes received.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.\r
+    *   USBFS_1_EP[].bufferSize: EP max packet size is used as a length\r
+    *     to read all data from the EP buffer.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    uint16 USBFS_1_GetAll(uint8* pData) \r
+    {\r
+        return (USBFS_1_ReadOutEP(USBFS_1_cdc_data_out_ep, pData,\r
+                                           USBFS_1_EP[USBFS_1_cdc_data_out_ep].bufferSize));\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetChar\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Reads one byte of received data from the buffer.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Received one character.\r
+    *\r
+    * Global variables:\r
+    *   USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.\r
+    *\r
+    * Reentrant:\r
+    *  No.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_GetChar(void) \r
+    {\r
+         uint8 rxData;\r
+\r
+        (void) USBFS_1_ReadOutEP(USBFS_1_cdc_data_out_ep, &rxData, 1u);\r
+\r
+        return(rxData);\r
+    }\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_IsLineChanged\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  This function returns clear on read status of the line.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  If SET_LINE_CODING or CDC_SET_CONTROL_LINE_STATE request received then not\r
+    *  zero value returned. Otherwise zero is returned.\r
+    *\r
+    * Global variables:\r
+    *  USBFS_1_transferState - it is checked to be sure then OUT data\r
+    *    phase has been complete, and data written to the lineCoding or Control\r
+    *    Bitmap buffer.\r
+    *  USBFS_1_lineChanged: used as a flag to be aware that Host has been\r
+    *    sent request for changing Line Coding or Control Bitmap.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_IsLineChanged(void) \r
+    {\r
+        uint8 state = 0u;\r
+\r
+        /* transferState is checked to be sure then OUT data phase has been complete */\r
+        if(USBFS_1_transferState == USBFS_1_TRANS_STATE_IDLE)\r
+        {\r
+            if(USBFS_1_lineChanged != 0u)\r
+            {\r
+                state = USBFS_1_lineChanged;\r
+                USBFS_1_lineChanged = 0u;\r
+            }\r
+        }\r
+\r
+        return(state);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetDTERate\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns the data terminal rate set for this port in bits per second.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Returns a uint32 value of the data rate in bits per second.\r
+    *\r
+    * Global variables:\r
+    *  USBFS_1_lineCoding: First four bytes converted to uint32\r
+    *    depend on compiler, and returned as a data rate.\r
+    *\r
+    *******************************************************************************/\r
+    uint32 USBFS_1_GetDTERate(void) \r
+    {\r
+        uint32 rate;\r
+\r
+        rate = USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE + 3u];\r
+        rate = (rate << 8u) | USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE + 2u];\r
+        rate = (rate << 8u) | USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE + 1u];\r
+        rate = (rate << 8u) | USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE];\r
+\r
+        return(rate);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetCharFormat\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns the number of stop bits.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Returns the number of stop bits.\r
+    *\r
+    * Global variables:\r
+    *  USBFS_1_lineCoding: used to get a parameter.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_GetCharFormat(void) \r
+    {\r
+        return(USBFS_1_lineCoding[USBFS_1_LINE_CODING_STOP_BITS]);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetParityType\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns the parity type for the CDC port.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Returns the parity type.\r
+    *\r
+    * Global variables:\r
+    *  USBFS_1_lineCoding: used to get a parameter.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_GetParityType(void) \r
+    {\r
+        return(USBFS_1_lineCoding[USBFS_1_LINE_CODING_PARITY]);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetDataBits\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns the number of data bits for the CDC port.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Returns the number of data bits.\r
+    *  The number of data bits can be 5, 6, 7, 8 or 16.\r
+    *\r
+    * Global variables:\r
+    *  USBFS_1_lineCoding: used to get a parameter.\r
+    *\r
+    *******************************************************************************/\r
+    uint8 USBFS_1_GetDataBits(void) \r
+    {\r
+        return(USBFS_1_lineCoding[USBFS_1_LINE_CODING_DATA_BITS]);\r
+    }\r
+\r
+\r
+    /*******************************************************************************\r
+    * Function Name: USBFS_1_GetLineControl\r
+    ********************************************************************************\r
+    *\r
+    * Summary:\r
+    *  Returns Line control bitmap.\r
+    *\r
+    * Parameters:\r
+    *  None.\r
+    *\r
+    * Return:\r
+    *  Returns Line control bitmap.\r
+    *\r
+    * Global variables:\r
+    *  USBFS_1_lineControlBitmap: used to get a parameter.\r
+    *\r
+    *******************************************************************************/\r
+    uint16 USBFS_1_GetLineControl(void) \r
+    {\r
+        return(USBFS_1_lineControlBitmap);\r
+    }\r
+\r
+#endif  /* End USBFS_1_ENABLE_CDC_CLASS_API*/\r
+\r
+\r
+/*******************************************************************************\r
+* Additional user functions supporting CDC Requests\r
+********************************************************************************/\r
+\r
+/* `#START CDC_FUNCTIONS` Place any additional functions here */\r
+\r
+/* `#END` */\r
+\r
+#endif  /* End USBFS_1_ENABLE_CDC_CLASS*/\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.h b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.h
new file mode 100644 (file)
index 0000000..93bbc15
--- /dev/null
@@ -0,0 +1,92 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_cdc.h\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  Header File for the USFS component.\r
+*  Contains CDC class prototypes and constant values.\r
+*\r
+********************************************************************************\r
+* Copyright 2012-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#if !defined(CY_USBFS_USBFS_1_cdc_H)\r
+#define CY_USBFS_USBFS_1_cdc_H\r
+\r
+#include "cytypes.h"\r
+\r
+\r
+/***************************************\r
+* Prototypes of the USBFS_1_cdc API.\r
+***************************************/\r
+\r
+#if (USBFS_1_ENABLE_CDC_CLASS_API != 0u)\r
+    void USBFS_1_CDC_Init(void) ;\r
+    void USBFS_1_PutData(const uint8* pData, uint16 length) ;\r
+    void USBFS_1_PutString(const char8 string[]) ;\r
+    void USBFS_1_PutChar(char8 txDataByte) ;\r
+    void USBFS_1_PutCRLF(void) ;\r
+    uint16 USBFS_1_GetCount(void) ;\r
+    uint8 USBFS_1_CDCIsReady(void) ;\r
+    uint8 USBFS_1_DataIsReady(void) ;\r
+    uint16 USBFS_1_GetData(uint8* pData, uint16 length) ;\r
+    uint16 USBFS_1_GetAll(uint8* pData) ;\r
+    uint8 USBFS_1_GetChar(void) ;\r
+    uint8 USBFS_1_IsLineChanged(void) ;\r
+    uint32 USBFS_1_GetDTERate(void) ;\r
+    uint8 USBFS_1_GetCharFormat(void) ;\r
+    uint8 USBFS_1_GetParityType(void) ;\r
+    uint8 USBFS_1_GetDataBits(void) ;\r
+    uint16 USBFS_1_GetLineControl(void) ;\r
+#endif  /* End USBFS_1_ENABLE_CDC_CLASS_API*/\r
+\r
+\r
+/***************************************\r
+*  Constants for USBFS_1_cdc API.\r
+***************************************/\r
+\r
+/* CDC Class-Specific Request Codes (CDC ver 1.2 Table 19) */\r
+#define USBFS_1_CDC_SET_LINE_CODING        (0x20u)\r
+#define USBFS_1_CDC_GET_LINE_CODING        (0x21u)\r
+#define USBFS_1_CDC_SET_CONTROL_LINE_STATE (0x22u)\r
+\r
+#define USBFS_1_LINE_CODING_CHANGED        (0x01u)\r
+#define USBFS_1_LINE_CONTROL_CHANGED       (0x02u)\r
+\r
+#define USBFS_1_1_STOPBIT                  (0x00u)\r
+#define USBFS_1_1_5_STOPBITS               (0x01u)\r
+#define USBFS_1_2_STOPBITS                 (0x02u)\r
+\r
+#define USBFS_1_PARITY_NONE                (0x00u)\r
+#define USBFS_1_PARITY_ODD                 (0x01u)\r
+#define USBFS_1_PARITY_EVEN                (0x02u)\r
+#define USBFS_1_PARITY_MARK                (0x03u)\r
+#define USBFS_1_PARITY_SPACE               (0x04u)\r
+\r
+#define USBFS_1_LINE_CODING_SIZE           (0x07u)\r
+#define USBFS_1_LINE_CODING_RATE           (0x00u)\r
+#define USBFS_1_LINE_CODING_STOP_BITS      (0x04u)\r
+#define USBFS_1_LINE_CODING_PARITY         (0x05u)\r
+#define USBFS_1_LINE_CODING_DATA_BITS      (0x06u)\r
+\r
+#define USBFS_1_LINE_CONTROL_DTR           (0x01u)\r
+#define USBFS_1_LINE_CONTROL_RTS           (0x02u)\r
+\r
+\r
+/***************************************\r
+* External data references\r
+***************************************/\r
+\r
+extern volatile uint8 USBFS_1_lineCoding[USBFS_1_LINE_CODING_SIZE];\r
+extern volatile uint8 USBFS_1_lineChanged;\r
+extern volatile uint16 USBFS_1_lineControlBitmap;\r
+extern volatile uint8 USBFS_1_cdc_data_in_ep;\r
+extern volatile uint8 USBFS_1_cdc_data_out_ep;\r
+\r
+#endif /* End CY_USBFS_USBFS_1_cdc_H */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.inf b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cdc.inf
new file mode 100644 (file)
index 0000000..9515243
--- /dev/null
@@ -0,0 +1,122 @@
+;******************************************************************************\r
+; File Name: USBFS_1_cdc.inf\r
+; Version 2.60\r
+;\r
+; Description:\r
+;  Windows USB CDC setup file for USBUART Device.\r
+;\r
+;******************************************************************************\r
+; Copyright 2007-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+; You may use this file only in accordance with the license, terms, conditions,\r
+; disclaimers, and limitations in the end user license agreement accompanying\r
+; the software package with which this file was provided.\r
+;******************************************************************************\r
+\r
+[Version]\r
+Signature="$Windows NT$"\r
+Class=Ports\r
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}\r
+Provider=%PROVIDER%\r
+LayoutFile=layout.inf\r
+DriverVer=03/05/2007,2.0.0000.0\r
+\r
+[Manufacturer]\r
+%MFGNAME%=DeviceList, NTx86, NTia64, NTamd64\r
+\r
+[DestinationDirs]\r
+DefaultDestDir=12\r
+\r
+[SourceDisksFiles]\r
+\r
+[SourceDisksNames]\r
+\r
+[DeviceList.NTx86]\r
+%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232\r
+\r
+[DeviceList.NTia64]\r
+%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232\r
+\r
+[DeviceList.NTamd64]\r
+%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232\r
+\r
+\r
+;------------------------------------------------------------------------------\r
+;  32 bit section for Windows 2000/2003/XP/Vista\r
+;------------------------------------------------------------------------------\r
+\r
+[DriverInstall.NTx86]\r
+include=mdmcpq.inf\r
+CopyFiles=DriverCopyFiles\r
+AddReg=DriverInstall.NTx86.AddReg\r
+\r
+[DriverCopyFiles]\r
+usbser.sys,,,0x20\r
+\r
+[DriverInstall.NTx86.AddReg]\r
+HKR,,DevLoader,,*ntkern\r
+HKR,,NTMPDriver,,usbser.sys\r
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"\r
+\r
+[DriverInstall.NTx86.Services]\r
+AddService=usbser, 0x00000002, DriverService\r
+\r
+;------------------------------------------------------------------------------\r
+;  64 bit section for Intel Itanium based systems\r
+;------------------------------------------------------------------------------\r
+\r
+[DriverInstall.NTia64]\r
+include=mdmcpq.inf\r
+CopyFiles=DriverCopyFiles\r
+AddReg=DriverInstall.NTia64.AddReg\r
+\r
+[DriverCopyFiles]\r
+usbser.sys,,,0x20\r
+\r
+[DriverInstall.NTia64.AddReg]\r
+HKR,,DevLoader,,*ntkern\r
+HKR,,NTMPDriver,,usbser.sys\r
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"\r
+\r
+[DriverInstall.NTia64.Services]\r
+AddService=usbser, 0x00000002, DriverService\r
+\r
+;------------------------------------------------------------------------------\r
+;  64 bit section for AMD64 and Intel EM64T based systems\r
+;------------------------------------------------------------------------------\r
+\r
+[DriverInstall.NTamd64]\r
+include=mdmcpq.inf\r
+CopyFiles=DriverCopyFiles\r
+AddReg=DriverInstall.NTamd64.AddReg\r
+\r
+[DriverCopyFiles]\r
+usbser.sys,,,0x20\r
+\r
+[DriverInstall.NTamd64.AddReg]\r
+HKR,,DevLoader,,*ntkern\r
+HKR,,NTMPDriver,,usbser.sys\r
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"\r
+\r
+[DriverInstall.NTamd64.Services]\r
+AddService=usbser, 0x00000002, DriverService\r
+\r
+;------------------------------------------------------------------------------\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+[DriverService]\r
+DisplayName=%SERVICE%\r
+ServiceType=1\r
+StartType=3\r
+ErrorControl=1\r
+ServiceBinary=%12%\usbser.sys\r
+\r
+;------------------------------------------------------------------------------\r
+;  String Definitions\r
+;------------------------------------------------------------------------------\r
+\r
+[Strings]\r
+PROVIDER="Cypress"\r
+MFGNAME="Cypress Semiconductor Corporation"\r
+DESCRIPTION="Cypress USB UART"\r
+SERVICE="USB UART"\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cls.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_cls.c
new file mode 100644 (file)
index 0000000..26800c5
--- /dev/null
@@ -0,0 +1,107 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_cls.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  USB Class request handler.\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "USBFS_1.h"\r
+\r
+#if(USBFS_1_EXTERN_CLS == USBFS_1_FALSE)\r
+\r
+#include "USBFS_1_pvt.h"\r
+\r
+\r
+/***************************************\r
+* User Implemented Class Driver Declarations.\r
+***************************************/\r
+/* `#START USER_DEFINED_CLASS_DECLARATIONS` Place your declaration here */\r
+\r
+/* `#END` */\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_DispatchClassRqst\r
+********************************************************************************\r
+* Summary:\r
+*  This routine dispatches class specific requests depend on interface class.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  requestHandled.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+uint8 USBFS_1_DispatchClassRqst(void) \r
+{\r
+    uint8 requestHandled = USBFS_1_FALSE;\r
+    uint8 interfaceNumber = 0u;\r
+\r
+    switch(CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK)\r
+    {\r
+        case USBFS_1_RQST_RCPT_IFC:        /* Class-specific request directed to an interface */\r
+            interfaceNumber = CY_GET_REG8(USBFS_1_wIndexLo); /* wIndexLo contain Interface number */\r
+            break;\r
+        case USBFS_1_RQST_RCPT_EP:         /* Class-specific request directed to the endpoint */\r
+            /* Find related interface to the endpoint, wIndexLo contain EP number */\r
+            interfaceNumber =\r
+                USBFS_1_EP[CY_GET_REG8(USBFS_1_wIndexLo) & USBFS_1_DIR_UNUSED].interface;\r
+            break;\r
+        default:    /* RequestHandled is initialized as FALSE by default */\r
+            break;\r
+    }\r
+    /* Handle Class request depend on interface type */\r
+    switch(USBFS_1_interfaceClass[interfaceNumber])\r
+    {\r
+        case USBFS_1_CLASS_HID:\r
+            #if defined(USBFS_1_ENABLE_HID_CLASS)\r
+                requestHandled = USBFS_1_DispatchHIDClassRqst();\r
+            #endif /* USBFS_1_ENABLE_HID_CLASS */\r
+            break;\r
+        case USBFS_1_CLASS_AUDIO:\r
+            #if defined(USBFS_1_ENABLE_AUDIO_CLASS)\r
+                requestHandled = USBFS_1_DispatchAUDIOClassRqst();\r
+            #endif /* USBFS_1_ENABLE_HID_CLASS */\r
+            break;\r
+        case USBFS_1_CLASS_CDC:\r
+            #if defined(USBFS_1_ENABLE_CDC_CLASS)\r
+                requestHandled = USBFS_1_DispatchCDCClassRqst();\r
+            #endif /* USBFS_1_ENABLE_CDC_CLASS */\r
+            break;\r
+        default:    /* requestHandled is initialized as FALSE by default */\r
+            break;\r
+    }\r
+\r
+    /* `#START USER_DEFINED_CLASS_CODE` Place your Class request here */\r
+\r
+    /* `#END` */\r
+\r
+    return(requestHandled);\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Additional user functions supporting Class Specific Requests\r
+********************************************************************************/\r
+\r
+/* `#START CLASS_SPECIFIC_FUNCTIONS` Place any additional functions here */\r
+\r
+/* `#END` */\r
+\r
+#endif /* USBFS_1_EXTERN_CLS */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_descr.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_descr.c
new file mode 100644 (file)
index 0000000..2469573
--- /dev/null
@@ -0,0 +1,180 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_descr.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  USB descriptors and storage.\r
+*\r
+*  Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "USBFS_1.h"\r
+#include "USBFS_1_pvt.h"\r
+\r
+\r
+/*****************************************************************************\r
+*  User supplied descriptors.  If you want to specify your own descriptors,\r
+*  remove the comments around the define USER_SUPPLIED_DESCRIPTORS below and\r
+*  add your descriptors.\r
+*****************************************************************************/\r
+/* `#START USER_DESCRIPTORS_DECLARATIONS` Place your declaration here */\r
+\r
+/* `#END` */\r
+\r
+\r
+/***************************************\r
+*  USB Customizer Generated Descriptors\r
+***************************************/\r
+\r
+#if !defined(USER_SUPPLIED_DESCRIPTORS)\r
+/*********************************************************************\r
+* Device Descriptors\r
+*********************************************************************/\r
+const uint8 CYCODE USBFS_1_DEVICE0_DESCR[18u] = {\r
+/* Descriptor Length                       */ 0x12u,\r
+/* DescriptorType: DEVICE                  */ 0x01u,\r
+/* bcdUSB (ver 2.0)                        */ 0x00u, 0x02u,\r
+/* bDeviceClass                            */ 0x00u,\r
+/* bDeviceSubClass                         */ 0x00u,\r
+/* bDeviceProtocol                         */ 0x00u,\r
+/* bMaxPacketSize0                         */ 0x08u,\r
+/* idVendor                                */ 0xB4u, 0x04u,\r
+/* idProduct                               */ 0x51u, 0x80u,\r
+/* bcdDevice                               */ 0x00u, 0x00u,\r
+/* iManufacturer                           */ 0x00u,\r
+/* iProduct                                */ 0x00u,\r
+/* iSerialNumber                           */ 0x00u,\r
+/* bNumConfigurations                      */ 0x01u\r
+};\r
+/*********************************************************************\r
+* Config Descriptor  \r
+*********************************************************************/\r
+const uint8 CYCODE USBFS_1_DEVICE0_CONFIGURATION0_DESCR[25u] = {\r
+/*  Config Descriptor Length               */ 0x09u,\r
+/*  DescriptorType: CONFIG                 */ 0x02u,\r
+/*  wTotalLength                           */ 0x19u, 0x00u,\r
+/*  bNumInterfaces                         */ 0x01u,\r
+/*  bConfigurationValue                    */ 0x01u,\r
+/*  iConfiguration                         */ 0x00u,\r
+/*  bmAttributes                           */ 0xC0u,\r
+/*  bMaxPower                              */ 0x00u,\r
+/*********************************************************************\r
+* Interface Descriptor\r
+*********************************************************************/\r
+/*  Interface Descriptor Length            */ 0x09u,\r
+/*  DescriptorType: INTERFACE              */ 0x04u,\r
+/*  bInterfaceNumber                       */ 0x00u,\r
+/*  bAlternateSetting                      */ 0x00u,\r
+/*  bNumEndpoints                          */ 0x01u,\r
+/*  bInterfaceClass                        */ 0x00u,\r
+/*  bInterfaceSubClass                     */ 0x00u,\r
+/*  bInterfaceProtocol                     */ 0x00u,\r
+/*  iInterface                             */ 0x00u,\r
+/*********************************************************************\r
+* Endpoint Descriptor\r
+*********************************************************************/\r
+/*  Endpoint Descriptor Length             */ 0x07u,\r
+/*  DescriptorType: ENDPOINT               */ 0x05u,\r
+/*  bEndpointAddress                       */ 0x01u,\r
+/*  bmAttributes                           */ 0x02u,\r
+/*  wMaxPacketSize                         */ 0x08u, 0x00u,\r
+/*  bInterval                              */ 0x0Au\r
+};\r
+\r
+\r
+\r
+\r
+\r
+/*********************************************************************\r
+* Endpoint Setting Table -- This table contain the endpoint setting\r
+*                           for each endpoint in the configuration. It\r
+*                           contains the necessary information to\r
+*                           configure the endpoint hardware for each\r
+*                           interface and alternate setting.\r
+*********************************************************************/\r
+const T_USBFS_1_EP_SETTINGS_BLOCK CYCODE USBFS_1_DEVICE0_CONFIGURATION0_EP_SETTINGS_TABLE[1u] = {\r
+/* IFC  ALT    EPAddr bmAttr MaxPktSize Class ********************/\r
+{0x00u, 0x00u, 0x01u, 0x02u, 0x0008u,   0x00u}\r
+};\r
+const uint8 CYCODE USBFS_1_DEVICE0_CONFIGURATION0_INTERFACE_CLASS[1u] = {\r
+0x00u\r
+};\r
+/*********************************************************************\r
+* Config Dispatch Table -- Points to the Config Descriptor and each of\r
+*                          and endpoint setup table and to each\r
+*                          interface table if it specifies a USB Class\r
+*********************************************************************/\r
+const T_USBFS_1_LUT CYCODE USBFS_1_DEVICE0_CONFIGURATION0_TABLE[4u] = {\r
+    {0x01u,     &USBFS_1_DEVICE0_CONFIGURATION0_DESCR},\r
+    {0x01u,     &USBFS_1_DEVICE0_CONFIGURATION0_EP_SETTINGS_TABLE},\r
+    {0x00u,    NULL},\r
+    {0x00u,     &USBFS_1_DEVICE0_CONFIGURATION0_INTERFACE_CLASS}\r
+};\r
+/*********************************************************************\r
+* Device Dispatch Table -- Points to the Device Descriptor and each of\r
+*                          and Configuration Tables for this Device \r
+*********************************************************************/\r
+const T_USBFS_1_LUT CYCODE USBFS_1_DEVICE0_TABLE[2u] = {\r
+    {0x01u,     &USBFS_1_DEVICE0_DESCR},\r
+    {0x01u,     &USBFS_1_DEVICE0_CONFIGURATION0_TABLE}\r
+};\r
+/*********************************************************************\r
+* Device Table -- Indexed by the device number.\r
+*********************************************************************/\r
+const T_USBFS_1_LUT CYCODE USBFS_1_TABLE[1u] = {\r
+    {0x01u,     &USBFS_1_DEVICE0_TABLE}\r
+};\r
+\r
+#endif /* USER_SUPPLIED_DESCRIPTORS */\r
+\r
+#if defined(USBFS_1_ENABLE_MSOS_STRING)\r
+\r
+    /******************************************************************************\r
+    *  USB Microsoft OS String Descriptor\r
+    *  "MSFT" identifies a Microsoft host\r
+    *  "100" specifies version 1.00\r
+    *  USBFS_1_GET_EXTENDED_CONFIG_DESCRIPTOR becomes the bRequest value\r
+    *  in a host vendor device/class request\r
+    ******************************************************************************/\r
+\r
+    const uint8 CYCODE USBFS_1_MSOS_DESCRIPTOR[USBFS_1_MSOS_DESCRIPTOR_LENGTH] = {\r
+    /* Descriptor Length                       */   0x12u,\r
+    /* DescriptorType: STRING                  */   0x03u,\r
+    /* qwSignature - "MSFT100"                 */   (uint8)'M', 0u, (uint8)'S', 0u, (uint8)'F', 0u, (uint8)'T', 0u,\r
+                                                    (uint8)'1', 0u, (uint8)'0', 0u, (uint8)'0', 0u,\r
+    /* bMS_VendorCode:                         */   USBFS_1_GET_EXTENDED_CONFIG_DESCRIPTOR,\r
+    /* bPad                                    */   0x00u\r
+    };\r
+\r
+    /* Extended Configuration Descriptor */\r
+\r
+    const uint8 CYCODE USBFS_1_MSOS_CONFIGURATION_DESCR[USBFS_1_MSOS_CONF_DESCR_LENGTH] = {\r
+    /*  Length of the descriptor 4 bytes       */   0x28u, 0x00u, 0x00u, 0x00u,\r
+    /*  Version of the descriptor 2 bytes      */   0x00u, 0x01u,\r
+    /*  wIndex - Fixed:INDEX_CONFIG_DESCRIPTOR */   0x04u, 0x00u,\r
+    /*  bCount - Count of device functions.    */   0x01u,\r
+    /*  Reserved : 7 bytes                     */   0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,\r
+    /*  bFirstInterfaceNumber                  */   0x00u,\r
+    /*  Reserved                               */   0x01u,\r
+    /*  compatibleID    - "CYUSB\0\0"          */   (uint8)'C', (uint8)'Y', (uint8)'U', (uint8)'S', (uint8)'B',\r
+                                                    0x00u, 0x00u, 0x00u,\r
+    /*  subcompatibleID - "00001\0\0"          */   (uint8)'0', (uint8)'0', (uint8)'0', (uint8)'0', (uint8)'1',\r
+                                                    0x00u, 0x00u, 0x00u,\r
+    /*  Reserved : 6 bytes                     */   0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u\r
+    };\r
+\r
+#endif /* USBFS_1_ENABLE_MSOS_STRING */\r
+\r
+/* DIE ID string descriptor for 8 bytes ID */\r
+#if defined(USBFS_1_ENABLE_IDSN_STRING)\r
+    uint8 USBFS_1_idSerialNumberStringDescriptor[USBFS_1_IDSN_DESCR_LENGTH];\r
+#endif /* USBFS_1_ENABLE_IDSN_STRING */\r
+\r
+\r
+/* [] END OF FILE */\r
diff --git a/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_drv.c b/software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/USBFS_1_drv.c
new file mode 100644 (file)
index 0000000..282d1d1
--- /dev/null
@@ -0,0 +1,781 @@
+/*******************************************************************************\r
+* File Name: USBFS_1_drv.c\r
+* Version 2.60\r
+*\r
+* Description:\r
+*  Endpoint 0 Driver for the USBFS Component.\r
+*\r
+* Note:\r
+*\r
+********************************************************************************\r
+* Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
+* You may use this file only in accordance with the license, terms, conditions,\r
+* disclaimers, and limitations in the end user license agreement accompanying\r
+* the software package with which this file was provided.\r
+*******************************************************************************/\r
+\r
+#include "USBFS_1.h"\r
+#include "USBFS_1_pvt.h"\r
+\r
+\r
+/***************************************\r
+* Global data allocation\r
+***************************************/\r
+\r
+volatile T_USBFS_1_EP_CTL_BLOCK USBFS_1_EP[USBFS_1_MAX_EP];\r
+volatile uint8 USBFS_1_configuration;\r
+volatile uint8 USBFS_1_interfaceNumber;\r
+volatile uint8 USBFS_1_configurationChanged;\r
+volatile uint8 USBFS_1_deviceAddress;\r
+volatile uint8 USBFS_1_deviceStatus;\r
+volatile uint8 USBFS_1_interfaceSetting[USBFS_1_MAX_INTERFACES_NUMBER];\r
+volatile uint8 USBFS_1_interfaceSetting_last[USBFS_1_MAX_INTERFACES_NUMBER];\r
+volatile uint8 USBFS_1_interfaceStatus[USBFS_1_MAX_INTERFACES_NUMBER];\r
+volatile uint8 USBFS_1_device;\r
+const uint8 CYCODE *USBFS_1_interfaceClass;\r
+\r
+\r
+/***************************************\r
+* Local data allocation\r
+***************************************/\r
+\r
+volatile uint8 USBFS_1_ep0Toggle;\r
+volatile uint8 USBFS_1_lastPacketSize;\r
+volatile uint8 USBFS_1_transferState;\r
+volatile T_USBFS_1_TD USBFS_1_currentTD;\r
+volatile uint8 USBFS_1_ep0Mode;\r
+volatile uint8 USBFS_1_ep0Count;\r
+volatile uint16 USBFS_1_transferByteCount;\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_ep_0_Interrupt\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This Interrupt Service Routine handles Endpoint 0 (Control Pipe) traffic.\r
+*  It dispatches setup requests and handles the data and status stages.\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+*******************************************************************************/\r
+CY_ISR(USBFS_1_EP_0_ISR)\r
+{\r
+    uint8 bRegTemp;\r
+    uint8 modifyReg;\r
+\r
+\r
+    bRegTemp = CY_GET_REG8(USBFS_1_EP0_CR_PTR);\r
+    if ((bRegTemp & USBFS_1_MODE_ACKD) != 0u)\r
+    {\r
+        modifyReg = 1u;\r
+        if ((bRegTemp & USBFS_1_MODE_SETUP_RCVD) != 0u)\r
+        {\r
+            if((bRegTemp & USBFS_1_MODE_MASK) != USBFS_1_MODE_NAK_IN_OUT)\r
+            {\r
+                modifyReg = 0u;                                     /* When mode not NAK_IN_OUT => invalid setup */\r
+            }\r
+            else\r
+            {\r
+                USBFS_1_HandleSetup();\r
+                if((USBFS_1_ep0Mode & USBFS_1_MODE_SETUP_RCVD) != 0u)\r
+                {\r
+                    modifyReg = 0u;                         /* if SETUP bit set -> exit without modifying the mode */\r
+                }\r
+\r
+            }\r
+        }\r
+        else if ((bRegTemp & USBFS_1_MODE_IN_RCVD) != 0u)\r
+        {\r
+            USBFS_1_HandleIN();\r
+        }\r
+        else if ((bRegTemp & USBFS_1_MODE_OUT_RCVD) != 0u)\r
+        {\r
+            USBFS_1_HandleOUT();\r
+        }\r
+        else\r
+        {\r
+            modifyReg = 0u;\r
+        }\r
+        if(modifyReg != 0u)\r
+        {\r
+            bRegTemp = CY_GET_REG8(USBFS_1_EP0_CR_PTR);    /* unlock registers */\r
+            if((bRegTemp & USBFS_1_MODE_SETUP_RCVD) == 0u)  /* Check if SETUP bit is not set, otherwise exit */\r
+            {\r
+                /* Update the count register */\r
+                bRegTemp = USBFS_1_ep0Toggle | USBFS_1_ep0Count;\r
+                CY_SET_REG8(USBFS_1_EP0_CNT_PTR, bRegTemp);\r
+                if(bRegTemp == CY_GET_REG8(USBFS_1_EP0_CNT_PTR))   /* continue if writing was successful */\r
+                {\r
+                    do\r
+                    {\r
+                        modifyReg = USBFS_1_ep0Mode;       /* Init temporary variable */\r
+                        /* Unlock registers */\r
+                        bRegTemp = CY_GET_REG8(USBFS_1_EP0_CR_PTR) & USBFS_1_MODE_SETUP_RCVD;\r
+                        if(bRegTemp == 0u)                          /* Check if SETUP bit is not set */\r
+                        {\r
+                            /* Set the Mode Register  */\r
+                            CY_SET_REG8(USBFS_1_EP0_CR_PTR, USBFS_1_ep0Mode);\r
+                            /* Writing check */\r
+                            modifyReg = CY_GET_REG8(USBFS_1_EP0_CR_PTR) & USBFS_1_MODE_MASK;\r
+                        }\r
+                    }while(modifyReg != USBFS_1_ep0Mode);  /* Repeat if writing was not successful */\r
+                }\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+* Function Name: USBFS_1_HandleSetup\r
+********************************************************************************\r
+*\r
+* Summary:\r
+*  This Routine dispatches requests for the four USB request types\r
+*\r
+* Parameters:\r
+*  None.\r
+*\r
+* Return:\r
+*  None.\r
+*\r
+* Reentrant:\r
+*  No.\r
+*\r
+*******************************************************************************/\r
+void USBFS_1_HandleSetup(void) \r
+{\r
+    uint8 requestHandled;\r
+\r
+    requestHandled = CY_GET_REG8(USBFS_1_EP0_CR_PTR);      /* unlock registers */\r
+    CY_SET_REG8(USBFS_1_EP0_CR_PTR, requestHandled);       /* clear setup bit */\r
+    requestHandled = CY_GET_REG8(