OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
dfu_spec.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * dfu_spec.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
20 #ifndef COMMON_DFU_SPEC_H_
21 #define COMMON_DFU_SPEC_H_
22 
28 #include <stdint.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 enum {
38  DFU_DETACH = 0,
39  DFU_DNLOAD = 1,
40  DFU_UPLOAD = 2,
41  DFU_GETSTATUS = 3,
42  DFU_CLRSTATUS = 4,
43  DFU_GETSTATE = 5,
44  DFU_ABORT = 6
45 };
46 
50 typedef enum {
51  APP_STATE_IDLE = 0,
52  APP_STATE_DETACH = 1,
53  DFU_STATE_IDLE = 2,
54  DFU_STATE_DNLOAD_SYNC = 3,
55  DFU_STATE_DNBUSY = 4,
56  DFU_STATE_DNLOAD_IDLE = 5,
57  DFU_STATE_MANIFEST_SYNC = 6,
58  DFU_STATE_MANIFEST = 7,
59  DFU_STATE_MANIFEST_WAIT_RESET = 8,
60  DFU_STATE_UPLOAD_IDLE = 9,
61  DFU_STATE_ERROR = 10
62 } DFUState;
63 
67 typedef enum {
68  DFU_STATUS_OK = 0x00,
69  DFU_STATUS_ERR_TARGET = 0x01,
70  DFU_STATUS_ERR_FILE = 0x02,
71  DFU_STATUS_ERR_WRITE = 0x03,
72  DFU_STATUS_ERR_ERASE = 0x04,
73  DFU_STATUS_ERR_CHECK_ERASED = 0x05,
74  DFU_STATUS_ERR_PROG = 0x06,
75  DFU_STATUS_ERR_VERIFY = 0x07,
76  DFU_STATUS_ERR_ADDRESS = 0x08,
77  DFU_STATUS_ERR_NOT_DONE = 0x09,
78  DFU_STATUS_ERR_FIRMWARE = 0x0a,
79  DFU_STATUS_ERR_VENDOR = 0x0b,
80  DFU_STATUS_ERR_USBR = 0x0c,
81  DFU_STATUS_ERR_POR = 0x0d,
82  DFU_STATUS_ERR_UNKNOWN = 0x0e,
83  DFU_STATUS_ERR_STALLED_PKT = 0x0f
84 } DFUStatus;
85 
89 enum {
91  DFU_CAN_UPLOAD = 0x02,
94 };
95 
99 enum { GET_STATUS_RESPONSE_SIZE = 6 };
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif // COMMON_DFU_SPEC_H_
DFUStatus
DFU status codes.
Definition: dfu_spec.h:67
Download supported.
Definition: dfu_spec.h:90
Will detach without timer.
Definition: dfu_spec.h:93
Upload supported.
Definition: dfu_spec.h:91
DFUState
DFU States.
Definition: dfu_spec.h:50
Manifestation tolerant.
Definition: dfu_spec.h:92