USB Device library for the STM32F103 with USB Device Firmware Upgrade (DFU) runtime support.
Dependents: STM32F103C8T6_WebUSBDFU STM32F103C8T6_USBDFU STM32F103C8T6_USBDFU dfu_usb_stm32f103
Fork of USBDevice_STM32F103 by
USBDFU/DFU.h@70:e410de636542, 2016-11-25 (annotated)
- Committer:
- devanlai
- Date:
- Fri Nov 25 18:31:08 2016 +0000
- Revision:
- 70:e410de636542
- Parent:
- 67:39396cc073f2
Merge callback fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
devanlai | 67:39396cc073f2 | 1 | /* |
devanlai | 67:39396cc073f2 | 2 | * Copyright 2016 Devan Lai |
devanlai | 67:39396cc073f2 | 3 | * |
devanlai | 67:39396cc073f2 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
devanlai | 67:39396cc073f2 | 5 | * you may not use this file except in compliance with the License. |
devanlai | 67:39396cc073f2 | 6 | * You may obtain a copy of the License at |
devanlai | 67:39396cc073f2 | 7 | * |
devanlai | 67:39396cc073f2 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
devanlai | 67:39396cc073f2 | 9 | * |
devanlai | 67:39396cc073f2 | 10 | * Unless required by applicable law or agreed to in writing, software |
devanlai | 67:39396cc073f2 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
devanlai | 67:39396cc073f2 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
devanlai | 67:39396cc073f2 | 13 | * See the License for the specific language governing permissions and |
devanlai | 67:39396cc073f2 | 14 | * limitations under the License. |
devanlai | 67:39396cc073f2 | 15 | */ |
devanlai | 67:39396cc073f2 | 16 | |
devanlai | 67:39396cc073f2 | 17 | #ifndef DFU_H |
devanlai | 67:39396cc073f2 | 18 | #define DFU_H |
devanlai | 67:39396cc073f2 | 19 | |
devanlai | 67:39396cc073f2 | 20 | enum DFURequest { |
devanlai | 67:39396cc073f2 | 21 | DFU_DETACH, |
devanlai | 67:39396cc073f2 | 22 | DFU_DNLOAD, |
devanlai | 67:39396cc073f2 | 23 | DFU_UPLOAD, |
devanlai | 67:39396cc073f2 | 24 | DFU_GETSTATUS, |
devanlai | 67:39396cc073f2 | 25 | DFU_CLRSTATUS, |
devanlai | 67:39396cc073f2 | 26 | DFU_GETSTATE, |
devanlai | 67:39396cc073f2 | 27 | DFU_ABORT, |
devanlai | 67:39396cc073f2 | 28 | }; |
devanlai | 67:39396cc073f2 | 29 | |
devanlai | 67:39396cc073f2 | 30 | enum DFUClass { |
devanlai | 67:39396cc073f2 | 31 | DFU_CLASS_APP_SPECIFIC = 0xFE, |
devanlai | 67:39396cc073f2 | 32 | }; |
devanlai | 67:39396cc073f2 | 33 | |
devanlai | 67:39396cc073f2 | 34 | enum DFUSubClass { |
devanlai | 67:39396cc073f2 | 35 | DFU_SUBCLASS_DFU = 0x01, |
devanlai | 67:39396cc073f2 | 36 | }; |
devanlai | 67:39396cc073f2 | 37 | |
devanlai | 67:39396cc073f2 | 38 | enum DFUProtocol { |
devanlai | 67:39396cc073f2 | 39 | DFU_PROTO_RUNTIME = 0x01, |
devanlai | 67:39396cc073f2 | 40 | DFU_PROTO_DFU = 0x02 |
devanlai | 67:39396cc073f2 | 41 | }; |
devanlai | 67:39396cc073f2 | 42 | |
devanlai | 67:39396cc073f2 | 43 | enum DFUDescriptorType { |
devanlai | 67:39396cc073f2 | 44 | DFU_DESCRIPTOR = 0x21, |
devanlai | 67:39396cc073f2 | 45 | }; |
devanlai | 67:39396cc073f2 | 46 | |
devanlai | 67:39396cc073f2 | 47 | enum DFUAttributes { |
devanlai | 67:39396cc073f2 | 48 | DFU_ATTR_CAN_DOWNLOAD = 0x01, |
devanlai | 67:39396cc073f2 | 49 | DFU_ATTR_CAN_UPLOAD = 0x02, |
devanlai | 67:39396cc073f2 | 50 | DFU_ATTR_MANIFEST_TOLERANT = 0x04, |
devanlai | 67:39396cc073f2 | 51 | DFU_ATTR_WILL_DETACH = 0x08, |
devanlai | 67:39396cc073f2 | 52 | }; |
devanlai | 67:39396cc073f2 | 53 | |
devanlai | 67:39396cc073f2 | 54 | enum DFUVersion { |
devanlai | 67:39396cc073f2 | 55 | DFU_VERSION_1_00 = 0x0100, |
devanlai | 67:39396cc073f2 | 56 | DFUSE_VERSION_1_1A = 0x011A, |
devanlai | 67:39396cc073f2 | 57 | }; |
devanlai | 67:39396cc073f2 | 58 | |
devanlai | 67:39396cc073f2 | 59 | #endif |