Skip to content

Commit 70a1a99

Browse files
authored
Merge pull request #32 from sparkfun/feature/toolkit-documentation
Feature/toolkit documentation
2 parents 7634361 + 91da3f0 commit 70a1a99

File tree

17 files changed

+3424
-335
lines changed

17 files changed

+3424
-335
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# VSCode directories
22
.vscode
33

4+
5+
docs/html/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "docs/doxygen/doxygen-awesome-css"]
2+
path = docs/doxygen/doxygen-awesome-css
3+
url = https://github.com/jothepro/doxygen-awesome-css.git

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,38 @@
55
![GitHub release (with filter)](https://img.shields.io/github/v/release/sparkfun/SparkFun_Toolkit)
66
![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/sparkfun/SparkFun_Toolkit)
77

8+
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.
89

10+
## Motivation
911

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.
12+
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.
1113

12-
By using the SparkFun Toolkit, Arduino drivers achieve the following benefits:
14+
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:
1315

1416
* Use a well-tested and validated implementation
1517
* Reduce development effort
1618
* Implement functionality following a common structure
1719
* Set the foundation for future enhancements - as the capabilities of the toolkit grow, these features become available with little to any implementation effort.
1820

19-
## Current Status
21+
## Documentation
22+
23+
The SparkFun Toolkit Development documentation is available [here](https://docs.sparkfun.com/SparkFun_Toolkit)
24+
25+
## Installation and Use
26+
27+
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.
28+
29+
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.
30+
31+
To mark the `SparkFun Toolkit` as a dependency, add the following line to the `library.properties` file for your library.
2032

21-
### December 2023
33+
```INI
34+
depends=SparkFun Toolkit
35+
```
2236

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.
37+
## Examples
2438

25-
### Documentation
39+
The following Arduino Libraries are making use of the SparkFun Toolkit:
2640

27-
|||
28-
|---|---|
29-
|[Bus Implementation](docs/ar_ibus.md) | The architecture and use of the Toolkit Communication Bus Interface
41+
* [SparkFun Qwiic Pulsed Coherent Radar Sensor XM125](https://github.com/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library)
42+
* [SparkFun Qwiic AS7331 Spectral UV Sensor](https://github.com/sparkfun/SparkFun_AS7331_Arduino_Library)

docs/ar_ibus.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Overview - Device Bus Interface - sfeTkIBus
1+
# Device Bus Interface - Overview
22

33
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.
44

55
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.
66

7-
### The Bus Interface Design Pattern
7+
## The Bus Interface Design Pattern
88

99
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.
1010

@@ -35,9 +35,9 @@ The key class to support this pattern are:
3535

3636
| | |
3737
|------|-------|
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 |
4141

4242
### The sfeTkIBus Interface
4343

@@ -47,12 +47,12 @@ The interface methods:
4747

4848
| Method| Definition |
4949
|------|-------|
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 |
5656

5757
> [!NOTE]
5858
> 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
6767

6868
| Method| Definition |
6969
|------|-------|
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 |
7373

7474
> [!NOTE]
7575
> 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
8484

8585
| Method| Definition |
8686
|------|-------|
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 |
8989

9090
> [!NOTE]
9191
> The ```sfeTkISPI``` class manages CS Pin for the SPI bus. As such, each SPI device instantiates/uses an instance of the ```sfeTkISPI``` class.

docs/doxygen/doxygen-awesome-css

Submodule doxygen-awesome-css added at 9f97817

0 commit comments

Comments
 (0)