diff options
| author | xoviat <[email protected]> | 2023-10-01 09:37:20 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-10-01 09:37:20 -0500 |
| commit | 5ad34404af9b7cfecfed5075d987c4c03ff2ca27 (patch) | |
| tree | 72f07beb474ef99a94408aba6b9c0362aa454889 /embassy-embedded-hal/src/lib.rs | |
| parent | a7b1e516504bb0df9f7af42361e4280adcc30417 (diff) | |
eh: update set_config and add get_config
Diffstat (limited to 'embassy-embedded-hal/src/lib.rs')
| -rw-r--r-- | embassy-embedded-hal/src/lib.rs | 14 |
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. | ||
| 37 | pub 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 | } |
