1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00
LibrePilot/flight/PiOS/inc/pios_usbhook.h

65 lines
2.2 KiB
C

/**
******************************************************************************
* @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
*/
#ifndef PIOS_USBHOOK_H
#define PIOS_USBHOOK_H
typedef enum _HID_REQUESTS {
GET_REPORT = 1,
GET_IDLE,
GET_PROTOCOL,
SET_REPORT = 9,
SET_IDLE,
SET_PROTOCOL
} HID_REQUESTS;
typedef enum CDC_REQUESTS {
SET_LINE_CODING = 0x20,
GET_LINE_CODING = 0x21,
SET_CONTROL_LINE_STATE = 0x23,
} CDC_REQUESTS;
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);
#endif /* PIOS_USBHOOK_H */