@@ -64,48 +64,6 @@ impl From<u8> for UsbEp {
64
64
}
65
65
}
66
66
67
- /// FFI bindings to USBD functions inlined here for clarity
68
- /// and also because some of the generated ones are incorrectly
69
- /// assuming mutable pointers when they are not
70
- /*#[repr(C)]
71
- #[derive(Copy, Clone)]
72
- pub struct apdu_buffer_s {
73
- pub buf: *mut u8,
74
- pub len: u16,
75
- }
76
- impl Default for apdu_buffer_s {
77
- fn default() -> Self {
78
- unsafe { ::core::mem::zeroed() }
79
- }
80
- }
81
- pub type ApduBufferT = apdu_buffer_s;
82
- extern "C" {
83
- pub static mut USBD_Device: USBD_HandleTypeDef;
84
- pub fn USBD_LL_SetupStage(
85
- pdev: *mut USBD_HandleTypeDef,
86
- psetup: *const u8,
87
- ) -> USBD_StatusTypeDef;
88
- pub fn USBD_LL_DataOutStage(
89
- pdev: *mut USBD_HandleTypeDef,
90
- epnum: u8,
91
- pdata: *const u8,
92
- arg1: *mut ApduBufferT,
93
- ) -> USBD_StatusTypeDef;
94
- pub fn USBD_LL_DataInStage(
95
- pdev: *mut USBD_HandleTypeDef,
96
- epnum: u8,
97
- pdata: *const u8,
98
- ) -> USBD_StatusTypeDef;
99
- pub fn USBD_LL_Reset(pdev: *mut USBD_HandleTypeDef) -> USBD_StatusTypeDef;
100
- pub fn USBD_LL_SetSpeed(
101
- pdev: *mut USBD_HandleTypeDef,
102
- speed: USBD_SpeedTypeDef,
103
- ) -> USBD_StatusTypeDef;
104
- pub fn USBD_LL_Suspend(pdev: *mut USBD_HandleTypeDef) -> USBD_StatusTypeDef;
105
- pub fn USBD_LL_Resume(pdev: *mut USBD_HandleTypeDef) -> USBD_StatusTypeDef;
106
- pub fn USBD_LL_SOF(pdev: *mut USBD_HandleTypeDef) -> USBD_StatusTypeDef;
107
- }*/
108
-
109
67
/// Below is a straightforward translation of the corresponding functions
110
68
/// in the C SDK, they could be improved
111
69
pub fn handle_usb_event ( event : u8 ) {
0 commit comments