Flair
Framework Libre Air
|
Class for real time i2c port using RTDM. More...
#include <RTDM_I2cPort.h>
Public Member Functions | |
RTDM_I2cPort (const Object *parent, std::string name, std::string device) | |
Constructor. More... | |
~RTDM_I2cPort () | |
Destructor. More... | |
int | SetSlave (uint16_t address) |
Set slave's address. More... | |
ssize_t | Write (const void *buf, size_t nbyte) |
Write datas. More... | |
ssize_t | Read (void *buf, size_t nbyte) |
Read datas. More... | |
void | SetRxTimeout (Time timeout_ns) |
Set RX timeout. More... | |
void | SetTxTimeout (Time timeout_ns) |
Set TX timeout. More... | |
Public Member Functions inherited from flair::core::I2cPort | |
I2cPort (const Object *parent, std::string name) | |
Constructor. More... | |
~I2cPort () | |
Destructor. More... | |
Public Member Functions inherited from flair::core::Mutex | |
Mutex (const Object *parent, std::string name="") | |
Constructor. More... | |
~Mutex () | |
Destructor. More... | |
void | GetMutex (void) const |
GetMutex. More... | |
void | ReleaseMutex (void) const |
ReleaseMutex. More... | |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Additional Inherited Members | |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Class for real time i2c port using RTDM.
Class for unix serial port.
This class can only be used with the real time version of Framework library.
flair::core::RTDM_I2cPort::RTDM_I2cPort | ( | const Object * | parent, |
std::string | name, | ||
std::string | device | ||
) |
Constructor.
Construct an RTDM i2c port, with the following default values:
parent | parent |
name | name |
device | i2c device (ex rti2c1) |
flair::core::RTDM_I2cPort::~RTDM_I2cPort | ( | ) |
Destructor.
|
virtual |
Set slave's address.
This method need to be called before any communication.
address | slave's address |
Implements flair::core::I2cPort.
|
virtual |
Write datas.
buf | pointer to datas |
nbyte | length of datas |
Implements flair::core::I2cPort.
|
virtual |
Read datas.
buf | pointer to datas |
nbyte | length of datas |
Implements flair::core::I2cPort.
|
virtual |
Set RX timeout.
Timeout for waiting an ACK from the slave.
timeout_ns | timeout in nano second |
Implements flair::core::I2cPort.
|
virtual |
Set TX timeout.
Timeout for waiting an ACK from the slave.
timeout_ns | timeout in nano second |
Implements flair::core::I2cPort.