Skip to content

Commit

Permalink
Merge pull request #12 from jeanthom/pcf5060x-gp0c1
Browse files Browse the repository at this point in the history
Implement PCF5060x's GP0C1 register
  • Loading branch information
jeanthom authored Aug 24, 2023
2 parents e199dcf + bb81171 commit 7cef5cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clicky-core/src/devices/i2c/devices/pcf5060x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ struct Pcf5060xImpl {
mbcc2: u8,
rtc_alarm: [u8; 7],
bvmc: u8,
gp0c1: u8,
}

impl Pcf5060xImpl {
Expand All @@ -233,6 +234,7 @@ impl Pcf5060xImpl {
mbcc2: 0,
rtc_alarm: [0; 7],
bvmc: 0,
gp0c1: 0x04,
}
}

Expand Down Expand Up @@ -317,6 +319,7 @@ impl Pcf5060xImpl {
ADCS3__ => Err(StubRead(Trace, 0)),
// Battery Voltage Monitor (BVM)
BVMC___ => Ok(self.bvmc),
GPOC1__ => Ok(self.gp0c1),
_ => Err(Unimplemented),
}
}
Expand Down Expand Up @@ -366,6 +369,7 @@ impl Pcf5060xImpl {
ADCS3__ => Err(InvalidAccess),
// Battery Voltage Monitor (BVM)
BVMC___ => Ok(self.bvmc = data),
GPOC1__ => Ok(self.gp0c1 = data),
_ => Err(Unimplemented),
}
}
Expand Down

0 comments on commit 7cef5cf

Please sign in to comment.