Reformatted class I2cDevice to match SPIDevice

This commit is contained in:
dvdb97 2023-05-06 15:44:29 +02:00
parent 13af941187
commit c5e4fd39ec

View File

@ -1,17 +1,18 @@
#ifndef STA_I2C_HPP
#define STA_I2C_HPP
#ifndef STA_CORE_I2C_HPP
#define STA_CORE_I2C_HPP
#include <cstdint>
#include <sta/mutex.hpp>
namespace sta {
class I2cDevice {
protected:
uint16_t address;
Mutex* mutex;
bool master;
bool blocking;
namespace sta
{
/**
* @brief Interface class for %SPI Hardware.
*/
class I2cDevice
{
public:
I2cDevice(uint16_t address_10bit, Mutex* mutex=nullptr, bool master=false, bool blocking=true);
virtual bool transmit(uint8_t* data, uint16_t size) = 0;
@ -21,7 +22,13 @@ namespace sta {
virtual void acquire();
virtual void release();
};
}
#endif // STA_I2C_HPP
protected:
uint16_t address;
Mutex* mutex;
bool master;
bool blocking;
};
} // namespace sta
#endif // STA_CORE_I2C_HPP