Loading...
Searching...
No Matches
furi_hal_usb.h
1#pragma once
2
3#include "usb.h"
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
10
12 void (*init)(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx);
13 void (*deinit)(usbd_device* dev);
14 void (*wakeup)(usbd_device* dev);
15 void (*suspend)(usbd_device* dev);
16
17 struct usb_device_descriptor* dev_descr;
18
19 void* str_manuf_descr;
20 void* str_prod_descr;
21 void* str_serial_descr;
22
23 void* cfg_descr;
24};
25
27extern FuriHalUsbInterface usb_cdc_single;
28extern FuriHalUsbInterface usb_cdc_dual;
29extern FuriHalUsbInterface usb_hid;
30extern FuriHalUsbInterface usb_hid_u2f;
31extern FuriHalUsbInterface usb_ccid;
32
33typedef enum {
34 FuriHalUsbStateEventReset,
35 FuriHalUsbStateEventWakeup,
36 FuriHalUsbStateEventSuspend,
37 FuriHalUsbStateEventDescriptorRequest,
38} FuriHalUsbStateEvent;
39
40typedef void (*FuriHalUsbStateCallback)(FuriHalUsbStateEvent state, void* context);
41
44void furi_hal_usb_init(void);
45
52bool furi_hal_usb_set_config(FuriHalUsbInterface* new_if, void* ctx);
53
58FuriHalUsbInterface* furi_hal_usb_get_config(void);
59
62void furi_hal_usb_lock(void);
63
66void furi_hal_usb_unlock(void);
67
72bool furi_hal_usb_is_locked(void);
73
76void furi_hal_usb_disable(void);
77
80void furi_hal_usb_enable(void);
81
84void furi_hal_usb_set_state_callback(FuriHalUsbStateCallback cb, void* ctx);
85
88void furi_hal_usb_reinit(void);
89
90#ifdef __cplusplus
91}
92#endif
Definition furi_hal_usb.h:11