U2F 장치 검색에서 어디에 잡히는 지 한참 보아야 하였습니다.
HID 준수 장치라고 잡힌게 U2F 장치입니다.
자세히는 기타 디바이스 설정에서 볼 수 있었습니다.
- 디스크립션 내용 -
ST Micro에서는 CustomHID 파일을 사용하면 됩니다.
/**
******************************************************************************
* @file usb_desc.c
* @author MCD Application Team
* @version V4.1.0
* @date 26-May-2017
* @brief Descriptors for Custom HID Demo
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "usb_lib.h"
#include "usb_desc.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* USB Standard Device Descriptor */
const uint8_t CustomHID_DeviceDescriptor[CUSTOMHID_SIZ_DEVICE_DESC] =
{
0x12, /*bLength */
USB_DEVICE_DESCRIPTOR_TYPE, /*bDescriptorType*/
0x10, /*bcdUSB */
0x01,
0x00, /*bDeviceClass*/
0x00, /*bDeviceSubClass*/
0x00, /*bDeviceProtocol*/
0x40, /*bMaxPacketSize 64*/
0x00, /*idVendor (0x0000) <= 자사의 밴더 ID에 맞게 설정*/
0x00,
0x00, /*idProduct = 0x0000 <= 자사의 프로덕트 ID에 맞게 설정 */
0x00,
0x03, /*bcdDevice rel. 2.00*/
0x10,
1, /*Index of string descriptor describing
manufacturer */
2, /*Index of string descriptor describing
product*/
0, /*Index of string descriptor describing the
device serial number */
0x01 /*bNumConfigurations*/
}
; /* CustomHID_DeviceDescriptor */
/* USB Configuration Descriptor */
/* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
const uint8_t CustomHID_ConfigDescriptor[CUSTOMHID_SIZ_CONFIG_DESC] =
{
0x09, /* bLength: Configuration Descriptor size */
0X02, //USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
0X29, //CUSTOMHID_SIZ_CONFIG_DESC,
/* wTotalLength: Bytes returned */
0x00,
0x01, /* bNumInterfaces: 1 interface */
0x01, /* bConfigurationValue: Configuration value */
0x00, /* iConfiguration: Index of string descriptor describing
the configuration*/
0x80, /* bmAttributes: Self powered */
0x32, /* MaxPower 100 mA: this current is used for detecting Vbus */
/************** Descriptor of Custom HID interface ****************/
/* 09 */
0x09, /* bLength: Interface Descriptor size */
0x04, //USB_INTERFACE_DESCRIPTOR_TYPE,/* bDescriptorType: Interface descriptor type */
0x00, /* bInterfaceNumber: Number of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x02, /* bNumEndpoints */
0x03, /* bInterfaceClass: HID */
0x00, /* bInterfaceSubClass : 1=BOOT, 0=no boot */
0x00, /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse */
0, /* iInterface: Index of string descriptor */
/******************** Descriptor of Custom HID HID ********************/
/* 18 */
0x09, /* bLength: HID Descriptor size */
0x21, //HID_DESCRIPTOR_TYPE, /* bDescriptorType: HID */
0x10, /* bcdHID: HID Class Spec release number */
0x01,
0x00, /* bCountryCode: Hardware target country */
0x01, /* bNumDescriptors: Number of HID class descriptors to follow */
0x22, /* bDescriptorType */
0x22, //CUSTOMHID_SIZ_REPORT_DESC,/* wItemLength: Total length of Report descriptor */
0x00,
/******************** Descriptor of Custom HID endpoints ******************/
/* 27 */
0x07, /* bLength: Endpoint Descriptor size */
0x05, //USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: */
0x81,//0x83 /* bEndpointAddress: Endpoint Address (IN) */
0x03, /* bmAttributes: Interrupt endpoint */
0x40,//0x02, /* wMaxPacketSize: 2 Bytes max */
0x00,
0x05,//0x20, /* bInterval: Polling Interval (32 ms) */
/* 34 */
0x07, /* bLength: Endpoint Descriptor size */
0x05, //USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: */
/* Endpoint descriptor type */
0x01,//0x04 /* bEndpointAddress: */
/* Endpoint Address (OUT) */
0x03, /* bmAttributes: Interrupt endpoint */
0x40,//0x02, /* wMaxPacketSize: 2 Bytes max */
0x00,
0x05,//0x20, /* bInterval: Polling Interval (20 ms) */
/* 41 */
}
; /* CustomHID_ConfigDescriptor */
const uint8_t CustomHID_ReportDescriptor[CUSTOMHID_SIZ_REPORT_DESC] =
{
/*
const uint8_t HID_ReportDescriptor[] = {
HID_UsagePage ( FIDO_USAGE_PAGE ),
HID_Usage ( FIDO_USAGE_U2FHID ),
HID_Collection ( HID_Application ),
HID_Usage ( FIDO_USAGE_DATA_IN ),
HID_LogicalMin ( 0 ),
HID_LogicalMaxS ( 0xff ),
HID_ReportSize ( 8 ),
HID_ReportCount ( HID_INPUT_REPORT_BYTES ),
HID_Input ( HID_Data | HID_Absolute | HID_Variable ),
HID_Usage ( FIDO_USAGE_DATA_OUT ),
HID_LogicalMin ( 0 ),
HID_LogicalMaxS ( 0xff ),
HID_ReportSize ( 8 ),
HID_ReportCount ( HID_OUTPUT_REPORT_BYTES ),
HID_Output ( HID_Data | HID_Absolute | HID_Variable ),
HID_EndCollection
};
*/
0x06, 0xd0, 0xf1, /* HID_UsagePage ( FIDO_USAGE_PAGE ), */
0x09, 0x01, /* HID_Usage ( FIDO_USAGE_U2FHID ), */
0xa1, 0x01, /* HID_Collection ( HID_Application ), */
0x09, 0x20, /* HID_Usage ( FIDO_USAGE_DATA_IN ), */
0x15, 0x00, /* HID_LogicalMin ( 0 ), */
0x26, 0xff, 0x00, /* HID_LogicalMaxS ( 0xff ), */
0x75, 0x08, /* HID_ReportSize ( 8 ) */
0x95, HID_PACKET_SIZE, /* HID_ReportCount ( HID_INPUT_REPORT_BYTES ), */
0x81, 0x02, /* HID_Input ( HID_Data | HID_Absolute | HID_Variable ), */
0x09, 0x21, /* HID_Usage ( FIDO_USAGE_DATA_OUT ), */
0x15, 0x00, /* HID_LogicalMin ( 0 ), */
0x26, 0xff, 0x00, /* HID_LogicalMaxS ( 0xff ), */
0x75, 0x08, /* HID_ReportSize ( 8 ), */
0x95, HID_PACKET_SIZE, /* HID_ReportCount ( HID_OUTPUT_REPORT_BYTES ), */
0x91, 0x02, /* HID_Output ( HID_Data | HID_Absolute | HID_Variable ), */
0xc0 /* HID_EndCollection */
}; /* CustomHID_ReportDescriptor */
/* USB String Descriptors (optional) */
const uint8_t CustomHID_StringLangID[CUSTOMHID_SIZ_STRING_LANGID] =
{
CUSTOMHID_SIZ_STRING_LANGID,
USB_STRING_DESCRIPTOR_TYPE,
0x09,
0x04
}
; /* LangID = 0x0409: U.S. English */
const uint8_t CustomHID_StringVendor[CUSTOMHID_SIZ_STRING_VENDOR] =
{
CUSTOMHID_SIZ_STRING_VENDOR, /* Size of Vendor string */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType*/
/* Manufacturer: "STMicroelectronics" */
'X', 0, 'X', 0, 'X', 0, 'X', 0, 'X', 0, 'X', 0, 'X', 0, 'C', 0,
'O', 0, 'M', 0, 'P', 0, 'A', 0, 'N', 0, 'Y', 0
};
const uint8_t CustomHID_StringProduct[CUSTOMHID_SIZ_STRING_PRODUCT] =
{
CUSTOMHID_SIZ_STRING_PRODUCT, /* bLength */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'H', 0, 'Y', 0, 'P', 0, 'E', 0, 'R', 0, 'F', 0, 'I', 0,
'D', 0, 'O', 0, ' ', 0, 'T', 0, 'o', 0, 'k', 0, 'e', 0,
'n', 0
};
uint8_t CustomHID_StringSerial[CUSTOMHID_SIZ_STRING_SERIAL] =
{
CUSTOMHID_SIZ_STRING_SERIAL, /* bLength */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'X', 0, 'X', 0, 'U', 0,'X', 0,'X', 0
};
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
'초보의 아웅다웅 설계하기 > FIDO 와 전자화폐 지갑' 카테고리의 다른 글
하드웨어 가상화폐 저장소 (0) | 2018.03.05 |
---|