Skip to content

Commit

Permalink
asynchronous/embassy: Add system_config wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertZ2011 committed Mar 7, 2025
1 parent b9190d4 commit 882a12f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/asynchronous/embassy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ impl<'a, M: RawMutex, B: I2c> Tps6699x<'a, M, B> {
self.lock_inner().await.set_port_control(port, control).await
}

/// Wrapper for `get_system_config`
pub async fn get_system_config(&mut self) -> Result<registers::field_sets::SystemConfig, Error<B::Error>> {
self.lock_inner().await.get_system_config().await
}

/// Wrapper for `set_system_config`
pub async fn set_system_config(
&mut self,
config: registers::field_sets::SystemConfig,
) -> Result<(), Error<B::Error>> {
self.lock_inner().await.set_system_config(config).await
}

/// Returns the number of ports
pub fn num_ports(&self) -> usize {
self.controller.num_ports
Expand Down

0 comments on commit 882a12f

Please sign in to comment.