stevemarple / SoftWire

Software I2C implementation for Arduino and other Wiring-type environments
GNU Lesser General Public License v2.1
144 stars 30 forks source link

setSclLow in the example and setSetSclLow in the include file. #13

Closed benkokes closed 4 years ago

benkokes commented 4 years ago

I suppose this is a find-replace issue? or are the double 'set' words intentional?

stevemarple commented 4 years ago

It is intentional and correct.

The normal operation of the library is to use the Arduino digitalWrite() function to drive SDA/SCL low, and then pinMode(pin, INPUT) to allow the lines to relax upwards. If there is a reason why you need low-level control of the SCL and SDA pins (for speed, or maybe you are using an IO expander) then it is possible to provide functions which are used to set SDA/SCL high/low.

setSetSclLow() takes a function pointer and is one of the four "setter" functions used to configure your own pin control functions. Two more setter functions override the methods used to read the SDA and SCL lines.