RE: I2C Access with 5CSX Development Board » i2cdevice.h
1 |
#ifndef I2CDEVICE_H
|
---|---|
2 |
#define I2CDEVICE_H
|
3 |
|
4 |
namespace MityDSP |
5 |
{
|
6 |
|
7 |
class tcI2CDevice |
8 |
{
|
9 |
public:
|
10 |
static const int gnBaseErr = -1000; |
11 |
static const int gnBaseDevErr = -1100; |
12 |
|
13 |
tcI2CDevice(int bus, int slave_addr); |
14 |
virtual ~tcI2CDevice(void); |
15 |
|
16 |
virtual int Open(void); |
17 |
virtual int Close(void); |
18 |
virtual const char* GetError(int err); |
19 |
int Bus() const { return mnBus; } |
20 |
int Addr() const { return mnAddr; } |
21 |
|
22 |
protected:
|
23 |
int mnFd; |
24 |
int mnBus; |
25 |
int mnAddr; |
26 |
|
27 |
};
|
28 |
|
29 |
};
|
30 |
|
31 |
#endif
|