todbot / softi2cmaster Goto Github PK
View Code? Open in Web Editor NEWSoftware I2C / TWI library for Arduino allows any two pins to be SDA & SCL
Home Page: http://todbot.com/blog/
License: Other
Software I2C / TWI library for Arduino allows any two pins to be SDA & SCL
Home Page: http://todbot.com/blog/
License: Other
SoftI2CMaster 2010-2012, Tod E. Kurt, http://todbot.com/blog/ 2014, by Testato: update library and examples for follow Wire’s API of Arduino IDE 1.x SoftI2CMaster is an Arduino library that implements a simple "bit-bang" software-only I2C (aka "TWI") Master. This lets you use any two Arduino pins to be the SDA & SCL pins needed to communicate with I2C devices like BlinkMs. SoftI2CMaster was originally in the BlinkMSoftI2CDemo example in http://code.google.com/p/blinkm-projects/
It is my understanding that CC-BY-SA 3.0 is not compatible with LGPL & GPL code and that
CC-BY-SA 4.0 was created to address this.
Overall, it looks very tricky to comply with CC-BY-SA licensing given that there is so much LGPL and GPL code that will likely be linked into a given Arduino project that might also use this library.
Would you consider modifying your license to CC-BY-SA 4.0 or LGPL or GPL ?
If the goal is to ensure that the source always remains open source then GPL v3 will ensure that.
Here is more on the subject.
In terms of mixing s/w with different licenses,
there appears to be license compatibility issues when trying to mix CC BY-SA code
with LGPL or GPL code.
From these links:
https://creativecommons.org/compatiblelicenses/
https://wiki.creativecommons.org/wiki/ShareAlike_compatibility:_GPLv3
https://wiki.creativecommons.org/wiki/ShareAlike_compatibility_process_and_criteria
It appears that CC BY-SA 3.0 is only compatible with itself and cannot be used/linked
with LGPL or GPL code.
CC BY-SA 4.0 was created to allow merging & linking CC BY-SA code with LGPL/GPL code and in particular GPLv3.
However, if BY-SA 4.0 code is linked with LGPL or GPL code, the overall work is
licensed based on the other code license (LGPL or GPL).
i.e. if you compile and link CC BY-SA 4.0 code with LGPL 2.1 the entire project
(including the CC BY-SA 4.0 code) will be licensed as LGPL 2.1
i.e. the CC BY-SA 4.0 code converts to LGPL 2.1 for that project.
Likewise when linked against GPLv3, it becomes GPLv3 code.
Essentially it looks like CC BY-SA code is incompatible with LGPL & GPL code and the only way to use CC BY-SA code with LGPL/GPL code is to use CC BY-SA 4.0 and to use the one way convert clause to convert it to LGPL/GPL for the specific project at which point the code in that specific project is no longer CC BY-SA 4.0 and so any improvements/derivatives made to that code by someone else within that project are now LGPL/GPL and cannot go back into the original CC BY-SA 4.0 version of the code.
The person is free to contribute the changes back to the CC BY-SA 4.0 code parent instead to put the changes back into the CC BY-SA code, but it is not a requirement.
Overall, it looks like CC BY-SA licensing is very difficult to work with for s/w, and in particular for s/w that is linking against LGPL and/or GPL code.
In other words, it looks to me like CC BY-SA is a license that was intended for standalone "blobs" that do not incorporate other components, and in particular components that have a different license.
In the case of s/w library, that isn't the case.
would be great to have
See #11
(just to reopen the issue)
Thanks
Does read work as well? What is the maximum transmission speed that can be achieved?
I tried to use this library with BME280 from bosch using Arduino Mini and has errors if you read more that 1 byte. For 1 byte read is working fine.
beginTransmission(bmeI2CAddress);
write(0x8E); // Pressure calibration register 2 bytes to read
endTransmission();
requestFrom(bmeI2CAddress, 2);
byte p0 = read();
byte p1 = read();
Here is result of p0 and p1 using arduino Wire
0xDC 0x94
Here is result of p0 and p1 using I2Cmaster
0xDC 0xFF
I noticed that everything that is read after first read() I got FF .
I tried also with readLast() but same faulty data I got.
Any workaround is really appreciated.
This would give more visibility to your job.
Thanks
In SoftI2CMaster::i2c_repstart there is a call of "i2c_scl_hi" (line 253) followed by "i2c_scl_lo" (line 255) without any delay. So, just for clarification I guess the first call is redundant?
Last version of the library does not compile ( even the example files ) in Arduino versions 1.6.8 & 1.6.9 & 1.6.10 on Linux with following error messages:
ass_i2c_wait_scl_high' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_wait_scl_high' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_wait_scl_high' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_wait_scl_high' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_wait_scl_high' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_wait_scl_high' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section .text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_wait_scl_high' referenced in section .text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section
.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
ass_i2c_delay_half' referenced in section
.text' of /tmp/ccgkvNNs.ltrans0.ltrans.o: defined in discarded section `.text' of sketch/BMA020Soft.ino.cpp.o (symbol from plugin)
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
Hi,
I am looking to support this library with all the flavours of driving LCDs that is currently supported in the New LiquidCrystal library: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
I am currently supporting it and requesting users to download from here. I was hoping that I could integrate it as part of the distribution of the New LiquidCrystal library but I haven't found the licensing terms of your source code. The distribution would be with your files completely untouched and indeed mention its usage and link to this repo in its wiki.
Please share your thoughts.
Best regards,
fm
Hi, tod!
I'm Kenny Kim from South Korea.
I found a case that SDA is still high before call of the i2c_stop().
In that case, the i2c stop condition does not meet, and any further commands after endTransmission() don't work. To meet the STOP condition: SDA should be low before doing stop.
Need to insert i2c_sda_lo() into the i2c_stop() function like this:
268 // Send a STOP Condition
269 //
270 void SoftI2CMaster::i2c_stop(void)
271 {
272 // To meet the STOP condition: SDA should be low before doing stop.
273 i2c_sda_lo(); // makes sda low surely.
274 i2c_scl_hi();
275 _delay_us(i2cbitdelay);
276
277 i2c_sda_hi();
278 _delay_us(i2cbitdelay);
279 }
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.