MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / set_gpio

Method set_gpio

framework_lib/src/chromium_ec/mod.rs:1769–1781  ·  view source on GitHub ↗
(&self, name: &str, value: bool)

Source from the content-addressed store, hash-verified

1767 }
1768
1769 pub fn set_gpio(&self, name: &str, value: bool) -> EcResult<()> {
1770 const MAX_LEN: usize = 32;
1771 let mut request = EcRequestGpioSetV0 {
1772 name: [0; MAX_LEN],
1773 value: value as u8,
1774 };
1775
1776 let end = MAX_LEN.min(name.len());
1777 request.name[..end].copy_from_slice(&name.as_bytes()[..end]);
1778
1779 request.send_command(self)?;
1780 Ok(())
1781 }
1782 pub fn get_gpio(&self, name: &str) -> EcResult<bool> {
1783 const MAX_LEN: usize = 32;
1784 let mut request = EcRequestGpioGetV0 { name: [0; MAX_LEN] };

Callers 1

set_gpu_descriptorMethod · 0.80

Calls 1

send_commandMethod · 0.45

Tested by

no test coverage detected