summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_dfu_runtime.h
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/usb_dfu_runtime.h')
-rw-r--r--chip/stm32/usb_dfu_runtime.h57
1 files changed, 28 insertions, 29 deletions
diff --git a/chip/stm32/usb_dfu_runtime.h b/chip/stm32/usb_dfu_runtime.h
index 08781d77b0..8b0bbbe219 100644
--- a/chip/stm32/usb_dfu_runtime.h
+++ b/chip/stm32/usb_dfu_runtime.h
@@ -1,4 +1,4 @@
-/* Copyright 2022 The Chromium OS Authors. All rights reserved.
+/* Copyright 2022 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -12,47 +12,46 @@
* https://www.usb.org/sites/default/files/DFU_1.1.pdf
*/
-#define USB_DFU_RUNTIME_SUBCLASS 0x01
-#define USB_DFU_RUNTIME_PROTOCOL 0x01
+#define USB_DFU_RUNTIME_SUBCLASS 0x01
+#define USB_DFU_RUNTIME_PROTOCOL 0x01
-#define USB_DFU_RUNTIME_DESC_ATTR_CAN_DOWNLOAD BIT(0)
-#define USB_DFU_RUNTIME_DESC_ATTR_CAN_UPLOAD BIT(1)
-#define USB_DFU_RUNTIME_DESC_ATTR_MANIFEST_TOLERANT BIT(2)
-#define USB_DFU_RUNTIME_DESC_ATTR_WILL_DETACH BIT(3)
+#define USB_DFU_RUNTIME_DESC_ATTR_CAN_DOWNLOAD BIT(0)
+#define USB_DFU_RUNTIME_DESC_ATTR_CAN_UPLOAD BIT(1)
+#define USB_DFU_RUNTIME_DESC_ATTR_MANIFEST_TOLERANT BIT(2)
+#define USB_DFU_RUNTIME_DESC_ATTR_WILL_DETACH BIT(3)
-#define USB_DFU_RUNTIME_DESC_ATTRS \
+#define USB_DFU_RUNTIME_DESC_ATTRS \
(USB_DFU_RUNTIME_DESC_ATTR_CAN_DOWNLOAD | \
- USB_DFU_RUNTIME_DESC_ATTR_CAN_UPLOAD | \
- USB_DFU_RUNTIME_DESC_ATTR_WILL_DETACH)
+ USB_DFU_RUNTIME_DESC_ATTR_CAN_UPLOAD | \
+ USB_DFU_RUNTIME_DESC_ATTR_WILL_DETACH)
-#define USB_DFU_RUNTIME_DESC_SIZE 9
-#define USB_DFU_RUNTIME_DESC_FUNCTIONAL 0x21
-#define USB_DFU_RUNTIME_DESC_DETACH_TIMEOUT 0xffff
-#define USB_DFU_RUNTIME_DESC_TRANSFER_SIZE 64
-#define USB_DFU_RUNTIME_DESC_DFU_VERSION 0x0022
+#define USB_DFU_RUNTIME_DESC_SIZE 9
+#define USB_DFU_RUNTIME_DESC_FUNCTIONAL 0x21
+#define USB_DFU_RUNTIME_DESC_DETACH_TIMEOUT 0xffff
+#define USB_DFU_RUNTIME_DESC_TRANSFER_SIZE 64
+#define USB_DFU_RUNTIME_DESC_DFU_VERSION 0x0022
/* DFU states */
-#define USB_DFU_RUNTIME_STATE_APP_IDLE 0
-#define USB_DFU_RUNTIME_STATE_APP_DETACH 1
+#define USB_DFU_RUNTIME_STATE_APP_IDLE 0
+#define USB_DFU_RUNTIME_STATE_APP_DETACH 1
/* DFU status */
-#define USB_DFU_RUNTIME_STATUS_OK 0
+#define USB_DFU_RUNTIME_STATUS_OK 0
/* DFU Request types */
-#define USB_DFU_RUNTIME_REQ_DETACH 0
-#define USB_DFU_RUNTIME_REQ_DNLOAD 1
-#define USB_DFU_RUNTIME_REQ_UPLOAD 2
-#define USB_DFU_RUNTIME_REQ_GET_STATUS 3
-#define USB_DFU_RUNTIME_REQ_CLR_STATUS 4
-#define USB_DFU_RUNTIME_REQ_GET_STATE 5
-#define USB_DFU_RUNTIME_REQ_ABORT 6
-
+#define USB_DFU_RUNTIME_REQ_DETACH 0
+#define USB_DFU_RUNTIME_REQ_DNLOAD 1
+#define USB_DFU_RUNTIME_REQ_UPLOAD 2
+#define USB_DFU_RUNTIME_REQ_GET_STATUS 3
+#define USB_DFU_RUNTIME_REQ_CLR_STATUS 4
+#define USB_DFU_RUNTIME_REQ_GET_STATE 5
+#define USB_DFU_RUNTIME_REQ_ABORT 6
/* DFU Functional Descriptor */
struct usb_runtime_dfu_functional_desc {
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint8_t bmAttributes;
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bmAttributes;
uint16_t wDetachTimeOut;
uint16_t wTransferSize;
uint16_t bcdDFUVersion;