mirror of
https://github.com/sakumisu/CherryUSB.git
synced 2025-05-08 16:18:44 +08:00
Simplify the license rows, standardize header macro name
This commit is contained in:
parent
54c52944d2
commit
7377b5183d
@ -1,17 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB Audio Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* Header follows below documentation:
|
||||
* - USB Class Definition for Audio Devices (audio10.pdf)
|
||||
*
|
||||
* Additional documentation considered a part of USB Audio v1.0:
|
||||
* - USB Class Definition for Audio Data Formats (frmts10.pdf)
|
||||
* - USB Class Definition for Terminal Types (termt10.pdf)
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_AUDIO_H_
|
||||
#define _USB_AUDIO_H_
|
||||
#ifndef USB_AUDIO_H
|
||||
#define USB_AUDIO_H
|
||||
|
||||
/** Audio Interface Subclass Codes
|
||||
* Refer to Table A-2 from audio10.pdf
|
||||
@ -1093,4 +1086,4 @@ struct audio_v2_control_range3_param_block {
|
||||
#define AUDIO_SAMPLE_FREQ_4B(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), \
|
||||
(uint8_t)((frq >> 16)), (uint8_t)((frq >> 24))
|
||||
|
||||
#endif /* _USB_AUDIO_H_ */
|
||||
#endif /* USB_AUDIO_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_audio.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_audio.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_audio.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_AUDIO_H_
|
||||
#define _USBD_AUDIO_H_
|
||||
#ifndef USBD_AUDIO_H
|
||||
#define USBD_AUDIO_H
|
||||
|
||||
#include "usb_audio.h"
|
||||
|
||||
@ -45,4 +28,4 @@ void usbd_audio_sof_callback(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _USB_AUDIO_H_ */
|
||||
#endif /* USBD_AUDIO_H */
|
||||
|
@ -1,16 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB Communications Device Class (CDC) public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* Header follows the Class Definitions for
|
||||
* Communications Devices Specification (CDC120-20101103-track.pdf),
|
||||
* PSTN Devices Specification (PSTN120.pdf) and
|
||||
* Ethernet Control Model Devices Specification (ECM120.pdf).
|
||||
* Header is limited to ACM and ECM Subclasses.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_CDC_H
|
||||
#define _USB_CDC_H
|
||||
#ifndef USB_CDC_H
|
||||
#define USB_CDC_H
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Definitions based on usbcdc11.pdf (www.usb.org)
|
||||
@ -441,4 +435,4 @@ struct cdc_ecm_descriptor {
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
#endif /* USB_CDC_H_ */
|
||||
#endif /* USB_CDC_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_cdc.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_cdc.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_cdc.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_CDC_H
|
||||
#define _USBD_CDC_H
|
||||
#ifndef USBD_CDC_H
|
||||
#define USBD_CDC_H
|
||||
|
||||
#include "usb_cdc.h"
|
||||
|
||||
@ -41,4 +24,4 @@ void usbd_cdc_acm_set_rts(uint8_t intf, bool rts);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* USBD_CDC_H_ */
|
||||
#endif /* USBD_CDC_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_cdc_acm.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_cdc_acm.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_cdc_acm.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_CDC_ACM_H
|
||||
#define _USBH_CDC_ACM_H
|
||||
#ifndef USBH_CDC_ACM_H
|
||||
#define USBH_CDC_ACM_H
|
||||
|
||||
#include "usb_cdc.h"
|
||||
|
||||
@ -53,4 +36,4 @@ int usbh_cdc_acm_set_line_state(struct usbh_cdc_acm *cdc_acm_class, bool dtr, bo
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_CDC_ACM_H */
|
||||
|
@ -1,11 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB DFU Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_DFU_H_
|
||||
#define _USB_DFU_H_
|
||||
#ifndef USB_DFU_H
|
||||
#define USB_DFU_H
|
||||
|
||||
/**\addtogroup USB_MODULE_DFU USB DFU class
|
||||
* \brief This module contains USB Device Firmware Upgrade class definitions.
|
||||
@ -100,4 +99,4 @@ struct dfu_info {
|
||||
uint8_t iString; /**<\brief Index of the status string descriptor.*/
|
||||
};
|
||||
|
||||
#endif /* _USB_DFU_H_ */
|
||||
#endif /* USB_DFU_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_dfu.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_dfu.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_dfu.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_DFU_H_
|
||||
#define _USBD_DFU_H_
|
||||
#ifndef USBD_DFU_H
|
||||
#define USBD_DFU_H
|
||||
|
||||
#include "usb_dfu.h"
|
||||
|
||||
@ -35,4 +18,4 @@ void usbd_dfu_add_interface(usbd_class_t *devclass, usbd_interface_t *intf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _USBD_DFU_H_ */
|
||||
#endif /* USBD_DFU_H */
|
||||
|
@ -1,12 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Human Interface Device (HID) Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* Header follows Device Class Definition for Human Interface Devices (HID)
|
||||
* Version 1.11 document (HID1_11-1.pdf).
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __HID_H_
|
||||
#define __HID_H_
|
||||
#ifndef USB_HID_H
|
||||
#define USB_HID_H
|
||||
|
||||
/* Subclass codes (HID 4.2) */
|
||||
#define HID_SUBCLASS_NONE 0 /* No subclass */
|
||||
@ -578,131 +576,4 @@ struct usb_hid_js_report
|
||||
uint8_t throttle; /* Throttle */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief HID keyboard button codes.
|
||||
*/
|
||||
enum hid_kbd_code {
|
||||
HID_KEY_A = 4,
|
||||
HID_KEY_B = 5,
|
||||
HID_KEY_C = 6,
|
||||
HID_KEY_D = 7,
|
||||
HID_KEY_E = 8,
|
||||
HID_KEY_F = 9,
|
||||
HID_KEY_G = 10,
|
||||
HID_KEY_H = 11,
|
||||
HID_KEY_I = 12,
|
||||
HID_KEY_J = 13,
|
||||
HID_KEY_K = 14,
|
||||
HID_KEY_L = 15,
|
||||
HID_KEY_M = 16,
|
||||
HID_KEY_N = 17,
|
||||
HID_KEY_O = 18,
|
||||
HID_KEY_P = 19,
|
||||
HID_KEY_Q = 20,
|
||||
HID_KEY_R = 21,
|
||||
HID_KEY_S = 22,
|
||||
HID_KEY_T = 23,
|
||||
HID_KEY_U = 24,
|
||||
HID_KEY_V = 25,
|
||||
HID_KEY_W = 26,
|
||||
HID_KEY_X = 27,
|
||||
HID_KEY_Y = 28,
|
||||
HID_KEY_Z = 29,
|
||||
HID_KEY_1 = 30,
|
||||
HID_KEY_2 = 31,
|
||||
HID_KEY_3 = 32,
|
||||
HID_KEY_4 = 33,
|
||||
HID_KEY_5 = 34,
|
||||
HID_KEY_6 = 35,
|
||||
HID_KEY_7 = 36,
|
||||
HID_KEY_8 = 37,
|
||||
HID_KEY_9 = 38,
|
||||
HID_KEY_0 = 39,
|
||||
HID_KEY_ENTER = 40,
|
||||
HID_KEY_ESC = 41,
|
||||
HID_KEY_BACKSPACE = 42,
|
||||
HID_KEY_TAB = 43,
|
||||
HID_KEY_SPACE = 44,
|
||||
HID_KEY_MINUS = 45,
|
||||
HID_KEY_EQUAL = 46,
|
||||
HID_KEY_LEFTBRACE = 47,
|
||||
HID_KEY_RIGHTBRACE = 48,
|
||||
HID_KEY_BACKSLASH = 49,
|
||||
HID_KEY_HASH = 50, /* Non-US # and ~ */
|
||||
HID_KEY_SEMICOLON = 51,
|
||||
HID_KEY_APOSTROPHE = 52,
|
||||
HID_KEY_GRAVE = 53,
|
||||
HID_KEY_COMMA = 54,
|
||||
HID_KEY_DOT = 55,
|
||||
HID_KEY_SLASH = 56,
|
||||
HID_KEY_CAPSLOCK = 57,
|
||||
HID_KEY_F1 = 58,
|
||||
HID_KEY_F2 = 59,
|
||||
HID_KEY_F3 = 60,
|
||||
HID_KEY_F4 = 61,
|
||||
HID_KEY_F5 = 62,
|
||||
HID_KEY_F6 = 63,
|
||||
HID_KEY_F7 = 64,
|
||||
HID_KEY_F8 = 65,
|
||||
HID_KEY_F9 = 66,
|
||||
HID_KEY_F10 = 67,
|
||||
HID_KEY_F11 = 68,
|
||||
HID_KEY_F12 = 69,
|
||||
HID_KEY_SYSRQ = 70, /* PRINTSCREEN */
|
||||
HID_KEY_SCROLLLOCK = 71,
|
||||
HID_KEY_PAUSE = 72,
|
||||
HID_KEY_INSERT = 73,
|
||||
HID_KEY_HOME = 74,
|
||||
HID_KEY_PAGEUP = 75,
|
||||
HID_KEY_DELETE = 76,
|
||||
HID_KEY_END = 77,
|
||||
HID_KEY_PAGEDOWN = 78,
|
||||
HID_KEY_RIGHT = 79,
|
||||
HID_KEY_LEFT = 80,
|
||||
HID_KEY_DOWN = 81,
|
||||
HID_KEY_UP = 82,
|
||||
HID_KEY_NUMLOCK = 83,
|
||||
HID_KEY_KPSLASH = 84, /* NUMPAD DIVIDE */
|
||||
HID_KEY_KPASTERISK = 85, /* NUMPAD MULTIPLY */
|
||||
HID_KEY_KPMINUS = 86,
|
||||
HID_KEY_KPPLUS = 87,
|
||||
HID_KEY_KPENTER = 88,
|
||||
HID_KEY_KP_1 = 89,
|
||||
HID_KEY_KP_2 = 90,
|
||||
HID_KEY_KP_3 = 91,
|
||||
HID_KEY_KP_4 = 92,
|
||||
HID_KEY_KP_5 = 93,
|
||||
HID_KEY_KP_6 = 94,
|
||||
HID_KEY_KP_7 = 95,
|
||||
HID_KEY_KP_8 = 96,
|
||||
HID_KEY_KP_9 = 97,
|
||||
HID_KEY_KP_0 = 98,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief HID keyboard modifiers.
|
||||
*/
|
||||
enum hid_kbd_modifier {
|
||||
HID_KBD_MODIFIER_NONE = 0x00,
|
||||
HID_KBD_MODIFIER_LEFT_CTRL = 0x01,
|
||||
HID_KBD_MODIFIER_LEFT_SHIFT = 0x02,
|
||||
HID_KBD_MODIFIER_LEFT_ALT = 0x04,
|
||||
HID_KBD_MODIFIER_LEFT_UI = 0x08,
|
||||
HID_KBD_MODIFIER_RIGHT_CTRL = 0x10,
|
||||
HID_KBD_MODIFIER_RIGHT_SHIFT = 0x20,
|
||||
HID_KBD_MODIFIER_RIGHT_ALT = 0x40,
|
||||
HID_KBD_MODIFIER_RIGHT_UI = 0x80,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief HID keyboard LEDs.
|
||||
*/
|
||||
enum hid_kbd_led {
|
||||
HID_KBD_LED_NUM_LOCK = 0x01,
|
||||
HID_KBD_LED_CAPS_LOCK = 0x02,
|
||||
HID_KBD_LED_SCROLL_LOCK = 0x04,
|
||||
HID_KBD_LED_COMPOSE = 0x08,
|
||||
HID_KBD_LED_KANA = 0x10,
|
||||
};
|
||||
|
||||
#endif /* __HID_H_ */
|
||||
#endif /* USB_HID_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_hid.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_hid.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_hid.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_HID_H_
|
||||
#define _USBD_HID_H_
|
||||
#ifndef USBD_HID_H
|
||||
#define USBD_HID_H
|
||||
|
||||
#include "usb_hid.h"
|
||||
|
||||
@ -48,4 +31,4 @@ void usbh_hid_set_protocol(uint8_t intf, uint8_t protocol);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _USBD_HID_H_ */
|
||||
#endif /* USBD_HID_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_hid.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_hid.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_hid.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_HID_H
|
||||
#define _USBH_HID_H
|
||||
#ifndef USBH_HID_H
|
||||
#define USBH_HID_H
|
||||
|
||||
#include "usb_hid.h"
|
||||
|
||||
@ -45,4 +28,4 @@ int usbh_hid_get_idle(struct usbh_hid *hid_class, uint8_t *buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_HID_H */
|
||||
|
@ -1,11 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB HUB Device Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_HUB_H_
|
||||
#define _USB_HUB_H_
|
||||
#ifndef USB_HUB_H
|
||||
#define USB_HUB_H
|
||||
|
||||
/* HUB Class Descriptor Types */
|
||||
#define HUB_DESCRIPTOR_TYPE_HUB 0x29
|
||||
@ -117,4 +116,4 @@ struct hub_port_status {
|
||||
uint16_t wPortChange;
|
||||
};
|
||||
|
||||
#endif /* _USB_HUB_H_ */
|
||||
#endif /* USB_HUB_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_hub.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_hub.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_hub.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_HUB_H_
|
||||
#define _USBD_HUB_H_
|
||||
#ifndef USBD_HUB_H
|
||||
#define USBD_HUB_H
|
||||
|
||||
#include "usb_hub.h"
|
||||
|
||||
@ -35,4 +18,4 @@ void usbd_hub_add_interface(usbd_class_t *devclass, usbd_interface_t *intf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _USBD_HUB_H_ */
|
||||
#endif /* USBD_HUB_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_hub.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_hub.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_hub.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_HUB_H_
|
||||
#define _USBH_HUB_H_
|
||||
#ifndef USBH_HUB_H
|
||||
#define USBH_HUB_H
|
||||
|
||||
#include "usb_hub.h"
|
||||
|
||||
@ -39,4 +22,4 @@ int usbh_hub_initialize(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _USBH_HUB_H_ */
|
||||
#endif /* USBH_HUB_H */
|
||||
|
@ -1,11 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB MIDI Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_MIDI_H_
|
||||
#define _USB_MIDI_H_
|
||||
#ifndef USB_MIDI_H
|
||||
#define USB_MIDI_H
|
||||
|
||||
/* bDescriptorSubType */
|
||||
#define MIDI_VC_HEADER_DESCRIPTOR_SUBTYPE 0x01U
|
||||
@ -211,4 +210,4 @@ struct midi_cs_ep_ms_general_descriptor {
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif /* _USB_MIDI_H_ */
|
||||
#endif /* USB_MIDI_H */
|
||||
|
@ -1,16 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB Mass Storage Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* Header follows the Mass Storage Class Specification
|
||||
* (Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf) and
|
||||
* Mass Storage Class Bulk-Only Transport Specification
|
||||
* (usbmassbulk_10.pdf).
|
||||
* Header is limited to Bulk-Only Transfer protocol.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_MSC_H__
|
||||
#define _USB_MSC_H__
|
||||
#ifndef USB_MSC_H
|
||||
#define USB_MSC_H
|
||||
|
||||
/* MSC Subclass Codes */
|
||||
#define MSC_SUBCLASS_RBC 0x01 /* Reduced block commands (e.g., flash devices) */
|
||||
@ -118,4 +112,4 @@ struct CSW {
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
#endif /* USB_MSC_H_ */
|
||||
#endif /* USB_MSC_H */
|
||||
|
@ -1,23 +1,9 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/scsi.h
|
||||
/*
|
||||
* Apache NuttX
|
||||
* Copyright 2020 The Apache Software Foundation
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __INCLUDE_NUTTX_SCSI_H
|
||||
#define __INCLUDE_NUTTX_SCSI_H
|
||||
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_msc.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_msc.h"
|
||||
|
@ -1,16 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB Mass Storage Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* Header follows the Mass Storage Class Specification
|
||||
* (Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf) and
|
||||
* Mass Storage Class Bulk-Only Transport Specification
|
||||
* (usbmassbulk_10.pdf).
|
||||
* Header is limited to Bulk-Only Transfer protocol.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USBD_MSC_H__
|
||||
#define _USBD_MSC_H__
|
||||
#ifndef USBD_MSC_H
|
||||
#define USBD_MSC_H
|
||||
|
||||
#include "usb_msc.h"
|
||||
|
||||
@ -27,4 +21,4 @@ int usbd_msc_sector_write(uint32_t sector, uint8_t *buffer, uint32_t length);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* USBD_MSC_H_ */
|
||||
#endif /* USBD_MSC_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_msc.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_msc.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_msc.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_MSC_H
|
||||
#define _USBH_MSC_H
|
||||
#ifndef USBH_MSC_H
|
||||
#define USBH_MSC_H
|
||||
|
||||
#include "usb_msc.h"
|
||||
#include "usb_scsi.h"
|
||||
@ -49,4 +32,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_MSC_H */
|
||||
|
@ -1,5 +1,10 @@
|
||||
#ifndef _USB_MTP_H
|
||||
#define _USB_MTP_H
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef USB_MTP_H
|
||||
#define USB_MTP_H
|
||||
|
||||
#define USB_MTP_CLASS 0x06
|
||||
|
||||
@ -341,4 +346,4 @@
|
||||
#define MTP_PROP_GET 0x00U
|
||||
#define MTP_PROP_GET_SET 0x01U
|
||||
|
||||
#endif
|
||||
#endif /* USB_MTP_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_mtp.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_mtp.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_mtp.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_MTP_H
|
||||
#define _USBD_MTP_H
|
||||
#ifndef USBD_MTP_H
|
||||
#define USBD_MTP_H
|
||||
|
||||
#include "usb_mtp.h"
|
||||
|
||||
@ -33,4 +16,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBD_MTP_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_mtp.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_mtp.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_mtp.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_MTP_H
|
||||
#define _USBH_MTP_H
|
||||
#ifndef USBH_MTP_H
|
||||
#define USBH_MTP_H
|
||||
|
||||
#include "usb_mtp.h"
|
||||
|
||||
@ -44,4 +27,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_MTP_H */
|
||||
|
@ -1,5 +1,10 @@
|
||||
#ifndef _USB_PRINTER_H
|
||||
#define _USB_PRINTER_H
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef USB_PRINTER_H
|
||||
#define USB_PRINTER_H
|
||||
|
||||
#define PRINTER_SUBCLASS 0x01U
|
||||
|
||||
@ -11,4 +16,4 @@
|
||||
#define PRINTER_STATUS_SELECTED 0x08U
|
||||
#define PRINTER_STATUS_PAPER_EMPTY 0x10U
|
||||
|
||||
#endif
|
||||
#endif /* USB_PRINTER_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_printer.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_printer.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_printer.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_PRINTER_H
|
||||
#define _USBD_PRINTER_H
|
||||
#ifndef USBD_PRINTER_H
|
||||
#define USBD_PRINTER_H
|
||||
|
||||
#include "usb_printer.h"
|
||||
|
||||
@ -35,4 +18,4 @@ void usbd_printer_add_interface(usbd_class_t *devclass, usbd_interface_t *intf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBD_PRINTER_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_printer.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_printer.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_printer.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_PRINTER_H
|
||||
#define _USBH_PRINTER_H
|
||||
#ifndef USBH_PRINTER_H
|
||||
#define USBH_PRINTER_H
|
||||
|
||||
#include "usb_printer.h"
|
||||
|
||||
@ -41,4 +24,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_PRINTER_H */
|
||||
|
@ -1,11 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB TMC Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_TMC_H_
|
||||
#define _USB_TMC_H_
|
||||
#ifndef USB_TMC_H
|
||||
#define USB_TMC_H
|
||||
|
||||
/**@addtogroup MODULE_TMC USB TMC class
|
||||
* @brief This module contains USB Device Test and Measurement Class definitions.
|
||||
@ -127,4 +126,4 @@ struct usb_tmc_bulk_header {
|
||||
union usb_tmc_bulk_header_specific MsgSpecific;
|
||||
} __PACKED;
|
||||
|
||||
#endif /* _USB_TMC_H_ */
|
||||
#endif /* USB_TMC_H */
|
||||
|
31
class/vendor/axusbnet.c
vendored
31
class/vendor/axusbnet.c
vendored
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2022, aozima
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/*
|
||||
* Change Logs
|
||||
* Date Author Notes
|
||||
@ -181,7 +186,7 @@ static void packet_dump(const char * msg, const struct pbuf* p)
|
||||
}
|
||||
|
||||
rt_kprintf("%s %d byte. \n", msg, p->tot_len);
|
||||
#ifdef DUMP_RAW
|
||||
#ifdef DUMP_RAW
|
||||
const struct pbuf* q;
|
||||
rt_uint32_t i,j;
|
||||
rt_uint8_t *ptr;
|
||||
@ -317,8 +322,8 @@ ax8817x_mdio_write(struct usbnet *dev, int phy_id, int loc, int val)
|
||||
msleep(1);
|
||||
|
||||
ax8817x_read_cmd(dev, AX_CMD_READ_STATMNGSTS_REG, 0, 0, 1, &smsr);
|
||||
} while (!(smsr & AX_HOST_EN) && (i++ < 30));
|
||||
|
||||
} while (!(smsr & AX_HOST_EN) && (i++ < 30));
|
||||
|
||||
// *res = val;
|
||||
res = val;
|
||||
|
||||
@ -463,7 +468,7 @@ static int ax88772a_phy_powerup(struct usbnet *dev)
|
||||
static int ax88772b_reset(struct usbnet *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
ret = ax88772a_phy_powerup(dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@ -576,14 +581,14 @@ static rt_err_t rt_rndis_eth_control(rt_device_t dev, int cmd, void *args)
|
||||
case NIOCTL_GADDR:
|
||||
/* get mac address */
|
||||
if(args)
|
||||
{
|
||||
{
|
||||
USB_LOG_INFO("%s L%d NIOCTL_GADDR\r\n", __FUNCTION__, __LINE__);
|
||||
rt_memcpy(args, rndis_eth_dev->dev_addr, MAX_ADDR_LEN);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
return -RT_ERROR;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
@ -887,7 +892,7 @@ static void rt_thread_axusbnet_entry(void *parameter)
|
||||
if (tmp32 != (AX88772A_IPG2_DEFAULT << 16 |
|
||||
AX88772A_IPG1_DEFAULT << 8 | AX88772A_IPG0_DEFAULT)) {
|
||||
USB_LOG_ERR("Non-authentic ASIX product\nASIX does not support it\n");
|
||||
// ret = -ENODEV;
|
||||
// ret = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
}
|
||||
@ -987,7 +992,7 @@ static void rt_thread_axusbnet_entry(void *parameter)
|
||||
}
|
||||
if (!(bmcr & BMCR_SPEED100))
|
||||
{
|
||||
mode &= ~AX88772_MEDIUM_100MB;
|
||||
mode &= ~AX88772_MEDIUM_100MB;
|
||||
USB_LOG_ERR("%s L%d not AX88772_MEDIUM_100MB\r\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
|
||||
@ -1122,7 +1127,7 @@ static int usbh_axusbnet_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||
USB_LOG_INFO("%s %d\r\n", __FUNCTION__, __LINE__);
|
||||
|
||||
struct usbh_axusbnet *class = usb_malloc(sizeof(struct usbh_axusbnet));
|
||||
if (class == NULL)
|
||||
if (class == NULL)
|
||||
{
|
||||
USB_LOG_ERR("Fail to alloc class\r\n");
|
||||
return -ENOMEM;
|
||||
@ -1138,7 +1143,7 @@ static int usbh_axusbnet_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||
|
||||
#if 1
|
||||
USB_LOG_INFO("hport=%p, intf=%d, intf_desc.bNumEndpoints:%d\r\n", hport, intf, hport->config.intf[intf].intf_desc.bNumEndpoints);
|
||||
for (uint8_t i = 0; i < hport->config.intf[intf].intf_desc.bNumEndpoints; i++)
|
||||
for (uint8_t i = 0; i < hport->config.intf[intf].intf_desc.bNumEndpoints; i++)
|
||||
{
|
||||
ep_desc = &hport->config.intf[intf].ep[i].ep_desc;
|
||||
|
||||
@ -1148,7 +1153,7 @@ static int usbh_axusbnet_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint8_t i = 0; i < hport->config.intf[intf].intf_desc.bNumEndpoints; i++)
|
||||
for (uint8_t i = 0; i < hport->config.intf[intf].intf_desc.bNumEndpoints; i++)
|
||||
{
|
||||
ep_desc = &hport->config.intf[intf].ep[i].ep_desc;
|
||||
|
||||
|
5
class/vendor/axusbnet.h
vendored
5
class/vendor/axusbnet.h
vendored
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2022, aozima
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/*
|
||||
* Change Logs
|
||||
* Date Author Notes
|
||||
|
5
class/vendor/usbh_air724.c
vendored
5
class/vendor/usbh_air724.c
vendored
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
|
||||
#define DEV_FORMAT "/dev/air724"
|
||||
|
@ -1,13 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief USB Video Class public header
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* Header follows below documentation:
|
||||
* - USB Device Class Definition for Video Devices UVC 1.5 Class specification.pdf
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _USB_VIDEO_H_
|
||||
#define _USB_VIDEO_H_
|
||||
#ifndef USB_VIDEO_H
|
||||
#define USB_VIDEO_H
|
||||
|
||||
#define USB_DEVICE_VIDEO_CLASS_VERSION_1_5 0
|
||||
|
||||
@ -1198,4 +1195,4 @@ struct video_autoexposure_mode {
|
||||
bFrameIntervalType, /* bFrameIntervalType : Indicates how the frame interval can be programmed. 0: Continuous frame interval 1..255: The number of discrete frame */ \
|
||||
__VA_ARGS__
|
||||
// clang-format on
|
||||
#endif /* USB_VIDEO_H_ */
|
||||
#endif /*USB_VIDEO_H */
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_video.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_video.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_video.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_VIDEO_H_
|
||||
#define _USBD_VIDEO_H_
|
||||
#ifndef USBD_VIDEO_H
|
||||
#define USBD_VIDEO_H
|
||||
|
||||
#include "usb_video.h"
|
||||
|
||||
@ -42,4 +25,4 @@ void usbd_video_sof_callback(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* USBD_VIDEO_H_ */
|
||||
#endif /* USBD_VIDEO_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbd_rndis.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_rndis.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbd_rndis.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_RNDIS_H_
|
||||
#define _USBD_RNDIS_H_
|
||||
#ifndef USBD_RNDIS_H
|
||||
#define USBD_RNDIS_H
|
||||
|
||||
#include "usb_cdc.h"
|
||||
|
||||
@ -46,4 +29,4 @@ void usbd_rndis_add_interface(usbd_class_t *devclass, usbd_interface_t *intf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBD_RNDIS_H */
|
||||
|
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
#include "usbh_rndis.h"
|
||||
#include "rndis_protocol.h"
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usbh_rndis.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_RNDIS_H
|
||||
#define _USBH_RNDIS_H
|
||||
#ifndef USBH_RNDIS_H
|
||||
#define USBH_RNDIS_H
|
||||
|
||||
#include "usb_cdc.h"
|
||||
|
||||
@ -49,4 +32,4 @@ int usbh_rndis_keepalive(struct usbh_rndis *rndis_class);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_RNDIS_H */
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usb_dc.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USB_DC_H
|
||||
#define _USB_DC_H
|
||||
#ifndef USB_DC_H
|
||||
#define USB_DC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -182,4 +165,4 @@ void usbd_event_ep_out_complete_handler(uint8_t ep, uint32_t nbytes);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USB_DC_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usb_def.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef USB_DEF_H
|
||||
#define USB_DEF_H
|
||||
@ -702,4 +685,4 @@ struct usb_desc_header {
|
||||
WBVAL(id) /* wLangID0 */
|
||||
// clang-format on
|
||||
|
||||
#endif
|
||||
#endif /* USB_DEF_H */
|
||||
|
@ -1,23 +1,9 @@
|
||||
/****************************************************************************
|
||||
* include/errno.h
|
||||
/*
|
||||
* Apache NuttX
|
||||
* Copyright 2020 The Apache Software Foundation
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __INCLUDE_ERRNO_H
|
||||
#define __INCLUDE_ERRNO_H
|
||||
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usb_hc.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USB_HC_H
|
||||
#define _USB_HC_H
|
||||
#ifndef USB_HC_H
|
||||
#define USB_HC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -220,4 +203,4 @@ void usbh_event_notify_handler(uint8_t event, uint8_t rhport);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USB_HC_H */
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usb_list.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __USB_LIST_H__
|
||||
#define __USB_LIST_H__
|
||||
#ifndef USB_LIST_H
|
||||
#define USB_LIST_H
|
||||
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
@ -470,4 +453,4 @@ static inline unsigned int usb_dlist_len(const usb_dlist_t *l)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USB_LIST_H */
|
||||
|
@ -1,5 +1,10 @@
|
||||
#ifndef _USB_LOG_H
|
||||
#define _USB_LOG_H
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef USB_LOG_H
|
||||
#define USB_LOG_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@ -84,4 +89,4 @@ void usb_assert(const char *filename, int linenum);
|
||||
usb_assert(__FILE__, __LINE__); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
#endif /* USB_LOG_H */
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usb_mem.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USB_MEM_H
|
||||
#define _USB_MEM_H
|
||||
#ifndef USB_MEM_H
|
||||
#define USB_MEM_H
|
||||
|
||||
#define usb_malloc(size) malloc(size)
|
||||
#define usb_free(ptr) free(ptr)
|
||||
@ -94,4 +77,4 @@ void usb_dcache_clean_invalidate(uintptr_t addr, uint32_t len);
|
||||
#define usb_dcache_clean_invalidate(addr, len)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USB_MEM_H */
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usb_util.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USB_UTIL_H
|
||||
#define _USB_UTIL_H
|
||||
#ifndef USB_UTIL_H
|
||||
#define USB_UTIL_H
|
||||
|
||||
#if defined(__CC_ARM)
|
||||
#ifndef __USED
|
||||
@ -220,4 +203,4 @@
|
||||
19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \
|
||||
9, 8, 7, 6, 5, 4, 3, 2, 1, 0
|
||||
|
||||
#endif
|
||||
#endif /* USB_UTIL_H */
|
||||
|
@ -1,24 +1,9 @@
|
||||
/**
|
||||
* @file usbd_core.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (C) 2006 Bertrik Sikken (bertrik@sikken.nl)
|
||||
* Copyright (c) 2016 Intel Corporation
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbd_core.h"
|
||||
|
||||
|
@ -1,26 +1,10 @@
|
||||
/**
|
||||
* @file usbd_core.h
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBD_CORE_H
|
||||
#define _USBD_CORE_H
|
||||
#ifndef USBD_CORE_H
|
||||
#define USBD_CORE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -41,44 +25,18 @@ extern "C" {
|
||||
#include "usb_dc.h"
|
||||
|
||||
enum usbd_event_type {
|
||||
/** USB error reported by the controller */
|
||||
USBD_EVENT_ERROR,
|
||||
/** USB reset */
|
||||
USBD_EVENT_RESET,
|
||||
/** Start of Frame received */
|
||||
USBD_EVENT_SOF,
|
||||
/** USB connection established, hardware enumeration is completed */
|
||||
USBD_EVENT_CONNECTED,
|
||||
/** USB configuration done */
|
||||
USBD_EVENT_CONFIGURED,
|
||||
/** USB connection suspended by the HOST */
|
||||
USBD_EVENT_SUSPEND,
|
||||
/** USB connection lost */
|
||||
USBD_EVENT_DISCONNECTED,
|
||||
/** USB connection resumed by the HOST */
|
||||
USBD_EVENT_RESUME,
|
||||
/* USB DCD IRQ */
|
||||
USBD_EVENT_ERROR, /** USB error reported by the controller */
|
||||
USBD_EVENT_RESET, /** USB reset */
|
||||
USBD_EVENT_SOF, /** Start of Frame received */
|
||||
USBD_EVENT_CONNECTED, /** USB connected*/
|
||||
USBD_EVENT_DISCONNECTED, /** USB disconnected */
|
||||
USBD_EVENT_SUSPEND, /** USB connection suspended by the HOST */
|
||||
USBD_EVENT_RESUME, /** USB connection resumed by the HOST */
|
||||
|
||||
/** USB interface selected */
|
||||
USBD_EVENT_SET_INTERFACE,
|
||||
/** USB interface selected */
|
||||
USBD_EVENT_SET_REMOTE_WAKEUP,
|
||||
/** USB interface selected */
|
||||
USBD_EVENT_CLEAR_REMOTE_WAKEUP,
|
||||
/** Set Feature ENDPOINT_HALT received */
|
||||
USBD_EVENT_SET_HALT,
|
||||
/** Clear Feature ENDPOINT_HALT received */
|
||||
USBD_EVENT_CLEAR_HALT,
|
||||
/** setup packet received */
|
||||
USBD_EVENT_SETUP_NOTIFY,
|
||||
/** ep0 in packet received */
|
||||
USBD_EVENT_EP0_IN_NOTIFY,
|
||||
/** ep0 out packet received */
|
||||
USBD_EVENT_EP0_OUT_NOTIFY,
|
||||
/** ep in packet except ep0 received */
|
||||
USBD_EVENT_EP_IN_NOTIFY,
|
||||
/** ep out packet except ep0 received */
|
||||
USBD_EVENT_EP_OUT_NOTIFY,
|
||||
/** Initial USB connection status */
|
||||
/* USB DEVICE STATUS */
|
||||
USBD_EVENT_CONFIGURED, /** USB configuration done */
|
||||
USBD_EVENT_SET_INTERFACE, /** USB interface selected */
|
||||
USBD_EVENT_UNKNOWN
|
||||
};
|
||||
|
||||
@ -127,4 +85,4 @@ int usbd_initialize(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBD_CORE_H */
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usbh_core.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usbh_core.h"
|
||||
|
||||
|
@ -1,26 +1,10 @@
|
||||
/**
|
||||
* @file usbh_core.h
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USBH_CORE_H
|
||||
#define _USBH_CORE_H
|
||||
#ifndef USBH_CORE_H
|
||||
#define USBH_CORE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
@ -141,4 +125,4 @@ void usbh_device_unmount_done_callback(struct usbh_hubport *hport);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* USBH_CORE_H */
|
||||
|
@ -1,27 +1,10 @@
|
||||
/**
|
||||
* @file usb_osal.h
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _USB_OSAL_H
|
||||
#define _USB_OSAL_H
|
||||
#ifndef USB_OSAL_H
|
||||
#define USB_OSAL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@ -57,5 +40,5 @@ void usb_osal_leave_critical_section(size_t flag);
|
||||
|
||||
void usb_osal_msleep(uint32_t delay);
|
||||
|
||||
#endif
|
||||
#endif /* USB_OSAL_H */
|
||||
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usb_osal_freertos.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usb_osal.h"
|
||||
#include "usb_errno.h"
|
||||
|
@ -1,24 +1,7 @@
|
||||
/**
|
||||
* @file usb_osal_rtthread.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "usb_osal.h"
|
||||
#include "usb_errno.h"
|
||||
|
@ -1,25 +1,3 @@
|
||||
/**
|
||||
* @file usb_osal_rtx.c
|
||||
* @brief
|
||||
*
|
||||
* Copyright (c) 2022 sakumisu
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
#include "usb_osal.h"
|
||||
#include "usb_errno.h"
|
||||
#include "stdlib.h"
|
||||
@ -40,7 +18,7 @@ usb_osal_thread_t usb_osal_thread_create(const char *name, uint32_t stack_size,
|
||||
void *stk = malloc(stack_size);
|
||||
_init_box8(sem_mpool, sizeof(sem_mpool), sizeof(OS_SEM));
|
||||
_init_box8(mut_mpool, sizeof(mut_mpool), sizeof(OS_MUT));
|
||||
|
||||
|
||||
return (usb_osal_thread_t)os_tsk_create_user_ex (entry, prio,
|
||||
stk, stack_size,
|
||||
args);
|
||||
@ -140,7 +118,7 @@ int usb_osal_event_send(usb_osal_event_t event, uint32_t set)
|
||||
} else {
|
||||
isr_evt_set(set, (OS_TID)event);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -164,9 +142,9 @@ void usb_osal_msleep(uint32_t delay)
|
||||
|
||||
__asm uint32_t __builtin_ctz(uint32_t val)
|
||||
{
|
||||
rsb r3, r0, #0
|
||||
and r0, r3, r0
|
||||
clz r0, r0
|
||||
rsb r3, r0, #0
|
||||
and r0, r3, r0
|
||||
clz r0, r0
|
||||
rsb r0, r0, #31
|
||||
bx lr
|
||||
}
|
||||
|
@ -1,23 +1,9 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/usb/ehci.h
|
||||
/*
|
||||
* Apache NuttX
|
||||
* Copyright 2020 The Apache Software Foundation
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __INCLUDE_NUTTX_USB_EHCI_H
|
||||
#define __INCLUDE_NUTTX_USB_EHCI_H
|
||||
|
||||
|
@ -1,23 +1,9 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/usb/ohci.h
|
||||
/*
|
||||
* Apache NuttX
|
||||
* Copyright 2020 The Apache Software Foundation
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __INCLUDE_NUTTX_USB_OHCI_H
|
||||
#define __INCLUDE_NUTTX_USB_OHCI_H
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
#ifndef _USB_CONFIG_H
|
||||
#define _USB_CONFIG_H
|
||||
/*
|
||||
* Copyright (c) 2022, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef CHERRYUSB_CONFIG_H
|
||||
#define CHERRYUSB_CONFIG_H
|
||||
|
||||
/* USB common Configuration */
|
||||
#ifndef CONFIG_USB_DBG_LEVEL
|
||||
|
Loading…
x
Reference in New Issue
Block a user