pub struct Config { /* private fields */ }Expand description
Line configuration objects.
The line-config object contains the configuration for lines that can be used in two cases:
- when making a line request
- when reconfiguring a set of already requested lines.
A new line-config object is empty. Using it in a request will lead to an error. In order for a line-config to become useful, it needs to be assigned at least one offset-to-settings mapping by calling ::gpiod_line_config_add_line_settings.
When calling ::gpiod_chip_request_lines, the library will request all offsets that were assigned settings in the order that they were assigned.
Implementations§
Source§impl Config
impl Config
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the entire configuration stored in the object. This is useful if the user wants to reuse the object without reallocating it.
Sourcepub fn add_line_settings(
&mut self,
offsets: &[Offset],
settings: Settings,
) -> Result<&mut Self>
pub fn add_line_settings( &mut self, offsets: &[Offset], settings: Settings, ) -> Result<&mut Self>
Add line settings for a set of offsets.
Sourcepub fn set_output_values(&mut self, values: &[Value]) -> Result<&mut Self>
pub fn set_output_values(&mut self, values: &[Value]) -> Result<&mut Self>
Set output values for a number of lines.
Sourcepub fn line_settings(&self) -> Result<SettingsMap>
pub fn line_settings(&self) -> Result<SettingsMap>
Get a mapping of offsets to line settings stored by this object.