You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Introduction
2
2
3
-
I2Cwrapper is a generic modular framework for **Arduino I2C target devices**<sup>(1)</sup> which runs on standard Arduinos, ESP8266, ESP32, and ATtiny platforms (see [supported platforms](#supported-platforms)). It allows you to easily control devices attached to the target or the target's own hardware via I2C. Typically, you can use it to **integrate peripherals without dedicated I2C interface** in an I2C-bus environment.
3
+
I2Cwrapper is a generic modular framework for **Arduino I2C target devices**<sup>(1)</sup> which runs on standard Arduinos, ESP8266, ESP32, SAMD, and ATtiny platforms (see [supported platforms](#supported-platforms)). It allows you to easily control devices attached to the target or the target's own hardware via I2C. Typically, you can use it to **integrate peripherals without dedicated I2C interface** in an I2C-bus environment.
4
4
5
5
The **I2Cwrapper core** consists of an easily extensible firmware framework and a controller library. Together, they **take care of the overhead** necessary for implementing an I2C target device, while the actual target functionality is delegated to device-specific **modules**.
6
6
@@ -286,11 +286,12 @@ All transmissions to the target device have a **three byte header** followed by
286
286
-[0]**CRC8 checksum**
287
287
-[1]**command code**: Modules and the I2Cwrapper core use their own unique command code ranges (see [Limitations for end users](#limitations-for-end-users), though), so that the command code will decide which module or if the I2Cwrapper library itself will interpret the command.
288
288
-[3]**unit addressed**: If a target module enables I2C access to more than one instance of some hardware, e.g. multiple stepper or servo motors, the unit can be used to differentiate them. It is up to each module to decide if and how the unit is interpreted. Modules which don't need them because there is only one instance of their respective hardware (like e.g. the `PinI2C` module), can just ignore the unit and will have to live with the one byte wasted bandwidth per transmission.
289
-
<aid="supported-platforms"></a>
290
289
### Module reset code
291
290
292
291
Since v0.3.0 dropped the hardware reset (it's considered bad practice), each module now needs to provide proper **cleanup code** in the (6) reset event section. This code needs to free all allocated resources and reset all hardware used by the module. The goal is to put all resources used by the module, and only(!) those, into the state they were after bootup, so that a controller can make sure it finds a clean slate when it starts to use the target by sending a reset command.
293
292
293
+
<aid="supported-platforms"></a>
294
+
294
295
# Supported platforms
295
296
296
297
The following platforms will run the target firmware and have been (more or less) tested. Unfortunately, they all have their pros and cons:
@@ -313,6 +314,8 @@ Depending on the specific model, ATtinys can have software only I2C, full hardwa
313
314
314
315
Using ATTinyCore, I2Cwrapper firmware has been successfully tested on ATtiny85 (Digispark) and ATtiny88 (MH-ET-live) boards. Mileage with the available firmware modules may vary, though. Currently, only Pinl2C and TM1638liteI2C will run without changes. See the respective comment sections in the [Pin_Control.ino](https://github.com/ftjuh/I2Cwrapper/blob/main/examples/Pin_control/Pin_control.ino) and [TM1638lite.ino](https://github.com/ftjuh/I2Cwrapper/blob/main/examples/TM1638lite/TM1638lite.ino) examples for testing purposes. Of course, ATtinys are relatively slow and have limited memory. The firmware alone, without any modules enabled, currently uses 44% of a Digispark's usable 6586 bytes of flash memory, with the PinI2C module enabled it's 54%.
315
316
317
+
<aid="samd21-samd51"></a>
318
+
316
319
### SAMD21, SAMD51
317
320
318
321
Arduino compatible SAMD21 and SAMD51 boards come in many variations: there are whole familities of the chips themselves, and many physical boards. Arduino made the original Zero, Adafruit sells a variety using the "Express" label ("M0" and "M4"), and many other manufacturers make them. The spec sheets say that all SAMD21 and SAMD51 chips have hardware I2C.
@@ -466,14 +469,19 @@ void loopClassic()
466
469
-~~Move I2C-address options (fixed, EEPROM, hardware pins) to modules~~
467
470
-~~Attiny support (memory will be an issue, though)~~
468
471
469
-
# Author
472
+
# Authors
470
473
471
-
Apart from its predecessor AccelStepperI2C, this is my first "serious" piece of software published on github. Although I've some background in programming, mostly in the Wirth-tradition languages, I'm far from being a competent or even avid c++ programmer. At the same time I have a tendency to over-engineer (not a good combination), so be warned and use this at your own risk. My current main interest is nor in programming, but in 3D printing, you can find me on [prusaprinters](https://www.prusaprinters.org/social/202816-juh/about), [thingiverse](https://www.thingiverse.com/juh/designs), and [youmagine](https://www.youmagine.com/juh3d/designs). This library first saw the light of day as part of my [StepFish project](https://www.prusaprinters.org/prints/115049-stepfish-fischertechnik-i2c-stepper-motor-controll) ([also here](https://forum.ftcommunity.de/viewtopic.php?t=5341)).
474
+
Apart from its predecessor AccelStepperI2C, this is my first "serious" piece of software published on github. Although I've some background in programming, mostly in the Wirth-tradition languages, I'm far from being a competent or even avid c++ programmer. At the same time I have a tendency to over-engineer (not a good combination), so be warned and use this at your own risk. My current main interest is nor in programming, but in 3D printing, you can find <u>me</u> on [prusaprinters](https://www.prusaprinters.org/social/202816-juh/about), [thingiverse](https://www.thingiverse.com/juh/designs), and [youmagine](https://www.youmagine.com/juh3d/designs). This library first saw the light of day as part of my [StepFish project](https://www.prusaprinters.org/prints/115049-stepfish-fischertechnik-i2c-stepper-motor-controll) ([also here](https://forum.ftcommunity.de/viewtopic.php?t=5341)).
472
475
473
476
Contact me at ftjuh@posteo.net.
474
477
475
478
Jan (juh)
476
479
480
+
### Contributors
481
+
482
+
*[CNCv4 example](https://github.com/ftjuh/I2Cwrapper/blob/main/examples/CNCv4_Board_3_Steppers/CNCv4_Board_3_Steppers.ino) by [WhizzBizz The-Online-Developer](https://github.com/The-Online-Developer)
483
+
*[SAMD support](#samd21-samd51) by [awgrover](https://github.com/awgrover)
484
+
477
485
# Copyright
478
486
479
487
This software is Copyright (C) 2022 juh (ftjuh@posteo.net)
0 commit comments