Added I2C support for raspi & first rework of debugging

This commit is contained in:
Dario
2023-06-23 15:50:54 +01:00
parent 3cf2173433
commit 6b4acfd27b
70 changed files with 985 additions and 772 deletions

23
src/bus/i2c/device.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include <sta/bus/i2c/device.hpp>
#include <sta/assert.hpp>
namespace sta
{
I2cDevice::I2cDevice(I2c * intf, int addr)
: Device{intf}, addr_{addr}
{
STA_ASSERT(intf != nullptr);
}
void I2cDevice::select()
{
// TODO: Implement address selection here?
}
void I2cDevice::deselect()
{
// TODO: Implement address deselection here?
}
} // namespace sta

11
src/bus/i2c/i2c.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include <sta/bus/i2c/i2c.hpp>
namespace sta
{
I2c::I2c(Mutex * mutex=nullptr)
: Interface{mutex}
{
}
} // namespace sta