mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-13 01:55:59 +00:00
23 lines
512 B
C++
23 lines
512 B
C++
#include <sta/i2c.hpp>
|
|
|
|
namespace sta {
|
|
I2cDevice::I2cDevice(uint16_t address_7bit, Mutex* mutex, bool master, bool blocking) {
|
|
this->address = address_7bit << 1;
|
|
this->mutex = mutex;
|
|
this->master = master;
|
|
this->blocking = blocking;
|
|
}
|
|
|
|
void I2cDevice::acquire() {
|
|
if (this->mutex != nullptr) {
|
|
mutex->acquire();
|
|
}
|
|
}
|
|
|
|
void I2cDevice::release() {
|
|
if (this->mutex != nullptr) {
|
|
mutex->release();
|
|
}
|
|
}
|
|
}
|