2014-09-22 23:24:05 +02:00
|
|
|
/*
|
2014-10-15 21:39:06 +02:00
|
|
|
* økoyono MiniLEDCube
|
2011-12-20 22:36:04 +01:00
|
|
|
*
|
|
|
|
* 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)
|
|
|
|
*
|
2011-10-15 11:31:44 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __usb_h__
|
|
|
|
#define __usb_h__
|
|
|
|
|
2011-12-10 11:46:58 +01:00
|
|
|
#include <avr/eeprom.h>
|
|
|
|
|
2011-10-19 00:04:59 +02:00
|
|
|
#include "globals.h"
|
|
|
|
|
2014-09-29 22:43:38 +02:00
|
|
|
#include "util/delay.h"
|
2011-10-15 11:31:44 +02:00
|
|
|
#include "usbconfig.h"
|
|
|
|
#include "usbdrv.h"
|
|
|
|
#include "requests.h" /* The custom request numbers we use */
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
/* ----------------------------- USB interface ----------------------------- */
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
2014-05-13 22:24:09 +02:00
|
|
|
PROGMEM const char usbHidReportDescriptor[22] = { /* USB report descriptor */
|
2011-10-15 11:31:44 +02:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2011-12-20 22:36:04 +01:00
|
|
|
extern uint32_t eep_anim[MAX_EEPROM_FRAMES] EEMEM;
|
2011-12-10 11:46:58 +01:00
|
|
|
|
2011-10-19 00:04:59 +02:00
|
|
|
// usb buffer
|
2014-09-29 22:43:38 +02:00
|
|
|
extern union {
|
|
|
|
uint32_t all;
|
|
|
|
uint8_t bytes[4];
|
|
|
|
} frame; // Framebuffer
|
|
|
|
// extern uint32_t frame;
|
|
|
|
|
2011-12-18 22:16:32 +01:00
|
|
|
extern uint8_t mode; // FW mode
|
2011-12-17 22:03:57 +01:00
|
|
|
|
2011-10-15 11:31:44 +02:00
|
|
|
#endif // __usb_h__
|