aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb-dfu/src/lib.rs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2023-12-19 16:33:05 +0100
committerUlf Lilleengen <[email protected]>2023-12-19 16:33:05 +0100
commit9ddf8b08e448caca3825fc47aa737247323d8725 (patch)
tree5bbb53d608b475b4f2fcd07243f85854799843f8 /embassy-usb-dfu/src/lib.rs
parentc995732b0e08b3157aa8886da2e5ce4a36af6e93 (diff)
docs: document usb-logger and usb-dfu
Diffstat (limited to 'embassy-usb-dfu/src/lib.rs')
-rw-r--r--embassy-usb-dfu/src/lib.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/embassy-usb-dfu/src/lib.rs b/embassy-usb-dfu/src/lib.rs
index 389bb33f2..eaa4b6e33 100644
--- a/embassy-usb-dfu/src/lib.rs
+++ b/embassy-usb-dfu/src/lib.rs
@@ -1,12 +1,14 @@
1#![no_std] 1#![no_std]
2#![doc = include_str!("../README.md")]
3#![warn(missing_docs)]
2mod fmt; 4mod fmt;
3 5
4pub mod consts; 6pub mod consts;
5 7
6#[cfg(feature = "dfu")] 8#[cfg(feature = "dfu")]
7mod bootloader; 9mod dfu;
8#[cfg(feature = "dfu")] 10#[cfg(feature = "dfu")]
9pub use self::bootloader::*; 11pub use self::dfu::*;
10 12
11#[cfg(feature = "application")] 13#[cfg(feature = "application")]
12mod application; 14mod application;
@@ -17,7 +19,7 @@ pub use self::application::*;
17 all(feature = "dfu", feature = "application"), 19 all(feature = "dfu", feature = "application"),
18 not(any(feature = "dfu", feature = "application")) 20 not(any(feature = "dfu", feature = "application"))
19))] 21))]
20compile_error!("usb-dfu must be compiled with exactly one of `bootloader`, or `application` features"); 22compile_error!("usb-dfu must be compiled with exactly one of `dfu`, or `application` features");
21 23
22/// Provides a platform-agnostic interface for initiating a system reset. 24/// Provides a platform-agnostic interface for initiating a system reset.
23/// 25///
@@ -26,9 +28,11 @@ compile_error!("usb-dfu must be compiled with exactly one of `bootloader`, or `a
26/// 28///
27/// If alternate behaviour is desired, a custom implementation of Reset can be provided as a type argument to the usb_dfu function. 29/// If alternate behaviour is desired, a custom implementation of Reset can be provided as a type argument to the usb_dfu function.
28pub trait Reset { 30pub trait Reset {
31 /// Reset the device.
29 fn sys_reset() -> !; 32 fn sys_reset() -> !;
30} 33}
31 34
35/// Reset immediately.
32#[cfg(feature = "esp32c3-hal")] 36#[cfg(feature = "esp32c3-hal")]
33pub struct ResetImmediate; 37pub struct ResetImmediate;
34 38
@@ -40,6 +44,7 @@ impl Reset for ResetImmediate {
40 } 44 }
41} 45}
42 46
47/// Reset immediately.
43#[cfg(feature = "cortex-m")] 48#[cfg(feature = "cortex-m")]
44pub struct ResetImmediate; 49pub struct ResetImmediate;
45 50