mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Change init sequence: I2C is now initialized before "power" init phase, to allow for I2C power control - I2c HAL: Added read/write support for registers - Added axp192 code from https://github.com/tuupola/axp192 to Core2 implementation - Fixes for Core2Power - Fix for root project CMakeLists.txt
29 lines
780 B
C++
29 lines
780 B
C++
#include "hal/Hal_i.h"
|
|
#include "hal/i2c/I2c.h"
|
|
|
|
#define TAG "hal"
|
|
|
|
namespace tt::hal {
|
|
|
|
void init(const Configuration& configuration) {
|
|
tt_check(i2c::init(configuration.i2c), "I2C init failed");
|
|
if (configuration.initHardware != nullptr) {
|
|
TT_LOG_I(TAG, "Init hardware");
|
|
tt_check(configuration.initHardware(), "Hardware init failed");
|
|
}
|
|
|
|
if (configuration.initBoot != nullptr) {
|
|
TT_LOG_I(TAG, "Init power");
|
|
tt_check(configuration.initBoot(), "Init power failed");
|
|
}
|
|
|
|
if (configuration.sdcard != nullptr) {
|
|
TT_LOG_I(TAG, "Mounting sdcard");
|
|
if (!configuration.sdcard->mount(TT_SDCARD_MOUNT_POINT )) {
|
|
TT_LOG_W(TAG, "SD card mount failed (init can continue)");
|
|
}
|
|
}
|
|
}
|
|
|
|
} // namespace
|