mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-13 01:55:59 +00:00
34 lines
862 B
C++
34 lines
862 B
C++
#ifndef STA_CORE_ARDUINO_I2C_HPP
|
|
#define STA_CORE_ARDUINO_I2C_HPP
|
|
|
|
#include <sta/config.hpp>
|
|
#ifdef STA_PLATFORM_ARDUINO
|
|
|
|
#include <sta/bus/i2c/device.hpp>
|
|
#include <sta/bus/i2c/i2c.hpp>
|
|
|
|
namespace sta
|
|
{
|
|
class ArduinoI2C : public I2C
|
|
{
|
|
public:
|
|
ArduinoI2C(Mutex * mutex = nullptr);
|
|
|
|
void transfer(uint8_t value) override;
|
|
void transfer16(uint16_t value) override;
|
|
void transfer(const uint8_t * buffer, size_t size) override;
|
|
void receive(uint8_t * buffer, size_t size) override;
|
|
|
|
void fill(uint8_t value, size_t count) override;
|
|
};
|
|
|
|
class ArduinoI2CDevice : public I2CDevice
|
|
{
|
|
public:
|
|
ArduinoI2CDevice(I2C * intf, uint8_t address, bool master=true, bool blocking=true);
|
|
};
|
|
} // namespace sta
|
|
|
|
#endif // STA_PLATFORM_ARDUINO
|
|
|
|
#endif // STA_CORE_ARDUINO_I2C_HPP
|