i2c: command list format, get boot down to linker errors

This commit is contained in:
Michael Scire 2020-10-31 22:52:43 -07:00 committed by SciresM
parent 42caa4ffd1
commit 258cfb62a2
13 changed files with 233 additions and 50 deletions

View file

@ -20,16 +20,14 @@ namespace ams::boot {
class RtcDriver {
private:
i2c::driver::Session i2c_session;
i2c::driver::I2cSession i2c_session;
public:
RtcDriver() {
i2c::driver::Initialize();
i2c::driver::OpenSession(&this->i2c_session, I2cDevice_Max77620Rtc);
R_ABORT_UNLESS(i2c::driver::OpenSession(std::addressof(this->i2c_session), i2c::DeviceCode_Max77620Rtc));
}
~RtcDriver() {
i2c::driver::CloseSession(this->i2c_session);
i2c::driver::Finalize();
}
private:
Result ReadRtcRegister(u8 *out, u8 address);