Skip to content

Commit

Permalink
Reduce the range of vreg voltage to be on-target-test
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiyukiOkayasu committed Feb 25, 2024
1 parent 7d8a8c2 commit 6263bfc
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions on-target-tests/tests/vreg_change_voltage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,44 +62,26 @@ mod tests {

#[test]
fn change_onchip_regulator_voltage(state: &mut State) {
// Set the voltage to 1.20V
let target_voltage = VSEL_A::VOLTAGE1_20;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);

// Set the voltage to 1.25V
let target_voltage = VSEL_A::VOLTAGE1_25;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);

// Set the voltage to 1.30V
let target_voltage = VSEL_A::VOLTAGE1_30;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);

// Set the voltage to 0.90V
let target_voltage = VSEL_A::VOLTAGE0_90;
// Set the voltage to 1.05V
let target_voltage = VSEL_A::VOLTAGE1_05;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);

// Set the voltage to 0.95V
let target_voltage = VSEL_A::VOLTAGE0_95;
// Set the voltage to 1.10V
let target_voltage = VSEL_A::VOLTAGE1_10;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);

// Set the voltage to 1.00V
let target_voltage = VSEL_A::VOLTAGE1_00;
// Set the voltage to 1.15V
let target_voltage = VSEL_A::VOLTAGE1_15;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);

// Set the voltage to 1.05V
let target_voltage = VSEL_A::VOLTAGE1_05;
// Set the voltage to 1.20V
let target_voltage = VSEL_A::VOLTAGE1_20;
vreg::set_voltage(&mut state.vreg, target_voltage);
let v = vreg::get_voltage(&mut state.vreg).unwrap();
assert!(v == target_voltage);
Expand Down

0 comments on commit 6263bfc

Please sign in to comment.