I2C.getBitrate() would be nice #5192
Replies: 1 comment
-
Posted at 2016-01-18 by @gfwilliams The default bitrate is actually 50000 (at least on proper Espruino boards)... Which one are you using? You can check
This could be built into Espruino itself as a function - but then you'd have to wait for the next version before your code would work. Posted at 2016-01-18 by luwar
Good to know. I thought the default bitrate were higher. I'm using a classic and different pico boards. So it is unnecessary in my case to check the bitrate if nobody increase it explicitly. Ok, thanks. Posted at 2016-01-19 by @gfwilliams There is an issue open for this (not specifically on I2C): espruino/Espruino#119 I've just linked this forum post. I'll have a think about a nice way of doing it - the thing really is finding a way of doing it that uses up very little memory. Some of the boards without much flash have a lot of trouble getting Espruino in at the moment (literally ~300 bytes free or so) - normally I'd just not include non-vital functions on those boards - but with something like this, modules that used the function would just refuse to work of the function didn't exist. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-01-17 by luwar
Currently I'm developing an Espruino module for an I2C sensor which is not able to run with the default bitrate of 400 kHz.
I want to ensure that nobody fall into the same trap to forget the bitrate parameter in I2C.setup(). I know: "Read the datasheet carefully ...". But better would be an automatic check with a human readable hint about the wrong usage.
Is it possible to get the bitrate of an I2C instance to check the correct usage in the connect()-methods or directly in the constructor function of i2c-sensors, e.g.
Beta Was this translation helpful? Give feedback.
All reactions