// Value read properly after reconfigure
let mut lsettings = line::Settings::new().unwrap();
lsettings.set_active_low(true);
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
lconfig.add_line_settings(&offsets, lsettings).unwrap();
request.reconfigure_lines(&lconfig).unwrap();
assert_eq!(request.value(7).unwrap(), Value::InActive);
config.lconfig_val(Some(Direction::Output), Some(Value::InActive));
config.lconfig_add_settings(&offsets);
config.request_lines().unwrap();
- let request = config.request();
// Set single value
- request.set_value(1, Value::Active).unwrap();
+ config.request().set_value(1, Value::Active).unwrap();
assert_eq!(config.sim_val(0).unwrap(), SimValue::InActive);
assert_eq!(config.sim_val(1).unwrap(), SimValue::Active);
assert_eq!(config.sim_val(3).unwrap(), SimValue::InActive);
assert_eq!(config.sim_val(4).unwrap(), SimValue::InActive);
- request.set_value(1, Value::InActive).unwrap();
+ config.request().set_value(1, Value::InActive).unwrap();
assert_eq!(config.sim_val(1).unwrap(), SimValue::InActive);
// Set values of subset
let mut map = ValueMap::new();
map.insert(4, Value::Active);
map.insert(3, Value::Active);
- request.set_values_subset(map).unwrap();
+ config.request().set_values_subset(map).unwrap();
assert_eq!(config.sim_val(0).unwrap(), SimValue::InActive);
assert_eq!(config.sim_val(1).unwrap(), SimValue::InActive);
assert_eq!(config.sim_val(3).unwrap(), SimValue::Active);
let mut map = ValueMap::new();
map.insert(4, Value::InActive);
map.insert(3, Value::InActive);
- request.set_values_subset(map).unwrap();
+ config.request().set_values_subset(map).unwrap();
assert_eq!(config.sim_val(3).unwrap(), SimValue::InActive);
assert_eq!(config.sim_val(4).unwrap(), SimValue::InActive);
// Set all values
- request
+ config.request()
.set_values(&[
Value::Active,
Value::InActive,
assert_eq!(config.sim_val(1).unwrap(), SimValue::InActive);
assert_eq!(config.sim_val(3).unwrap(), SimValue::Active);
assert_eq!(config.sim_val(4).unwrap(), SimValue::InActive);
- request
+ config.request()
.set_values(&[
Value::InActive,
Value::InActive,
// Reconfigure
let mut lsettings = line::Settings::new().unwrap();
lsettings.set_direction(Direction::Input).unwrap();
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
// The uAPI config has only 10 attribute slots, this should pass.
for offset in offsets {
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.bias().unwrap(), None);
- let request = config.request();
-
// Reconfigure
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.bias().unwrap(), Some(Bias::PullUp));
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.bias().unwrap(), Some(Bias::PullDown));
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.bias().unwrap(), Some(Bias::Disabled));
}
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.drive().unwrap(), Drive::PushPull);
- let request = config.request();
-
// Reconfigure
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.drive().unwrap(), Drive::PushPull);
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.drive().unwrap(), Drive::OpenDrain);
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.drive().unwrap(), Drive::OpenSource);
}
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.edge_detection().unwrap(), None);
- let request = config.request();
-
// Reconfigure
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.edge_detection().unwrap(), Some(Edge::Both));
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.edge_detection().unwrap(), Some(Edge::Rising));
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[
])
.unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.edge_detection().unwrap(), Some(Edge::Falling));
}
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.event_clock().unwrap(), EventClock::Monotonic);
- let request = config.request();
-
// Reconfigure
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings.set_event_clock(EventClock::Monotonic).unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.event_clock().unwrap(), EventClock::Monotonic);
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings.set_event_clock(EventClock::Realtime).unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
- request.reconfigure_lines(&lconfig).unwrap();
+ config.request().reconfigure_lines(&lconfig).unwrap();
let info = config.chip().line_info(0).unwrap();
assert_eq!(info.event_clock().unwrap(), EventClock::Realtime);
}
let request = config.request();
// Reconfigure
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings.set_event_clock(EventClock::HTE).unwrap();
lconfig.add_line_settings(&[0], lsettings).unwrap();
let request = config.request();
// Reconfigure
- let lconfig = line::Config::new().unwrap();
+ let mut lconfig = line::Config::new().unwrap();
let mut lsettings = line::Settings::new().unwrap();
lsettings
.set_prop(&[