11/***************************************************************************
2- * Copyright (c) 2024 Microsoft Corporation
3- *
2+ * Copyright (c) 2024 Microsoft Corporation
3+ *
44 * This program and the accompanying materials are made available under the
55 * terms of the MIT License which is available at
66 * https://opensource.org/licenses/MIT.
7- *
7+ *
88 * SPDX-License-Identifier: MIT
99 **************************************************************************/
1010
1111/**************************************************************************/
1212/**************************************************************************/
13- /** */
14- /** USBX Component */
13+ /** */
14+ /** USBX Component */
1515/** */
1616/** DFU Class */
1717/** */
1818/**************************************************************************/
1919/**************************************************************************/
2020
21- /**************************************************************************/
22- /* */
23- /* COMPONENT DEFINITION RELEASE */
24- /* */
25- /* ux_device_class_dfu.h PORTABLE C */
26- /* 6.3.0 */
21+ /**************************************************************************/
22+ /* */
23+ /* COMPONENT DEFINITION RELEASE */
24+ /* */
25+ /* ux_device_class_dfu.h PORTABLE C */
26+ /* 6.x */
2727/* AUTHOR */
2828/* */
2929/* Chaoqiong Xiao, Microsoft Corporation */
3030/* */
3131/* DESCRIPTION */
32- /* */
33- /* This file defines the equivalences for the USBX Device Class DFU */
34- /* ACM component. */
35- /* */
36- /* RELEASE HISTORY */
37- /* */
38- /* DATE NAME DESCRIPTION */
39- /* */
32+ /* */
33+ /* This file defines the equivalences for the USBX Device Class DFU */
34+ /* ACM component. */
35+ /* */
36+ /* RELEASE HISTORY */
37+ /* */
38+ /* DATE NAME DESCRIPTION */
39+ /* */
4040/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
4141/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
4242/* used UX prefix to refer to */
6262/* 10-31-2023 Yajun xia Modified comment(s), */
6363/* added error checks support, */
6464/* resulting in version 6.3.0 */
65+ /* xx-xx-xxxx Mohamed ayed Modified comment(s), */
66+ /* added dfu deinit function, */
67+ /* remove extra spaces, */
68+ /* resulting in version 6.x */
6569/* */
6670/**************************************************************************/
6771
6872#ifndef UX_DEVICE_CLASS_DFU_H
6973#define UX_DEVICE_CLASS_DFU_H
7074
71- /* Determine if a C++ compiler is being used. If so, ensure that standard
72- C is used to process the API information. */
75+ /* Determine if a C++ compiler is being used. If so, ensure that standard
76+ C is used to process the API information. */
7377
74- #ifdef __cplusplus
78+ #ifdef __cplusplus
7579
76- /* Yes, C++ compiler is present. Use standard C. */
77- extern "C" {
80+ /* Yes, C++ compiler is present. Use standard C. */
81+ extern "C" {
7882
79- #endif
83+ #endif
8084
8185/* Internal option: enable the basic USBX error checking. This define is typically used
8286 while debugging application. */
8387#if defined(UX_ENABLE_ERROR_CHECKING ) && !defined(UX_DEVICE_CLASS_DFU_ENABLE_ERROR_CHECKING )
8488#define UX_DEVICE_CLASS_DFU_ENABLE_ERROR_CHECKING
8589#endif
8690
87- /* Define DFU class descriptor capabilities. */
91+ /* Define DFU class descriptor capabilities. */
8892#define UX_SLAVE_CLASS_DFU_CAPABILITY_WILL_DETACH 0x08
8993#define UX_SLAVE_CLASS_DFU_CAPABILITY_MANIFESTATION_TOLERANT 0x04
9094#define UX_SLAVE_CLASS_DFU_CAPABILITY_CAN_UPLOAD 0x02
@@ -187,7 +191,7 @@ extern "C" {
187191/* Define DFU application notification signals. */
188192#define UX_SLAVE_CLASS_DFU_MEDIA_STATUS_OK 0
189193#define UX_SLAVE_CLASS_DFU_MEDIA_STATUS_BUSY 1
190- #define UX_SLAVE_CLASS_DFU_MEDIA_STATUS_ERROR 2
194+ #define UX_SLAVE_CLASS_DFU_MEDIA_STATUS_ERROR 2
191195
192196/* Define DFU thread event signals. */
193197#define UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT 0x1u
@@ -257,6 +261,7 @@ UINT _ux_device_class_dfu_deactivate(UX_SLAVE_CLASS_COMMAND *command);
257261UINT _ux_device_class_dfu_entry (UX_SLAVE_CLASS_COMMAND * command );
258262UINT _ux_device_class_dfu_initialize (UX_SLAVE_CLASS_COMMAND * command );
259263VOID _ux_device_class_dfu_thread (ULONG dfu_class );
264+ UINT _ux_device_class_dfu_uninitialize (UX_SLAVE_CLASS_COMMAND * command );
260265
261266UCHAR _ux_device_class_dfu_state_get (UX_SLAVE_CLASS_DFU * dfu );
262267VOID _ux_device_class_dfu_state_sync (UX_SLAVE_CLASS_DFU * dfu );
@@ -270,10 +275,10 @@ UINT _uxe_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command);
270275#define ux_device_class_dfu_state_get _ux_device_class_dfu_state_get
271276#define ux_device_class_dfu_state_sync _ux_device_class_dfu_state_sync
272277
273- /* Determine if a C++ compiler is being used. If so, complete the standard
274- C conditional started above. */
278+ /* Determine if a C++ compiler is being used. If so, complete the standard
279+ C conditional started above. */
275280#ifdef __cplusplus
276- }
277- #endif
281+ }
282+ #endif
278283
279284#endif /* UX_DEVICE_CLASS_DFU_H */
0 commit comments