boot: refactor i2c driver into namespace

This commit is contained in:
Michael Scire 2019-06-21 20:25:27 -07:00
parent e62754ed56
commit c87be7cd69
42 changed files with 1918 additions and 1836 deletions

View file

@ -18,20 +18,20 @@
#include <switch.h>
#include <stratosphere.hpp>
#include "i2c_driver/i2c_api.hpp"
#include "i2c/driver/i2c_api.hpp"
class RtcDriver {
private:
I2cSessionImpl i2c_session;
sts::i2c::driver::Session i2c_session;
public:
RtcDriver() {
I2cDriver::Initialize();
I2cDriver::OpenSession(&this->i2c_session, I2cDevice_Max77620Rtc);
sts::i2c::driver::Initialize();
sts::i2c::driver::OpenSession(&this->i2c_session, I2cDevice_Max77620Rtc);
}
~RtcDriver() {
I2cDriver::CloseSession(this->i2c_session);
I2cDriver::Finalize();
sts::i2c::driver::CloseSession(this->i2c_session);
sts::i2c::driver::Finalize();
}
private:
Result ReadRtcRegister(u8 *out, u8 address);