Zephyr Project API
4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
usb_dfu.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause */
2
3
/***************************************************************************
4
*
5
* Copyright(c) 2015,2016 Intel Corporation.
6
* Copyright(c) 2017 PHYTEC Messtechnik GmbH
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
10
* are met:
11
*
12
* * Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above copyright
15
* notice, this list of conditions and the following disclaimer in
16
* the documentation and/or other materials provided with the
17
* distribution.
18
* * Neither the name of Intel Corporation nor the names of its
19
* contributors may be used to endorse or promote products derived
20
* from this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
*
34
***************************************************************************/
35
46
#ifndef ZEPHYR_INCLUDE_USB_CLASS_USB_DFU_H_
47
#define ZEPHYR_INCLUDE_USB_CLASS_USB_DFU_H_
48
49
#include <
zephyr/sys_clock.h
>
50
52
#define DFU_SUBCLASS 0x01 __DEPRECATED_MACRO
53
55
#define DFU_RT_PROTOCOL 0x01 __DEPRECATED_MACRO
56
58
#define DFU_MODE_PROTOCOL 0x02 __DEPRECATED_MACRO
59
63
#define DFU_DETACH 0x00 __DEPRECATED_MACRO
64
#define DFU_DNLOAD 0x01 __DEPRECATED_MACRO
65
#define DFU_UPLOAD 0x02 __DEPRECATED_MACRO
66
#define DFU_GETSTATUS 0x03 __DEPRECATED_MACRO
67
#define DFU_CLRSTATUS 0x04 __DEPRECATED_MACRO
68
#define DFU_GETSTATE 0x05 __DEPRECATED_MACRO
69
#define DFU_ABORT 0x06 __DEPRECATED_MACRO
70
72
#define DFU_FUNC_DESC 0x21 __DEPRECATED_MACRO
73
75
#define DFU_ATTR_WILL_DETACH 0x08 __DEPRECATED_MACRO
76
#define DFU_ATTR_MANIFESTATION_TOLERANT 0x04 __DEPRECATED_MACRO
77
#define DFU_ATTR_CAN_UPLOAD 0x02 __DEPRECATED_MACRO
78
#define DFU_ATTR_CAN_DNLOAD 0x01 __DEPRECATED_MACRO
79
81
#define DFU_VERSION 0x0110 __DEPRECATED_MACRO
82
84
struct
dfu_runtime_descriptor
{
85
uint8_t
bLength
;
86
uint8_t
bDescriptorType
;
87
uint8_t
bmAttributes
;
88
uint16_t
wDetachTimeOut
;
89
uint16_t
wTransferSize
;
90
uint16_t
bcdDFUVersion
;
91
} __packed;
92
94
enum
dfu_status
{
95
statusOK
,
96
errTARGET
,
97
errFILE
,
98
errWRITE
,
99
errERASE
,
100
errCHECK_ERASED
,
101
errPROG
,
102
errVERIFY
,
103
errADDRESS
,
104
errNOTDONE
,
105
errFIRMWARE
,
106
errVENDOR
,
107
errUSB
,
108
errPOR
,
109
errUNKNOWN
,
110
errSTALLEDPKT
111
};
112
114
enum
dfu_state
{
115
appIDLE
,
116
appDETACH
,
117
dfuIDLE
,
118
dfuDNLOAD_SYNC
,
119
dfuDNBUSY
,
120
dfuDNLOAD_IDLE
,
121
dfuMANIFEST_SYNC
,
122
dfuMANIFEST
,
123
dfuMANIFEST_WAIT_RST
,
124
dfuUPLOAD_IDLE
,
125
dfuERROR
,
126
};
127
128
__deprecated
void
wait_for_usb_dfu
(
k_timeout_t
delay);
129
130
#endif
/* ZEPHYR_INCLUDE_USB_CLASS_USB_DFU_H_ */
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
dfu_runtime_descriptor
Run-Time Functional Descriptor.
Definition
usb_dfu.h:84
dfu_runtime_descriptor::bLength
uint8_t bLength
Definition
usb_dfu.h:85
dfu_runtime_descriptor::bcdDFUVersion
uint16_t bcdDFUVersion
Definition
usb_dfu.h:90
dfu_runtime_descriptor::bDescriptorType
uint8_t bDescriptorType
Definition
usb_dfu.h:86
dfu_runtime_descriptor::wTransferSize
uint16_t wTransferSize
Definition
usb_dfu.h:89
dfu_runtime_descriptor::bmAttributes
uint8_t bmAttributes
Definition
usb_dfu.h:87
dfu_runtime_descriptor::wDetachTimeOut
uint16_t wDetachTimeOut
Definition
usb_dfu.h:88
k_timeout_t
Kernel timeout type.
Definition
clock.h:65
sys_clock.h
dfu_state
dfu_state
bState values for the DFU_GETSTATUS response
Definition
usb_dfu.h:114
dfuMANIFEST_SYNC
@ dfuMANIFEST_SYNC
Definition
usb_dfu.h:121
dfuERROR
@ dfuERROR
Definition
usb_dfu.h:125
dfuUPLOAD_IDLE
@ dfuUPLOAD_IDLE
Definition
usb_dfu.h:124
dfuIDLE
@ dfuIDLE
Definition
usb_dfu.h:117
dfuDNLOAD_IDLE
@ dfuDNLOAD_IDLE
Definition
usb_dfu.h:120
appDETACH
@ appDETACH
Definition
usb_dfu.h:116
dfuMANIFEST_WAIT_RST
@ dfuMANIFEST_WAIT_RST
Definition
usb_dfu.h:123
appIDLE
@ appIDLE
Definition
usb_dfu.h:115
dfuMANIFEST
@ dfuMANIFEST
Definition
usb_dfu.h:122
dfuDNLOAD_SYNC
@ dfuDNLOAD_SYNC
Definition
usb_dfu.h:118
dfuDNBUSY
@ dfuDNBUSY
Definition
usb_dfu.h:119
wait_for_usb_dfu
void wait_for_usb_dfu(k_timeout_t delay)
dfu_status
dfu_status
bStatus values for the DFU_GETSTATUS response
Definition
usb_dfu.h:94
errSTALLEDPKT
@ errSTALLEDPKT
Definition
usb_dfu.h:110
errVENDOR
@ errVENDOR
Definition
usb_dfu.h:106
errVERIFY
@ errVERIFY
Definition
usb_dfu.h:102
errTARGET
@ errTARGET
Definition
usb_dfu.h:96
errFILE
@ errFILE
Definition
usb_dfu.h:97
errERASE
@ errERASE
Definition
usb_dfu.h:99
errWRITE
@ errWRITE
Definition
usb_dfu.h:98
errCHECK_ERASED
@ errCHECK_ERASED
Definition
usb_dfu.h:100
errUSB
@ errUSB
Definition
usb_dfu.h:107
errADDRESS
@ errADDRESS
Definition
usb_dfu.h:103
errFIRMWARE
@ errFIRMWARE
Definition
usb_dfu.h:105
errPOR
@ errPOR
Definition
usb_dfu.h:108
errUNKNOWN
@ errUNKNOWN
Definition
usb_dfu.h:109
errPROG
@ errPROG
Definition
usb_dfu.h:101
statusOK
@ statusOK
Definition
usb_dfu.h:95
errNOTDONE
@ errNOTDONE
Definition
usb_dfu.h:104
include
zephyr
usb
class
usb_dfu.h
Generated on Sun Aug 24 2025 06:52:32 for Zephyr Project API by
1.9.8