Zephyr API 3.6.99
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
44#ifndef ZEPHYR_INCLUDE_USB_CLASS_USB_DFU_H_
45#define ZEPHYR_INCLUDE_USB_CLASS_USB_DFU_H_
46
47#include <zephyr/sys_clock.h>
48
50#define DFU_SUBCLASS 0x01
51
53#define DFU_RT_PROTOCOL 0x01
54
56#define DFU_MODE_PROTOCOL 0x02
57
61#define DFU_DETACH 0x00
62#define DFU_DNLOAD 0x01
63#define DFU_UPLOAD 0x02
64#define DFU_GETSTATUS 0x03
65#define DFU_CLRSTATUS 0x04
66#define DFU_GETSTATE 0x05
67#define DFU_ABORT 0x06
68
70#define DFU_FUNC_DESC 0x21
71
73#define DFU_ATTR_WILL_DETACH 0x08
74#define DFU_ATTR_MANIFESTATION_TOLERANT 0x04
75#define DFU_ATTR_CAN_UPLOAD 0x02
76#define DFU_ATTR_CAN_DNLOAD 0x01
77
79#define DFU_VERSION 0x0110
80
90
110
125
127
128#endif /* ZEPHYR_INCLUDE_USB_CLASS_USB_DFU_H_ */
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Run-Time Functional Descriptor.
Definition usb_dfu.h:82
uint8_t bLength
Definition usb_dfu.h:83
uint16_t bcdDFUVersion
Definition usb_dfu.h:88
uint8_t bDescriptorType
Definition usb_dfu.h:84
uint16_t wTransferSize
Definition usb_dfu.h:87
uint8_t bmAttributes
Definition usb_dfu.h:85
uint16_t wDetachTimeOut
Definition usb_dfu.h:86
Kernel timeout type.
Definition sys_clock.h:65
Variables needed for system clock.
dfu_state
bState values for the DFU_GETSTATUS response
Definition usb_dfu.h:112
@ dfuMANIFEST_SYNC
Definition usb_dfu.h:119
@ dfuERROR
Definition usb_dfu.h:123
@ dfuUPLOAD_IDLE
Definition usb_dfu.h:122
@ dfuIDLE
Definition usb_dfu.h:115
@ dfuDNLOAD_IDLE
Definition usb_dfu.h:118
@ appDETACH
Definition usb_dfu.h:114
@ dfuMANIFEST_WAIT_RST
Definition usb_dfu.h:121
@ appIDLE
Definition usb_dfu.h:113
@ dfuMANIFEST
Definition usb_dfu.h:120
@ dfuDNLOAD_SYNC
Definition usb_dfu.h:116
@ dfuDNBUSY
Definition usb_dfu.h:117
void wait_for_usb_dfu(k_timeout_t delay)
dfu_status
bStatus values for the DFU_GETSTATUS response
Definition usb_dfu.h:92
@ errSTALLEDPKT
Definition usb_dfu.h:108
@ errVENDOR
Definition usb_dfu.h:104
@ errVERIFY
Definition usb_dfu.h:100
@ errTARGET
Definition usb_dfu.h:94
@ errFILE
Definition usb_dfu.h:95
@ errERASE
Definition usb_dfu.h:97
@ errWRITE
Definition usb_dfu.h:96
@ errCHECK_ERASED
Definition usb_dfu.h:98
@ errUSB
Definition usb_dfu.h:105
@ errADDRESS
Definition usb_dfu.h:101
@ errFIRMWARE
Definition usb_dfu.h:103
@ errPOR
Definition usb_dfu.h:106
@ errUNKNOWN
Definition usb_dfu.h:107
@ errPROG
Definition usb_dfu.h:99
@ statusOK
Definition usb_dfu.h:93
@ errNOTDONE
Definition usb_dfu.h:102