https://github.com/eadf/esp8266_i2c_master
Drop in replacement for the IoT i2c_master driver
https://github.com/eadf/esp8266_i2c_master
Last synced: 8 months ago
JSON representation
Drop in replacement for the IoT i2c_master driver
- Host: GitHub
- URL: https://github.com/eadf/esp8266_i2c_master
- Owner: eadf
- License: lgpl-3.0
- Created: 2015-03-10T09:20:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-15T20:51:55.000Z (over 11 years ago)
- Last Synced: 2025-02-01T12:11:13.910Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 148 KB
- Stars: 7
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esp8266_i2c_master
Drop in replacement for the IoT demo ```i2c_master.c``` and ```i2c_master.h```
This implementation allows the I²C pins to be defined with **only** two #defines.
It also has easy to use convenience methods ```i2c_master_writeRegister()``` and ```i2c_master_readRegister()```.
To define the SDA and SCL pins you just add ```CFLAGS="-DI2C_MASTER_SDA_GPIO=2 -DI2C_MASTER_SCL_GPIO=12"``` (or whatever pin numbers you preffer), to your Makefile. Alternatively you can define them in ```user_config.h```
If no gpio pin numbers are assigned the default SDA=2, SCL=12 pins will be used.
TODO:
* ~~Testing~~ It passes the mcp23017 basic tests, but one can't test too much..
* ~~implement the added convenience methods ```i2c_master_writeRegister()``` and ```i2c_master_readRegister()```~~