Flair
Framework Libre Air
Unix_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 UNIX_I2CPORT_H
14 #define UNIX_I2CPORT_H
15 
16 #include <I2cPort.h>
17 
18 namespace flair {
19 namespace core {
25 class Unix_I2cPort : public I2cPort {
26 
27 public:
37  Unix_I2cPort(const Object *parent, std::string port_name, std::string device);
38 
43  ~Unix_I2cPort();
44 
52  int SetSlave(uint16_t address);
53 
61  void SetRxTimeout(Time timeout_ns);
62 
70  void SetTxTimeout(Time timeout_ns);
71 
80  ssize_t Write(const void *buf, size_t nbyte);
81 
90  ssize_t Read(void *buf, size_t nbyte);
91 
92 private:
93  int fd;
94 };
95 } // end namespace core
96 } // end namespace flair
97 
98 #endif // UNIX_I2CPORT_H
~Unix_I2cPort()
Destructor.
Base class for all Framework's classes.
Definition: Object.h:83
namespace of the flair Framework
Definition: Ahrs.h:19
Unix_I2cPort(const Object *parent, std::string port_name, std::string device)
Constructor.
unsigned long long Time
Time definition, in ns.
Definition: Object.h:55
void SetTxTimeout(Time timeout_ns)
Set TX timeout.
Base class for i2c port.
ssize_t Write(const void *buf, size_t nbyte)
Write datas.
int SetSlave(uint16_t address)
Set slave's address.
ssize_t Read(void *buf, size_t nbyte)
Read datas.
Base class for i2c port.
Definition: I2cPort.h:31
Class for unix serial port.
Definition: Unix_I2cPort.h:25
void SetRxTimeout(Time timeout_ns)
Set RX timeout.