aboutsummaryrefslogtreecommitdiff
path: root/embassy-embedded-hal/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-embedded-hal/src/lib.rs')
-rw-r--r--embassy-embedded-hal/src/lib.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/embassy-embedded-hal/src/lib.rs b/embassy-embedded-hal/src/lib.rs
index 3aad838bd..8872b3d61 100644
--- a/embassy-embedded-hal/src/lib.rs
+++ b/embassy-embedded-hal/src/lib.rs
@@ -26,6 +26,18 @@ pub trait SetConfig {
26 /// The configuration type used by this driver. 26 /// The configuration type used by this driver.
27 type Config; 27 type Config;
28 28
29 /// The error type that can occur if `set_config` fails.
30 type ConfigError;
31
29 /// Set the configuration of the driver. 32 /// Set the configuration of the driver.
30 fn set_config(&mut self, config: &Self::Config); 33 fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>;
34}
35
36/// Get the configuration of a peripheral driver.
37pub trait GetConfig {
38 /// The configuration type used by this driver.
39 type Config;
40
41 /// Get the configuration of the driver.
42 fn get_config(&self) -> Self::Config;
31} 43}