pflib v3.0.0-rc1-29-g3a901ac
Pretty Fine HGCROC Interaction Library
All Classes Namespaces Files Functions Variables Typedefs Pages
I2C_Linux.h
1#ifndef PFLIB_I2C_Linux_H_
2#define PFLIB_I2C_Linux_H_
3
4#include <string>
5#include "pflib/I2C.h"
6
7namespace pflib {
8
13class I2C_Linux : public I2C {
14 public:
15 I2C_Linux(const std::string& devfile);
16
17 ~I2C_Linux();
18
22 virtual void set_bus_speed(int speed=100);
23
27 virtual int get_bus_speed();
28
33 void write_byte(uint8_t i2c_dev_addr, uint8_t data);
34
39 uint8_t read_byte(uint8_t i2c_dev_addr);
40
46 std::vector<uint8_t> general_write_read(uint8_t i2c_dev_addr, const std::vector<uint8_t>& wdata, int nread=0);
47
48 private:
49 int handle_;
50 std::string dev_;
51};
52
53
54
55}
56
57#endif // PFLIB_I2C_H_
Definition I2C_Linux.h:13
virtual void set_bus_speed(int speed=100)
Set the speed for the bus in kbps.
Definition I2C_Linux.cxx:25
uint8_t read_byte(uint8_t i2c_dev_addr)
Read a single byte using the efficient interface.
Definition I2C_Linux.cxx:56
virtual int get_bus_speed()
Get the speed for the bus in kbps.
Definition I2C_Linux.cxx:29
void write_byte(uint8_t i2c_dev_addr, uint8_t data)
Write a single byte using the efficient interface, and wait for completion.
Definition I2C_Linux.cxx:33
std::vector< uint8_t > general_write_read(uint8_t i2c_dev_addr, const std::vector< uint8_t > &wdata, int nread=0)
Carry out a write of zero or more bytes followed a by a read of zero or more bytes.
Definition I2C_Linux.cxx:71
Base class which encapsulates the I2C interface, represents a single bus.
Definition I2C.h:14
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3