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
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.
8
10
11
+
## Motivation
9
12
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.
13
+
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.
11
14
12
-
By using the SparkFun Toolkit, Arduino drivers achieve the following benefits:
15
+
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:
13
16
14
17
* Use a well-tested and validated implementation
15
18
* Reduce development effort
16
19
* Implement functionality following a common structure
17
20
* Set the foundation for future enhancements - as the capabilities of the toolkit grow, these features become available with little to any implementation effort.
18
21
19
-
## Current Status
22
+
## Documentation
23
+
24
+
The SparkFun Toolkit Development documentation is available [here](https://docs.sparkfun.com/SparkFun_Toolkit)
25
+
26
+
## Installation and Use
27
+
28
+
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.
29
+
30
+
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.
31
+
32
+
To mark the `SparkFun Toolkit` as a dependency, add the following line to the `library.properties` file for your library.
20
33
21
-
### December 2023
34
+
```INI
35
+
depends=SparkFun Toolkit
36
+
```
22
37
23
-
The SparkFun Toolkit is available as a *Beta* release, with the intent of testing and validation by SparkFun. The community are free to use this toolkit with the understanding that interfaces, types and class structures could change.
38
+
## Examples
24
39
25
-
### Documentation
40
+
The following Arduino Libraries are making use of the SparkFun Toolkit:
26
41
27
-
|||
28
-
|---|---|
29
-
|[Bus Implementation](docs/ar_ibus.md) | The architecture and use of the Toolkit Communication Bus Interface
Copy file name to clipboardExpand all lines: docs/ar_ibus.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Overview - Device Bus Interface - sfeTkIBus
1
+
# Device Bus Interface - Overview
2
2
3
3
One of the foundational capabilities of the SparkFun Toolkit is bus communication with devices. This is a common task almost all libraries implement using their own implementation for I2C, SPI or UART bus communication.
4
4
5
5
For bus communication, the SparkFun Toolkit is designed to provide a common implementation for use across all SparkFun libraries. Additionally, the bus architecture is modeled on a *driver* pattern, separating the individual bus setup/configuration from data communication, enabling a single device implementation to easily support a variety of device bus types.
6
6
7
-
###The Bus Interface Design Pattern
7
+
## The Bus Interface Design Pattern
8
8
9
9
This pattern allows an application to develop against the common bus interface without regard to the underlying bus type or implementation. This *plug-in* nature of this model enables core application reuse across a range of bus devices. What to use a different bus type? Just use a different driver.
10
10
@@ -35,9 +35,9 @@ The key class to support this pattern are:
35
35
36
36
|||
37
37
|------|-------|
38
-
**sfeTkIBus** | A virtual C++ class that device the bus ```sfeTkIBus``` interface |
39
-
**sfeTkII2C** | Sub-class of the ```sfeTkIIBus``` interface, it provides an interface for I2C devices|
40
-
**sfeTkISPI** | Sub-class of the ```sfeTkIIBus``` interface, it provides an interface for SPI devices |
38
+
|**sfeTkIBus**| A virtual C++ class that device the bus ```sfeTkIBus``` interface |
39
+
|**sfeTkII2C**| Sub-class of the ```sfeTkIIBus``` interface, it provides an interface for I2C devices|
40
+
|**sfeTkISPI**| Sub-class of the ```sfeTkIIBus``` interface, it provides an interface for SPI devices |
41
41
42
42
### The sfeTkIBus Interface
43
43
@@ -47,12 +47,12 @@ The interface methods:
47
47
48
48
| Method| Definition |
49
49
|------|-------|
50
-
**writeRegisterByte** | Write a byte of data to a particular register of a device |
51
-
**writeRegisterWord** | Write a word of data to a particular register of a device |
52
-
**writeRegisterRegion** | Write an array of data to a particular register of a device|
53
-
**readRegisterByte** | Read a byte of data from a particular register of a device |
54
-
**readRegisterWord** | Read a word of data from a particular register of a device |
55
-
**readRegisterRegion** | Read an array of data from a particular register of a device |
50
+
|**writeRegisterByte**| Write a byte of data to a particular register of a device |
51
+
|**writeRegisterWord**| Write a word of data to a particular register of a device |
52
+
|**writeRegisterRegion**| Write an array of data to a particular register of a device|
53
+
|**readRegisterByte**| Read a byte of data from a particular register of a device |
54
+
|**readRegisterWord**| Read a word of data from a particular register of a device |
55
+
|**readRegisterRegion**| Read an array of data from a particular register of a device |
56
56
57
57
> [!NOTE]
58
58
> This interface only defines the methods to read and write data on the given bus. Any address, or bus specific settings is provided/implemented by the implementation/specialization of this interface.
@@ -67,9 +67,9 @@ This class sub-classes from the ```sfeTkIBus``` interface adding additional func
67
67
68
68
| Method| Definition |
69
69
|------|-------|
70
-
**ping** | Determine if a devices is connected to the I2C device at the address set on this bus object. This is an interface method |
71
-
**setAddress** | Set the I2C address to use for this I2C object |
72
-
**address** | Returns the address used by this I2C object |
70
+
|**ping**| Determine if a devices is connected to the I2C device at the address set on this bus object. This is an interface method |
71
+
|**setAddress**| Set the I2C address to use for this I2C object |
72
+
|**address**| Returns the address used by this I2C object |
73
73
74
74
> [!NOTE]
75
75
> The ```sfeTkII2C``` class manages the device address for the I2C bus. As such, each I2C device instantiates/uses an instance of the ```sfeTkII2C``` class.
@@ -84,8 +84,8 @@ This class sub-classes from the ```sfeTkIBus``` interface adding additional func
84
84
85
85
| Method| Definition |
86
86
|------|-------|
87
-
**setCS** | Set the CS Pin to use for this SPI object |
88
-
**cs** | Returns the CS Pin used by this SPI object |
87
+
|**setCS**| Set the CS Pin to use for this SPI object |
88
+
|**cs**| Returns the CS Pin used by this SPI object |
89
89
90
90
> [!NOTE]
91
91
> The ```sfeTkISPI``` class manages CS Pin for the SPI bus. As such, each SPI device instantiates/uses an instance of the ```sfeTkISPI``` class.
0 commit comments