https://github.com/einararnason/i2clinux
I2C implementation for Linux
https://github.com/einararnason/i2clinux
cpp i2c linux
Last synced: about 2 months ago
JSON representation
I2C implementation for Linux
- Host: GitHub
- URL: https://github.com/einararnason/i2clinux
- Owner: EinarArnason
- License: mit
- Created: 2020-04-18T17:10:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-10T20:14:38.000Z (almost 4 years ago)
- Last Synced: 2024-04-13T15:32:41.790Z (about 1 year ago)
- Topics: cpp, i2c, linux
- Language: C++
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# I2Clinux library
I2C implementation for Linux
## The What
This library is a Linux implementation for I2C controllers.
## The Why
Because this library inherits the I2C interface, it can be applied in a modular manner.
## The How
### Building
#### Using cmake
```cmake
add_subdirectory(${I2ClinuxDir})
target_link_libraries(${PROJECT_NAME} I2Clinux)
```### Usage
Typical operation:
```c++
#include "I2Clinux.h"I2C::Config i2cConfig(0x00, 100000);
I2Clinux i2c("/dev/i2c-1", i2cConfig.address);
i2c.init();char data[1] = 0xAA;
i2c.send(i2cConfig, data, sizeof(data));
i2c.receive(i2cConfig, data, sizeof(data));
```## The Who
Einar Arnason