40 lines
813 B
C++

#ifndef STA_CORE_I2C_I2C_HPP
#define STA_CORE_I2C_I2C_HPP
#include <sta/bus/interface.hpp>
#include <sta/mutex.hpp>
#include <cstddef>
#include <cstdint>
namespace sta
{
/**
* @brief Interface class for %I2C hardware.
*
* Represents a single %I2C bus that can be shared by multiple devices.
*
* @ingroup sta_core_i2c
*/
class I2C : public Interface
{
public:
I2C(Mutex * mutex=nullptr);
/**
* @brief Specify the mode of communication via the bus.
*
* @param master
* @param blocking
*/
void setSettings(uint16_t address, bool master, bool blocking);
protected:
uint16_t address_;
bool master_;
bool blocking_;
};
} // namespace sta
#endif // STA_CORE_I2C_I2C_HPP