Flair
Framework Libre Air
RTDM_I2cPort.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef RTDM_I2CPORT_H
14 #define RTDM_I2CPORT_H
15 
16 #include <I2cPort.h>
17 
18 namespace flair {
19 namespace core {
27 class RTDM_I2cPort : public I2cPort {
28 public:
41  RTDM_I2cPort(const Object *parent, std::string name, std::string device);
42 
47  ~RTDM_I2cPort();
48 
56  int SetSlave(uint16_t address);
57 
66  ssize_t Write(const void *buf, size_t nbyte);
67 
76  ssize_t Read(void *buf, size_t nbyte);
77 
85  void SetRxTimeout(Time timeout_ns);
86 
94  void SetTxTimeout(Time timeout_ns);
95 
96 private:
97  int fd;
98 };
99 } // end namespace core
100 } // end namespace flair
101 
102 #endif // RTDM_I2CPORT_H
Base class for all Framework's classes.
Definition: Object.h:77
namespace of the flair Framework
Definition: Ahrs.h:19
unsigned long long Time
Time definition, in ns.
Definition: Object.h:49
Base class for i2c port.
RTDM_I2cPort(const Object *parent, std::string name, std::string device)
Constructor.
int SetSlave(uint16_t address)
Set slave's address.
ssize_t Write(const void *buf, size_t nbyte)
Write datas.
~RTDM_I2cPort()
Destructor.
Class for real time i2c port using RTDM.
Definition: RTDM_I2cPort.h:27
Base class for i2c port.
Definition: I2cPort.h:31
void SetRxTimeout(Time timeout_ns)
Set RX timeout.
ssize_t Read(void *buf, size_t nbyte)
Read datas.
void SetTxTimeout(Time timeout_ns)
Set TX timeout.