mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-09-29 05:17:33 +00:00
Fixed broken imports after dir structure rework & added stm32 i2c
This commit is contained in:
@@ -5,19 +5,20 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
I2cDevice::I2cDevice(I2c * intf, int addr)
|
||||
: Device{intf}, addr_{addr}
|
||||
I2CDevice::I2CDevice(I2C * intf, int address, bool master, bool blocking)
|
||||
: Device{intf}, intf_{intf}, address_{address}, master_{master}, blocking_{blocking}
|
||||
{
|
||||
STA_ASSERT(intf != nullptr);
|
||||
}
|
||||
|
||||
void I2cDevice::select()
|
||||
void I2CDevice::select()
|
||||
{
|
||||
// TODO: Implement address selection here?
|
||||
// Initialize the interface to match the device's settings.
|
||||
intf_->setSettings(address_, master_, blocking_);
|
||||
}
|
||||
|
||||
void I2cDevice::deselect()
|
||||
void I2CDevice::deselect()
|
||||
{
|
||||
// TODO: Implement address deselection here?
|
||||
// Nothing to do here.
|
||||
}
|
||||
} // namespace sta
|
||||
|
@@ -3,9 +3,16 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
I2c::I2c(Mutex * mutex=nullptr)
|
||||
I2C::I2C(Mutex * mutex)
|
||||
: Interface{mutex}
|
||||
{
|
||||
|
||||
}
|
||||
} // namespace sta
|
||||
|
||||
void I2C::setSettings(uint16_t address, bool master, bool blocking)
|
||||
{
|
||||
address_ = address;
|
||||
master_ = master;
|
||||
blocking_ = blocking;
|
||||
}
|
||||
} // namespace sta
|
||||
|
Reference in New Issue
Block a user