mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 14:05:17 -04:00
boot: refactor i2c driver into namespace
This commit is contained in:
parent
e62754ed56
commit
c87be7cd69
42 changed files with 1918 additions and 1836 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue