|
7 | 7 | 
|
8 | 8 | 
|
9 | 9 |
|
10 |
| -The SparkFun Toolkit provides a common set of core functionality for use across the SparkFun Arduino Driver library. Instead of each device driver library implementing it's own communication layers, error types and design, the SparkFun Toolkit library is used. |
| 10 | +The SparkFun Toolkit provides a common set of core functionality for use across the spectrum of SparkFun developed embedded libraries and applications. It provides a well tested, extensively used, and abstract foundational layer of functionality to use across a wide-range of solutions. |
| 11 | + |
| 12 | +This, the first iteration of the SparkFun Toolkit focuses on device communication - namely the communication between a embedded microprocessor and a peripheral devices. Focusing on the *communication bus* aspect of embedded development, the toolkit simplifies system development by providing a proven bus implementation, as well as a set of abstract interfaces that enable rapid development of multi-bus type implementations. |
| 13 | + |
| 14 | +In addition to providing a set of common device bus communication functionality, the SparkFun Toolkit is structure to provide a *platform independent* solution. While the initial implementation targets Arduino development, the architecture is patterned to define a common core of functionality and interfaces that are platform agnostic. Use of the SparkFun Toolkit within a non-Arduino, c++ environment, requires the implementation of small set of platform specific functionality. |
11 | 15 |
|
12 | 16 | ## Motivation
|
13 | 17 |
|
14 |
| -Often, the same core functionality is implemented with a majority of our Arduino libraries, each implementation providing the same functionality, but implemented differently. The result is solutions that have different quirks, and impossible to maintain/support effectively. The SparkFun Toolkit solves this issue. |
| 18 | +Often, the same core functionality is implemented within a majority of our Arduino libraries, with each implementation providing the same functionality, but implemented differently. The result of this are different solutions that delivery the same functionality, but each have their unique quirks and behavior oddities. As this implementation patter expands, it becomes impossible to maintain/support effectively. |
| 19 | + |
| 20 | +An example of this is software libraries provided in support of the SparkFun qwiic ecosystem. With over 200 sensors, input devices and accessories, the implementation and maintenance of the driver communication layers are difficult burden that the SparkFun Toolkit addresses. |
| 21 | + |
| 22 | +## The SparkFun Toolkit |
15 | 23 |
|
16 | 24 | The SparkFun Toolkit provides a single implementation of common functionality used in the software developed for SparkFun boards. Initially targeted at the Arduino development environment, the SparkFun Toolkit delivers the following benefits:
|
17 | 25 |
|
18 | 26 | * Use a well-tested and validated implementation
|
19 | 27 | * Reduce development effort
|
20 | 28 | * Implement functionality following a common structure
|
| 29 | +* Designed following a platform independent architectural pattern |
21 | 30 | * Set the foundation for future enhancements - as the capabilities of the toolkit grow, these features become available with little to any implementation effort.
|
22 | 31 |
|
| 32 | +### General Architecture |
| 33 | + |
| 34 | +Implemented using C++, the SparkFun toolkit follows a simple two layered approach in it's design: A core foundational layer, and a platform specific layer. |
| 35 | + |
| 36 | +```mermaid |
| 37 | +--- |
| 38 | +title: General Architecture Structure |
| 39 | +--- |
| 40 | +classDiagram |
| 41 | + class CoreToolkit["Core Toolkit Interfaces"] |
| 42 | + class PlatformOne["Platform Implementation"] |
| 43 | + CoreToolkit <|-- PlatformOne |
| 44 | +
|
| 45 | +``` |
| 46 | +And as additional plaforms are added, they also implement/inherit from the SparkFun Toolkit Core. |
| 47 | +```mermaid |
| 48 | +--- |
| 49 | +title: Multi-Platform Structure |
| 50 | +--- |
| 51 | +classDiagram |
| 52 | + class CoreToolkit["Core Toolkit Interfaces"] |
| 53 | + class PlatformOne["Platform One"] |
| 54 | + class PlatformTwo["Platform Two"] |
| 55 | +
|
| 56 | + CoreToolkit <|-- PlatformOne |
| 57 | + CoreToolkit <|-- PlatformTwo |
| 58 | +``` |
| 59 | + |
| 60 | +When using the SparkFun Toolkit, the intent is for the implementation to follow the same pattern: A platform independent layer that works with the SparkFun Toolkit core, and a platform specific layer that utilizes the SparkFun Toolkit platform specific implementation. |
| 61 | + |
| 62 | +```mermaid |
| 63 | +--- |
| 64 | +title: Application Structure |
| 65 | +--- |
| 66 | +classDiagram |
| 67 | + direction TD |
| 68 | + note for ApplicationCore "Application Logic" |
| 69 | + class ApplicationCore["Application Core"] |
| 70 | + class CoreToolkit["Core Toolkit Interfaces"] |
| 71 | +
|
| 72 | + note for CoreToolkit "SparkFun Toolkit" |
| 73 | + class ApplicationPlatform["Application Platform"] |
| 74 | + style ApplicationPlatform fill:#909090 |
| 75 | + class PlatformOne["Platform Implementation"] |
| 76 | + style PlatformOne fill:#909090 |
| 77 | + |
| 78 | + CoreToolkit <|-- PlatformOne |
| 79 | + ApplicationCore <--> Application Platform |
| 80 | +
|
| 81 | +``` |
| 82 | + |
| 83 | +If/when the application is moved to another platform, just the platform specific logic needs implementation. |
| 84 | + |
23 | 85 | ## Documentation
|
24 | 86 |
|
25 |
| -The SparkFun Toolkit Development documentation is available [here](https://docs.sparkfun.com/SparkFun_Toolkit) |
| 87 | +The SparkFun Toolkit Development documentation is available [here](https://docs.sparkfun.com/SparkFun_Toolkit). This includes doxygen generated class/API documentation, as well as additional architectural details. |
| 88 | + |
| 89 | +## Examples |
| 90 | + |
| 91 | +The best way to understand and use the SparkFun Toolkit is to see it being used on other libraries. For our SparkFun developed libraries and firmware that use the SparkFun Toolkit, their associated github repositories are tagged with [sparkfun-toolkit](https://github.com/topics/sparkfun-toolkit) tag. |
| 92 | + |
26 | 93 |
|
27 | 94 | ## Installation and Use
|
28 | 95 |
|
29 | 96 | To use the SparkFun Toolkit directly, or in library development kit is installable via the Arduino Library Manager - search for `SparkFun ToolKit` within the Arduino Library Manager to install.
|
30 | 97 |
|
31 | 98 | However, for solutions that use the SparkFun Toolkit, it is installed automatically during the Arduino library installation process, by marking the Toolkit as a dependency when publishing your library.
|
32 | 99 |
|
33 |
| -To mark the `SparkFun Toolkit` as a dependency, add the following line to the `library.properties` file for your library. |
| 100 | +To mark the `SparkFun Toolkit` as a dependency, add the following line to the `library.properties` file for your library. |
34 | 101 |
|
35 | 102 | ```INI
|
36 |
| -depends=SparkFun Toolkit |
| 103 | +depends=SparkFun Toolkit (>=1.0.0) |
37 | 104 | ```
|
38 | 105 |
|
39 |
| -## Examples |
40 |
| - |
41 |
| -The following Arduino Libraries are making use of the SparkFun Toolkit: |
| 106 | +> [!NOTE] |
| 107 | +> A version indicator is included to ensure your library uses the correct version of the toolkit. |
42 | 108 |
|
43 |
| -* [SparkFun Qwiic Pulsed Coherent Radar Sensor XM125](https://github.com/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library) |
44 |
| -* [SparkFun Qwiic AS7331 Spectral UV Sensor](https://github.com/sparkfun/SparkFun_AS7331_Arduino_Library) |
|
0 commit comments