mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 16:55:58 +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
|
#ifndef STA_CORE_I2C_HPP
|
||||||
#define STA_I2C_HPP
|
#define STA_CORE_I2C_HPP
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sta/mutex.hpp>
|
#include <sta/mutex.hpp>
|
||||||
|
|
||||||
namespace sta {
|
namespace sta
|
||||||
class I2cDevice {
|
{
|
||||||
protected:
|
/**
|
||||||
uint16_t address;
|
* @brief Interface class for %SPI Hardware.
|
||||||
Mutex* mutex;
|
*/
|
||||||
bool master;
|
class I2cDevice
|
||||||
bool blocking;
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
I2cDevice(uint16_t address_10bit, Mutex* mutex=nullptr, bool master=false, bool blocking=true);
|
I2cDevice(uint16_t address_10bit, Mutex* mutex=nullptr, bool master=false, bool blocking=true);
|
||||||
|
|
||||||
virtual bool transmit(uint8_t* data, uint16_t size) = 0;
|
virtual bool transmit(uint8_t* data, uint16_t size) = 0;
|
||||||
@ -21,7 +22,13 @@ namespace sta {
|
|||||||
virtual void acquire();
|
virtual void acquire();
|
||||||
|
|
||||||
virtual void release();
|
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