diff --git a/class/audio/usb_audio.h b/class/audio/usb_audio.h index 3acf581..e9d4ff4 100644 --- a/class/audio/usb_audio.h +++ b/class/audio/usb_audio.h @@ -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 */ diff --git a/class/audio/usbd_audio.c b/class/audio/usbd_audio.c index 28185c5..4916431 100644 --- a/class/audio/usbd_audio.c +++ b/class/audio/usbd_audio.c @@ -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" diff --git a/class/audio/usbd_audio.h b/class/audio/usbd_audio.h index 2735db2..6995dae 100644 --- a/class/audio/usbd_audio.h +++ b/class/audio/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 */ diff --git a/class/cdc/usb_cdc.h b/class/cdc/usb_cdc.h index 92be79d..1dbca76 100644 --- a/class/cdc/usb_cdc.h +++ b/class/cdc/usb_cdc.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 */ diff --git a/class/cdc/usbd_cdc.c b/class/cdc/usbd_cdc.c index b540a49..a9c5f67 100644 --- a/class/cdc/usbd_cdc.c +++ b/class/cdc/usbd_cdc.c @@ -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" diff --git a/class/cdc/usbd_cdc.h b/class/cdc/usbd_cdc.h index 4ad6869..574336b 100644 --- a/class/cdc/usbd_cdc.h +++ b/class/cdc/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 */ diff --git a/class/cdc/usbh_cdc_acm.c b/class/cdc/usbh_cdc_acm.c index 5acd50d..fe20e2e 100644 --- a/class/cdc/usbh_cdc_acm.c +++ b/class/cdc/usbh_cdc_acm.c @@ -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" diff --git a/class/cdc/usbh_cdc_acm.h b/class/cdc/usbh_cdc_acm.h index fba1dfe..720ff50 100644 --- a/class/cdc/usbh_cdc_acm.h +++ b/class/cdc/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 */ diff --git a/class/dfu/usb_dfu.h b/class/dfu/usb_dfu.h index 937c2d5..b5ae2ab 100644 --- a/class/dfu/usb_dfu.h +++ b/class/dfu/usb_dfu.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 */ diff --git a/class/dfu/usbd_dfu.c b/class/dfu/usbd_dfu.c index b5375d2..626cc26 100644 --- a/class/dfu/usbd_dfu.c +++ b/class/dfu/usbd_dfu.c @@ -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" diff --git a/class/dfu/usbd_dfu.h b/class/dfu/usbd_dfu.h index 7590582..8850c96 100644 --- a/class/dfu/usbd_dfu.h +++ b/class/dfu/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 */ diff --git a/class/hid/usb_hid.h b/class/hid/usb_hid.h index 113b3e1..9a36676 100644 --- a/class/hid/usb_hid.h +++ b/class/hid/usb_hid.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 */ diff --git a/class/hid/usbd_hid.c b/class/hid/usbd_hid.c index a7e2f83..871d749 100644 --- a/class/hid/usbd_hid.c +++ b/class/hid/usbd_hid.c @@ -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" diff --git a/class/hid/usbd_hid.h b/class/hid/usbd_hid.h index aa30d75..5b8ef1a 100644 --- a/class/hid/usbd_hid.h +++ b/class/hid/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 */ diff --git a/class/hid/usbh_hid.c b/class/hid/usbh_hid.c index e608248..f8c5549 100644 --- a/class/hid/usbh_hid.c +++ b/class/hid/usbh_hid.c @@ -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" diff --git a/class/hid/usbh_hid.h b/class/hid/usbh_hid.h index 4cea947..9227c51 100644 --- a/class/hid/usbh_hid.h +++ b/class/hid/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 */ diff --git a/class/hub/usb_hub.h b/class/hub/usb_hub.h index 1beb6f2..022ca2a 100644 --- a/class/hub/usb_hub.h +++ b/class/hub/usb_hub.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 */ diff --git a/class/hub/usbd_hub.c b/class/hub/usbd_hub.c index 91457e9..d22a4d0 100644 --- a/class/hub/usbd_hub.c +++ b/class/hub/usbd_hub.c @@ -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" diff --git a/class/hub/usbd_hub.h b/class/hub/usbd_hub.h index d505c28..02ce022 100644 --- a/class/hub/usbd_hub.h +++ b/class/hub/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 */ diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c index 1a2d41c..998cbee 100644 --- a/class/hub/usbh_hub.c +++ b/class/hub/usbh_hub.c @@ -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" diff --git a/class/hub/usbh_hub.h b/class/hub/usbh_hub.h index fd4d04f..96763e3 100644 --- a/class/hub/usbh_hub.h +++ b/class/hub/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 */ diff --git a/class/midi/usb_midi.h b/class/midi/usb_midi.h index 52ae989..01f4035 100644 --- a/class/midi/usb_midi.h +++ b/class/midi/usb_midi.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 */ diff --git a/class/msc/usb_msc.h b/class/msc/usb_msc.h index d7b353e..1e7634a 100644 --- a/class/msc/usb_msc.h +++ b/class/msc/usb_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 _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 */ diff --git a/class/msc/usb_scsi.h b/class/msc/usb_scsi.h index 86811c3..7eeb50a 100644 --- a/class/msc/usb_scsi.h +++ b/class/msc/usb_scsi.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 diff --git a/class/msc/usbd_msc.c b/class/msc/usbd_msc.c index a2da817..82aae07 100644 --- a/class/msc/usbd_msc.c +++ b/class/msc/usbd_msc.c @@ -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" diff --git a/class/msc/usbd_msc.h b/class/msc/usbd_msc.h index ba17e61..0e286c2 100644 --- a/class/msc/usbd_msc.h +++ b/class/msc/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 */ diff --git a/class/msc/usbh_msc.c b/class/msc/usbh_msc.c index 5db7a5a..263ab73 100644 --- a/class/msc/usbh_msc.c +++ b/class/msc/usbh_msc.c @@ -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" diff --git a/class/msc/usbh_msc.h b/class/msc/usbh_msc.h index 066ddf3..34b15cc 100644 --- a/class/msc/usbh_msc.h +++ b/class/msc/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 */ diff --git a/class/mtp/usb_mtp.h b/class/mtp/usb_mtp.h index fbfd116..a3b6878 100644 --- a/class/mtp/usb_mtp.h +++ b/class/mtp/usb_mtp.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 \ No newline at end of file +#endif /* USB_MTP_H */ diff --git a/class/mtp/usbd_mtp.c b/class/mtp/usbd_mtp.c index 8a066a9..717a6b0 100644 --- a/class/mtp/usbd_mtp.c +++ b/class/mtp/usbd_mtp.c @@ -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" diff --git a/class/mtp/usbd_mtp.h b/class/mtp/usbd_mtp.h index ffff121..7162141 100644 --- a/class/mtp/usbd_mtp.h +++ b/class/mtp/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 \ No newline at end of file +#endif /* USBD_MTP_H */ diff --git a/class/mtp/usbh_mtp.c b/class/mtp/usbh_mtp.c index 7257812..ca97c8d 100644 --- a/class/mtp/usbh_mtp.c +++ b/class/mtp/usbh_mtp.c @@ -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" diff --git a/class/mtp/usbh_mtp.h b/class/mtp/usbh_mtp.h index 9946718..9a383fd 100644 --- a/class/mtp/usbh_mtp.h +++ b/class/mtp/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 \ No newline at end of file +#endif /* USBH_MTP_H */ diff --git a/class/printer/usb_printer.h b/class/printer/usb_printer.h index 8471d76..c8105c9 100644 --- a/class/printer/usb_printer.h +++ b/class/printer/usb_printer.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 \ No newline at end of file +#endif /* USB_PRINTER_H */ diff --git a/class/printer/usbd_printer.c b/class/printer/usbd_printer.c index c49b801..689869e 100644 --- a/class/printer/usbd_printer.c +++ b/class/printer/usbd_printer.c @@ -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" diff --git a/class/printer/usbd_printer.h b/class/printer/usbd_printer.h index c243609..933b7d9 100644 --- a/class/printer/usbd_printer.h +++ b/class/printer/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 \ No newline at end of file +#endif /* USBD_PRINTER_H */ diff --git a/class/printer/usbh_printer.c b/class/printer/usbh_printer.c index 87f783a..bff05ff 100644 --- a/class/printer/usbh_printer.c +++ b/class/printer/usbh_printer.c @@ -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" diff --git a/class/printer/usbh_printer.h b/class/printer/usbh_printer.h index 4c41bfb..811de6a 100644 --- a/class/printer/usbh_printer.h +++ b/class/printer/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 \ No newline at end of file +#endif /* USBH_PRINTER_H */ diff --git a/class/tmc/usb_tmc.h b/class/tmc/usb_tmc.h index eb622b4..84d70fa 100644 --- a/class/tmc/usb_tmc.h +++ b/class/tmc/usb_tmc.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 */ diff --git a/class/vendor/axusbnet.c b/class/vendor/axusbnet.c index 7cd3085..8b1b711 100644 --- a/class/vendor/axusbnet.c +++ b/class/vendor/axusbnet.c @@ -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; diff --git a/class/vendor/axusbnet.h b/class/vendor/axusbnet.h index 7f00d77..b57e502 100644 --- a/class/vendor/axusbnet.h +++ b/class/vendor/axusbnet.h @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2022, aozima + * + * SPDX-License-Identifier: Apache-2.0 + */ /* * Change Logs * Date Author Notes diff --git a/class/vendor/usbh_air724.c b/class/vendor/usbh_air724.c index cdf84b1..8eebd9a 100644 --- a/class/vendor/usbh_air724.c +++ b/class/vendor/usbh_air724.c @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2022, sakumisu + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "usbh_core.h" #define DEV_FORMAT "/dev/air724" diff --git a/class/video/usb_video.h b/class/video/usb_video.h index 0fc91e3..bb81190 100644 --- a/class/video/usb_video.h +++ b/class/video/usb_video.h @@ -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 */ \ No newline at end of file diff --git a/class/video/usbd_video.c b/class/video/usbd_video.c index f1813ea..102e75f 100644 --- a/class/video/usbd_video.c +++ b/class/video/usbd_video.c @@ -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" diff --git a/class/video/usbd_video.h b/class/video/usbd_video.h index b0615cb..ad359b9 100644 --- a/class/video/usbd_video.h +++ b/class/video/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 */ diff --git a/class/wireless/usbd_rndis.c b/class/wireless/usbd_rndis.c index 5c5b31e..ad10c44 100644 --- a/class/wireless/usbd_rndis.c +++ b/class/wireless/usbd_rndis.c @@ -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" diff --git a/class/wireless/usbd_rndis.h b/class/wireless/usbd_rndis.h index e6bd60b..905329e 100644 --- a/class/wireless/usbd_rndis.h +++ b/class/wireless/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 */ diff --git a/class/wireless/usbh_rndis.c b/class/wireless/usbh_rndis.c index 653a5e4..43bc876 100644 --- a/class/wireless/usbh_rndis.c +++ b/class/wireless/usbh_rndis.c @@ -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" diff --git a/class/wireless/usbh_rndis.h b/class/wireless/usbh_rndis.h index 3e20611..9121727 100644 --- a/class/wireless/usbh_rndis.h +++ b/class/wireless/usbh_rndis.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 */ diff --git a/common/usb_dc.h b/common/usb_dc.h index 4caf870..b11f8a6 100644 --- a/common/usb_dc.h +++ b/common/usb_dc.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 @@ -182,4 +165,4 @@ void usbd_event_ep_out_complete_handler(uint8_t ep, uint32_t nbytes); } #endif -#endif +#endif /* USB_DC_H */ diff --git a/common/usb_def.h b/common/usb_def.h index c404273..9e3fc41 100644 --- a/common/usb_def.h +++ b/common/usb_def.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 */ diff --git a/common/usb_errno.h b/common/usb_errno.h index 7ccadb6..aef08e5 100644 --- a/common/usb_errno.h +++ b/common/usb_errno.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 diff --git a/common/usb_hc.h b/common/usb_hc.h index 5896387..7d464ec 100644 --- a/common/usb_hc.h +++ b/common/usb_hc.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 @@ -220,4 +203,4 @@ void usbh_event_notify_handler(uint8_t event, uint8_t rhport); } #endif -#endif +#endif /* USB_HC_H */ diff --git a/common/usb_list.h b/common/usb_list.h index 55111fd..228dc6f 100644 --- a/common/usb_list.h +++ b/common/usb_list.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 #include @@ -470,4 +453,4 @@ static inline unsigned int usb_dlist_len(const usb_dlist_t *l) } #endif -#endif +#endif /* USB_LIST_H */ diff --git a/common/usb_log.h b/common/usb_log.h index 1471caa..45ad9e1 100644 --- a/common/usb_log.h +++ b/common/usb_log.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 @@ -84,4 +89,4 @@ void usb_assert(const char *filename, int linenum); usb_assert(__FILE__, __LINE__); \ } while (0) -#endif +#endif /* USB_LOG_H */ diff --git a/common/usb_mem.h b/common/usb_mem.h index 928690c..5a39e5d 100644 --- a/common/usb_mem.h +++ b/common/usb_mem.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 */ diff --git a/common/usb_util.h b/common/usb_util.h index cef8915..790dfe5 100644 --- a/common/usb_util.h +++ b/common/usb_util.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 */ diff --git a/core/usbd_core.c b/core/usbd_core.c index 418f2ad..7b8b4fb 100644 --- a/core/usbd_core.c +++ b/core/usbd_core.c @@ -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" diff --git a/core/usbd_core.h b/core/usbd_core.h index aecb59b..0e48531 100644 --- a/core/usbd_core.h +++ b/core/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 */ diff --git a/core/usbh_core.c b/core/usbh_core.c index 719cc1d..d81e559 100644 --- a/core/usbh_core.c +++ b/core/usbh_core.c @@ -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" diff --git a/core/usbh_core.h b/core/usbh_core.h index 910aa41..86cf0e4 100644 --- a/core/usbh_core.h +++ b/core/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 #include @@ -141,4 +125,4 @@ void usbh_device_unmount_done_callback(struct usbh_hubport *hport); } #endif -#endif +#endif /* USBH_CORE_H */ diff --git a/osal/usb_osal.h b/osal/usb_osal.h index beaafe9..d127950 100644 --- a/osal/usb_osal.h +++ b/osal/usb_osal.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 #include @@ -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 */ diff --git a/osal/usb_osal_freertos.c b/osal/usb_osal_freertos.c index 8af7406..66f6663 100644 --- a/osal/usb_osal_freertos.c +++ b/osal/usb_osal_freertos.c @@ -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" diff --git a/osal/usb_osal_rtthread.c b/osal/usb_osal_rtthread.c index 43155e6..264cece 100644 --- a/osal/usb_osal_rtthread.c +++ b/osal/usb_osal_rtthread.c @@ -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" diff --git a/osal/usb_osal_rtx.c b/osal/usb_osal_rtx.c index fa0191c..a395563 100644 --- a/osal/usb_osal_rtx.c +++ b/osal/usb_osal_rtx.c @@ -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 } diff --git a/port/ehci/usb_hc_ehci.h b/port/ehci/usb_hc_ehci.h index c2c37b9..005cd8a 100644 --- a/port/ehci/usb_hc_ehci.h +++ b/port/ehci/usb_hc_ehci.h @@ -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 diff --git a/port/ohci/usb_ohci.h b/port/ohci/usb_ohci.h index aa619e6..170e8df 100644 --- a/port/ohci/usb_ohci.h +++ b/port/ohci/usb_ohci.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 diff --git a/usb_config.h b/usb_config.h index 76ab984..074ba31 100644 --- a/usb_config.h +++ b/usb_config.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