mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 00:36:00 +00:00
Reformatted class I2cDevice to match SPIDevice
This commit is contained in:
parent
13af941187
commit
c5e4fd39ec
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user