simmel-bootloader/src/usb/tusb_descriptors.c

85 lines
3.3 KiB
C
Raw Normal View History

2018-04-02 06:11:21 +00:00
/**************************************************************************/
/*!
@file tusb_descriptors.c
@author hathach (tinyusb.org)
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, hathach (tinyusb.org)
All rights reserved.
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 the copyright holders 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 ''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 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.
This file is part of the tinyusb stack.
*/
/**************************************************************************/
2018-07-09 17:36:45 +00:00
#include "tusb.h"
2018-04-02 06:11:21 +00:00
//--------------------------------------------------------------------+
// STRING DESCRIPTORS
//--------------------------------------------------------------------+
// array of pointer to string descriptors
2018-07-02 04:09:00 +00:00
uint16_t const * const string_desc_arr [] =
2018-04-02 06:11:21 +00:00
{
2018-07-09 17:36:45 +00:00
// 0: is supported language = English
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV(0x0409),
2018-04-02 06:11:21 +00:00
2018-07-09 17:36:45 +00:00
// 1: Manufacturer
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV('A','d','a','f','r','u','i','t',' ','I','n','d','u','s','t','r','i','e','s'),
2018-04-02 06:11:21 +00:00
2018-07-09 17:36:45 +00:00
// 2: Product
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','n','R','F','5','2','8','4','0'),
2018-04-02 06:11:21 +00:00
2018-07-09 17:36:45 +00:00
// 3: Serials TODO use chip ID
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV('1', '2', '3', '4'),
2018-04-02 06:11:21 +00:00
2018-07-09 17:36:45 +00:00
// 4: CDC Interface
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','e','r','i','a','l'),
2018-04-02 06:11:21 +00:00
2018-07-09 17:36:45 +00:00
// 5: MSC Interface
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','t','o','r','a','g','e'),
2018-04-02 06:11:21 +00:00
2018-07-09 17:36:45 +00:00
// 6: Custom Interface
2018-07-03 09:40:07 +00:00
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','C','u','s','t','o','m')
2018-04-02 06:11:21 +00:00
};
2018-04-16 07:03:44 +00:00
2018-07-09 17:36:45 +00:00
// tud_desc_set is required by tinyusb stack
// since CFG_TUD_DESC_AUTO is enabled, we only need to set string_arr
2018-07-02 04:09:00 +00:00
tud_desc_set_t tud_desc_set =
2018-04-02 06:11:21 +00:00
{
2018-07-09 17:36:45 +00:00
.device = NULL,
.config = NULL,
2018-07-02 04:09:00 +00:00
.string_arr = (uint8_t const **) string_desc_arr,
2018-08-01 03:30:36 +00:00
.hid_report =
{
.generic = NULL,
.boot_keyboard = NULL,
.boot_mouse = NULL
}
2018-04-02 06:11:21 +00:00
};