8a9aaa2487
Some other optimizations for size.
63 lines
2 KiB
C
63 lines
2 KiB
C
/*
|
|
* CTHN.de MiniLEDCube
|
|
*
|
|
* usb.c by Kai Lauterbach 11/2011
|
|
*
|
|
* Based on project: hid-custom-rq example by Christian Starkjohann
|
|
* Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
|
|
*
|
|
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
|
|
*
|
|
*/
|
|
|
|
#ifndef __usb_h__
|
|
#define __usb_h__
|
|
|
|
#include <avr/eeprom.h>
|
|
|
|
#ifndef EEMEM
|
|
#define EEMEM __attribute__ ((section (".eeprom")))
|
|
#endif
|
|
|
|
#include "globals.h"
|
|
|
|
#include "usbconfig.h"
|
|
#include "usbdrv.h"
|
|
#include "requests.h" /* The custom request numbers we use */
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
/* ----------------------------- USB interface ----------------------------- */
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
PROGMEM char usbHidReportDescriptor[22] = { /* USB report descriptor */
|
|
0x06, 0x00, 0xff, // USAGE_PAGE (Generic Desktop)
|
|
0x09, 0x01, // USAGE (Vendor Usage 1)
|
|
0xa1, 0x01, // COLLECTION (Application)
|
|
0x15, 0x00, // LOGICAL_MINIMUM (0)
|
|
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
|
|
0x75, 0x08, // REPORT_SIZE (8)
|
|
0x95, 0x01, // REPORT_COUNT (1)
|
|
0x09, 0x00, // USAGE (Undefined)
|
|
0xb2, 0x02, 0x01, // FEATURE (Data,Var,Abs,Buf)
|
|
0xc0 // END_COLLECTION
|
|
};
|
|
/* The descriptor above is a dummy only, it silences the drivers. The report
|
|
* it describes consists of one byte of undefined data.
|
|
* We don't transfer our data through HID reports, we use custom requests
|
|
* instead.
|
|
*/
|
|
|
|
void init_usb(void);
|
|
|
|
extern uint32_t eep_anim[MAX_EEPROM_FRAMES] EEMEM;
|
|
|
|
// usb buffer
|
|
extern uint32_t frame; // Framebuffer
|
|
extern uint8_t delay_max; // delay in ISR aufrufen
|
|
extern uint8_t mode; // FW mode
|
|
|
|
//extern cube_t *cube;
|
|
extern void loadEEPROMFrame(uint8_t);
|
|
|
|
#endif // __usb_h__
|
|
|