diff options
| author | Ulf Lilleengen <[email protected]> | 2023-12-19 16:33:05 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2023-12-19 16:33:05 +0100 |
| commit | 9ddf8b08e448caca3825fc47aa737247323d8725 (patch) | |
| tree | 5bbb53d608b475b4f2fcd07243f85854799843f8 /embassy-usb-dfu/src/lib.rs | |
| parent | c995732b0e08b3157aa8886da2e5ce4a36af6e93 (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.rs | 11 |
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)] | ||
| 2 | mod fmt; | 4 | mod fmt; |
| 3 | 5 | ||
| 4 | pub mod consts; | 6 | pub mod consts; |
| 5 | 7 | ||
| 6 | #[cfg(feature = "dfu")] | 8 | #[cfg(feature = "dfu")] |
| 7 | mod bootloader; | 9 | mod dfu; |
| 8 | #[cfg(feature = "dfu")] | 10 | #[cfg(feature = "dfu")] |
| 9 | pub use self::bootloader::*; | 11 | pub use self::dfu::*; |
| 10 | 12 | ||
| 11 | #[cfg(feature = "application")] | 13 | #[cfg(feature = "application")] |
| 12 | mod application; | 14 | mod 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 | ))] |
| 20 | compile_error!("usb-dfu must be compiled with exactly one of `bootloader`, or `application` features"); | 22 | compile_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. |
| 28 | pub trait Reset { | 30 | pub 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")] |
| 33 | pub struct ResetImmediate; | 37 | pub 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")] |
| 44 | pub struct ResetImmediate; | 49 | pub struct ResetImmediate; |
| 45 | 50 | ||
