flipperzero-firmware/firmware/targets/furi-hal-include/furi-hal-usb.h
Nikolay Minaylov 9e62f08e4d
[FL-1958] U2F prototype (#879)
* U2F implementation prototype
* U2F data encryption and store, user confirmation request
* remove debug prints
* fix notification bug in chrome
* split u2f_alloc into u2f_init and u2f_alloc
* typo fix, furi-hal-trng -> furi-hal-random
* rand/srand redefinition
* SubGhz: a little bit of Dante.
* u2f_data naming fix

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-12-22 23:04:08 +03:00

51 lines
1.0 KiB
C

#pragma once
#include "usb.h"
typedef struct UsbInterface UsbInterface;
struct UsbInterface {
void (*init)(usbd_device *dev, UsbInterface* intf);
void (*deinit)(usbd_device *dev);
void (*wakeup)(usbd_device *dev);
void (*suspend)(usbd_device *dev);
struct usb_device_descriptor* dev_descr;
void* str_manuf_descr;
void* str_prod_descr;
void* str_serial_descr;
void* cfg_descr;
};
/** USB device interface modes */
extern UsbInterface usb_cdc_single;
extern UsbInterface usb_cdc_dual;
extern UsbInterface usb_hid;
extern UsbInterface usb_hid_u2f;
/** USB device low-level initialization
*/
void furi_hal_usb_init();
/** Set USB device configuration
*
* @param mode new USB device mode
*/
void furi_hal_usb_set_config(UsbInterface* new_if);
/** Get USB device configuration
*
* @return current USB device mode
*/
UsbInterface* furi_hal_usb_get_config();
/** Disable USB device
*/
void furi_hal_usb_disable();
/** Enable USB device
*/
void furi_hal_usb_enable();