diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-26 19:36:54 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-26 19:36:54 -0600 |
commit | 71e1a86a033c380f85dd300d788af63bfef25bab (patch) | |
tree | 07aa53d5a933ba51535a78972edbfe0cd95a31c5 /usb_common.h | |
parent | f5da707e77ee954b12f3c961012e4f40fa4e1bd3 (diff) |
wip reorg
Diffstat (limited to 'usb_common.h')
-rw-r--r-- | usb_common.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/usb_common.h b/usb_common.h deleted file mode 100644 index 3b45246..0000000 --- a/usb_common.h +++ /dev/null @@ -1,59 +0,0 @@ -/* usb_common.h - Common framework for implementing multiple USB devices at once - * - * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> - * SPDX-Licence-Identifier: AGPL-3.0-or-later - */ - -#ifndef _USB_COMMON_H_ -#define _USB_COMMON_H_ - -#include "coroutine.h" - -/* Strings ********************************************************************/ - -enum { - /* Be sure to keep this list in-sync with - * usb_common.c:tud_descriptor_string_cb() */ - STRID_LANGID = 0, - STRID_MANUF, - STRID_PRODUCT, - STRID_SERIAL, - STRID_CFG, - STRID_KBD_IFC, - - STRID_NONE = 0, -}; - -/* Globals ********************************************************************/ - -extern uint8_t cfgnum_std; -void usb_common_earlyinit(void); -void usb_common_lateinit(void); -COROUTINE usb_common_cr(void *arg); - -/* Main utilities *************************************************************/ - -/** - * Declare a new TUD configuration. - * - * @param iConfiguration : ID of the string descriptor describing this configuration - * @param bmAttributes : bitmap of flags; TUSB_DESC_CONFIG_ATT_{REMOTE_WAKUP,SELF_POWERED} - * @param bMaxPower_mA : maximum power consumption of the device when in this configuration, in mA - * @return the configuration number for the created config - */ -uint8_t usb_add_config(uint8_t iConfiguration, uint8_t bmAttributes, uint8_t bMaxPower_mA); - -/** - * Add an interface to a configuration that has been created with usb_add_config(). - * - * @param cfg_num : the value returned from usb_add_config() - * @param ifc_len : the length of ifc_Dat - * @param ifc_dat : the raw descriptor data for the interface (probably created by - * TUD_{CLASS}_DESCRIPTOR(); grep TinyUSB/src/device/usbd.h for '#define - * TUD_\S*_DESCRIPTOR(_itfnum'). The interface number in this data is overwritten with the - * appropriate number for this config. - * @return the interface number for the added interface - */ -uint8_t usb_add_interface(uint8_t cfg_num, uint16_t ifc_len, uint8_t *ifc_dat); - -#endif /* _USB_COMMON_H_ */ |