2012-01-03 05:28:53 +01:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
|
|
|
* @addtogroup PIOS_USBHOOK USB glue code
|
|
|
|
* @brief Glue between PiOS and STM32 libs
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file pios_usbhook.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief APIs for PIOS_USBHOOK layer
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2011-09-10 05:26:19 +02:00
|
|
|
#ifndef PIOS_USBHOOK_H
|
|
|
|
#define PIOS_USBHOOK_H
|
2010-09-27 09:28:45 +02:00
|
|
|
|
|
|
|
typedef enum _HID_REQUESTS {
|
|
|
|
GET_REPORT = 1,
|
|
|
|
GET_IDLE,
|
|
|
|
GET_PROTOCOL,
|
|
|
|
|
|
|
|
SET_REPORT = 9,
|
|
|
|
SET_IDLE,
|
|
|
|
SET_PROTOCOL
|
|
|
|
} HID_REQUESTS;
|
|
|
|
|
2011-09-08 03:39:56 +02:00
|
|
|
typedef enum CDC_REQUESTS {
|
|
|
|
SET_LINE_CODING = 0x20,
|
|
|
|
GET_LINE_CODING = 0x21,
|
|
|
|
SET_CONTROL_LINE_STATE = 0x23,
|
|
|
|
} CDC_REQUESTS;
|
|
|
|
|
2012-01-14 20:17:06 +01:00
|
|
|
enum usb_string_desc {
|
|
|
|
USB_STRING_DESC_LANG = 0,
|
|
|
|
USB_STRING_DESC_VENDOR = 1,
|
|
|
|
USB_STRING_DESC_PRODUCT = 2,
|
|
|
|
USB_STRING_DESC_SERIAL = 3,
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
extern void PIOS_USBHOOK_RegisterDevice(const uint8_t * desc, uint16_t desc_size);
|
|
|
|
extern void PIOS_USBHOOK_RegisterConfig(uint8_t config_id, const uint8_t * desc, uint16_t desc_size);
|
|
|
|
extern void PIOS_USBHOOK_RegisterString(enum usb_string_desc string_id, const uint8_t * desc, uint16_t desc_size);
|
|
|
|
extern void PIOS_USBHOOK_RegisterHidInterface(const uint8_t * desc, uint16_t desc_size);
|
|
|
|
extern void PIOS_USBHOOK_RegisterHidReport(const uint8_t * desc, uint16_t desc_size);
|
|
|
|
|
2011-09-10 05:26:19 +02:00
|
|
|
#endif /* PIOS_USBHOOK_H */
|
2010-09-27 09:28:45 +02:00
|
|
|
|