smfsw / wirewrapper Goto Github PK
View Code? Open in Web Editor NEWArduino Wrapper for Wire library (for SAM, ESP8266...)
License: MIT License
Arduino Wrapper for Wire library (for SAM, ESP8266...)
License: MIT License
In the function "I2C_rd()", there is a Wire.endTransmission() after the Wire.requestFrom(). That Wire.endTransmission() can be removed.
Explanation: Common-mistakes#2
Is the I2C_is_busy() for using the library in a interrupt ? I think that using the Wire library in a interrupt is already a bug on its own.
You use a repeated start between setting the register address and reading data. Every modern sensor should support that, but maybe there are somewhere I2C devices that don't like it.
A delay of 5 ms is a long time between the retries. I think that 1 ms is more than enough for every situation.
Are the retries an extra safety feature ? Do you keep track if that is really useful ? Maybe an Arduino as a Slave with a bad sketch can use it. When the I2C bus has noise or other troubles, those retries can not fix such I2C bus troubles.
When the Slave is an Arduino (with a bad sketch) a delay between writing the register address and requesting data is more helpful than retries.
Hello
Can i use this library for slave?
thank
hello,
why do you call 400 kHz Low Speed?
I2C_init(I2C_LOW); // init with low speed (400KHz)
the common definitions for i2c bus speed are the following:
Standard Mode (Sm) 100 kbit/s bidirektional
Fast Mode (Fm) 400 kbit/s bidirektional
Fast Mode Plus (Fm+) 1,0 Mbit/s bidirektional
High Speed Mode (Hs-mode) 3,4 Mbit/s bidirektional
Ultra Fast-mode (UFm) 5,0 Mbit/s unidirektional
so low speed should be used just for clock speed slower than standard,
400 kHz should be called I2C_FAST
and
100 kHz should be called I2C_STD
OTOH.
if there once sth like 9.6 kHz would be provided or needed, then you might call that I2C_LOW instead
Hello and thanks for providing this library. I had tried writing a wrapper for Wire with no luck :) I need to use is in the C header of another library (not main Arduino sketch).
I am no expert sorry if I ask a basic question:
I didn't understand how FRAM in examples is initialized. Is there any other definition that should be added for specific hardware? If I want to use it with an analog front end device, with slave address 0x5B, what would be the effect of writing:
I2C_SLAVE AFE ;
and then giving reference &AFE in initialization step?
Also, I see ci2c in most of the lines. Is it applicable to Samd21 cortex M0+ on MKR1000 boards?
Thanks again!
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.