dfu.h
1 /*
2  * SPDX-FileCopyrightText: 2020 Mesotic SAS
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "usb/dfu.h"
19 #include "riotboot/flashwrite.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
28 typedef struct usbus_dfu_device {
33 #ifdef MODULE_RIOTBOOT_USB_DFU
34  usbus_interface_alt_t iface_alt_slot1;
35  usbus_string_t slot1_str;
36  riotboot_flashwrite_t writer;
37 #endif
40  unsigned mode;
41  unsigned selected_slot;
44 
52 void usbus_dfu_init(usbus_t *usbus, usbus_dfu_device_t *handler, unsigned mode);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
Definition for USB DFU interfaces.
usb_dfu_state_t
USBUS DFU internal state.
Definition: dfu.h:91
struct usbus_dfu_device usbus_dfu_device_t
USBUS DFU device interface context.
void usbus_dfu_init(usbus_t *usbus, usbus_dfu_device_t *handler, unsigned mode)
DFU initialization function.
riotboot flash writing module
firmware update state structure
Definition: flashwrite.h:102
USBUS descriptor generator.
Definition: usbus.h:294
USBUS DFU device interface context.
Definition: dfu.h:28
usbus_interface_t iface
Control interface.
Definition: dfu.h:30
usb_dfu_state_t dfu_state
Internal DFU state machine.
Definition: dfu.h:42
usbus_string_t slot0_str
Descriptor string for Slot 0.
Definition: dfu.h:32
unsigned mode
0 - APP mode, 1 DFU mode
Definition: dfu.h:40
bool skip_signature
Skip RIOTBOOT signature status.
Definition: dfu.h:38
unsigned selected_slot
Slot used for upgrade.
Definition: dfu.h:41
usbus_handler_t handler_ctrl
Control interface handler.
Definition: dfu.h:29
usbus_descr_gen_t dfu_descr
DFU descriptor generator.
Definition: dfu.h:31
usbus_t * usbus
Ptr to the USBUS context.
Definition: dfu.h:39
USBUS handler struct.
Definition: usbus.h:432
USBUS interface alternative setting.
Definition: usbus.h:337
USBUS interface.
Definition: usbus.h:349
USBUS string type.
Definition: usbus.h:206
USBUS context struct.
Definition: usbus.h:444