Skip to content

Commit 812797a

Browse files
committed
latest updates for the docs - looking at markdown needs/uses
1 parent d45f5bf commit 812797a

File tree

6 files changed

+67
-66
lines changed

6 files changed

+67
-66
lines changed

docs/ar_autoload.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ The key classes to support this pattern are:
1818

1919
| | |
2020
|------|-------|
21-
**Device Driver** | The device specific driver, often implemented based on an existing Arduino Library |
22-
**Device Builder** | A device specific class that is automatically generated and used by the Framework to detect and instantiate a device
23-
**Device Factory** | An overall singleton within the system that enables device registration at startup and device discovery, instantiation and initialization at runtime
21+
|**Device Driver** | The device specific driver, often implemented based on an existing Arduino Library |
22+
|**Device Builder** | A device specific class that is automatically generated and used by the Framework to detect and instantiate a device |
23+
|**Device Factory** | An overall singleton within the system that enables device registration at startup and device discovery, instantiation and initialization at runtime|
2424

2525
### Device Class
2626

@@ -36,38 +36,38 @@ The class hierarchy for the Device class is outlined in the following diagram:
3636

3737
The following **static** methods form the device discovery interface:
3838

39-
|||
40-
|----|---|
41-
```isConnected()``` | Called with an I2C bus object - should return true of the device is connected
42-
```connectedConfidence()``` | Returns a confidence level to indicate the accuracy of the ```isConnected()``` algorithm used. Helpful when resolving device address conflicts
43-
```getDeviceName()``` | Returns the name of the device - should be a static constant
44-
```getDefaultAddress()``` | Returns the default I2C address for the device. *This method is deprecated*
45-
```getDefaultAddresses()``` | Returns a list of I2C addresses the device can use. The first address should be the default address for the device. This array is terminated with the value ```kSparkDeviceAddressNull```
39+
| | |
40+
|----|----|
41+
|```isConnected()``` | Called with an I2C bus object - should return true of the device is connected|
42+
|```connectedConfidence()``` | Returns a confidence level to indicate the accuracy of the ```isConnected()``` algorithm used. Helpful when resolving device address conflicts|
43+
|```getDeviceName()``` | Returns the name of the device - should be a static constant|
44+
|```getDefaultAddress()``` | Returns the default I2C address for the device. *This method is deprecated*|
45+
|```getDefaultAddresses()``` | Returns a list of I2C addresses the device can use. The first address should be the default address for the device. This array is terminated with the value ```kSparkDeviceAddressNull```|
4646

4747
#### Instance Methods
4848

4949
For the startup sequence the following instance methods are important
50-
|||
50+
| | |
5151
|------|--------|
52-
```onInitialize()``` | Called during the initialization process allowing the performance of the driver specific startup sequence. The Arduino TwoWire (Wire) object is passed in for use by the driver. Note: to get the address to use for the device, the driver calls the ```address()``` method.
53-
```address()``` | Inherited - this method returns the address for the attached device
54-
```isInitialized()``` | Returns true of the method ```onInitialized()``` returned true - indicating the driver is initialized.
52+
|```onInitialize()``` | Called during the initialization process allowing the performance of the driver specific startup sequence. The Arduino TwoWire (Wire) object is passed in for use by the driver. Note: to get the address to use for the device, the driver calls the ```address()``` method.|
53+
|```address()``` | Inherited - this method returns the address for the attached device|
54+
|```isInitialized()``` | Returns true of the method ```onInitialized()``` returned true - indicating the driver is initialized.|
5555

5656
### Device Builder Class
5757

5858
This class provides a common interface for the Factory class to use during the discovery and instantiation phase of device creation. The class is defined as a template, with the only template parameter being the class name of the Driver it represents.
5959

6060
The template definition for the ```DeviceBuilder``` class:
6161

62-
```c++
62+
```cpp
6363
template <class DeviceType> class DeviceBuilder : public flxDeviceBuilderI2C
6464
```
6565
6666
For the most part, all the methods in this class just wrap the *introspection* methods provided by the underlying Device class it represents. This allows allows the Factory class to work with object instances that bridge calls to the *static* methods of a Device object.
6767
6868
Example of a wrapped method in the ```DeviceBuilder``` template:
6969
70-
```C++
70+
```cpp
7171
bool isConnected(flxBusI2C &i2cDriver, uint8_t address)
7272
{
7373
return DeviceType::isConnected(i2cDriver, address);
@@ -82,7 +82,7 @@ In the implementation file of each device driver, a static ```global``` instance
8282

8383
The definition of the ```DeviceBuilder``` constructor:
8484

85-
```C++
85+
```cpp
8686
DeviceBuilder()
8787
{
8888
flxDeviceFactory::get().registerDevice(this);
@@ -95,19 +95,19 @@ The Flux Factory class ```flxDeviceFactory``` is a *singleton*, and globally acc
9595

9696
To register a device driver, a static ```DeviceBuilder``` is added to the drivers implementation file.
9797

98-
```C++
98+
```cpp
9999
static DeviceBuilder<kDevice> global_##kDevice##Builder;
100100
```
101101

102102
But to make this easier, the following macro is defined.
103103

104-
```C++
104+
```cpp
105105
#define flxRegisterDevice(kDevice) static DeviceBuilder<kDevice> global_##kDevice##Builder;
106106
```
107107
108108
Using this macro, device registration looks like the following (using the BME280 driver)
109109
110-
```C++
110+
```cpp
111111
flxRegisterDevice(flxDevBME280);
112112
```
113113

docs/dev_developing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Framework Development {#framework_development}
2+
3+
* @subpage properties_overview
4+
* @subpage parameters_overview

docs/device_writing.md

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ The new device class should subclass from the frameworks ```flxDevice``` class,
1919

2020
> Note - In some cases, because of the underlying Arduino Library design, an alternative > implementation pattern is required - such as object containment.
2121
22-
##### Example of a class definition
22+
### Example of a class definition
2323

2424
Implementing a driver for the `BME280` Device.
2525

26-
```C++
26+
```cpp
2727
class flxDevBME280 : public flxDeviceI2CType<flxDevBME280>, public BME280
2828
{
2929

@@ -38,12 +38,12 @@ To accomplish this task, class level (static) methods and data are implemented b
3838
3939
|Item | Description|
4040
|----|--|
41-
```bool isConnected(flxBusI2C, address)``` | Returns true if the device is connected |
42-
```char* getDeviceName()``` | Returns the Device Name |
41+
| ```bool isConnected(flxBusI2C, address)``` | Returns true if the device is connected |
42+
| ```char* getDeviceName()``` | Returns the Device Name |
4343
|```uint8_t *getDefaultAddresses()``` | Return a list of addresses for the device. This list terminates with the value of ```kSparkDeviceAddressNull``` |
4444
|```flxDeviceConfidence_t connectedConfidence()``` | Returns the confidence level of the drivers ```isConnected()``` algorithm. Values supported range from *Exact* to *Ping* |
4545
46-
Note
46+
> [!note]
4747
>
4848
>* Often the device implements the address list as a class level variable
4949
>* It is common to define a constant or macro for the device name and return it from ```getDeviceName()```
@@ -56,9 +56,9 @@ The first step for a given driver is the retrieval of default addresses for the
5656
5757
The system uses the array of addresses to determine what addresses are currently available, and call the ```isConnected()``` with the possible and available addresses until a connection is found, or it hits the end of the possible addresses for the device.
5858
59-
##### Method Signature
59+
##### Method Signature {#device-address-method}
6060
61-
```C++
61+
```cpp
6262
static const uint8_t *getDefaultAddresses();
6363
```
6464

@@ -68,9 +68,9 @@ For each of the addresses returned, the system calls the drivers ```isConnected(
6868

6969
How the driver determines if a device is connected is determined by the implementation
7070

71-
##### Method Signature
71+
##### Method Signature {#is-connected-method}
7272

73-
```C++
73+
```cpp
7474
static bool isConnected(flxBusI2C &i2cDriver, uint8_t address);
7575
```
7676
@@ -83,9 +83,9 @@ static bool isConnected(flxBusI2C &i2cDriver, uint8_t address);
8383
8484
The static interface for the device also includes a method to return the name of the device.
8585
86-
##### Method Signature
86+
##### Method Signature {#device-name-method}
8787
88-
```C++
88+
```cpp
8989
static const char *getDeviceName()
9090
```
9191

@@ -97,19 +97,19 @@ This method returns the confidence level for the algorithm in the devices ```isC
9797

9898
This confidence level is used to resolve detection conflicts between devices that support the same address on the I2C bus. Drivers that have a higher confidence level are evaluated first.
9999

100-
#### Method Signature
100+
#### Method Signature {#confidence-level-method}
101101

102-
```C++
102+
```cpp
103103
static flxDeviceConfidence_t connectedConfidence(void)
104104
```
105105
106106
The return value should be one of the following:
107107
108-
|||
108+
| | |
109109
|---|---|
110-
```flxDevConfidenceExact``` | The algorithm can perform an exact match
111-
```flxDevConfidenceFuzzy``` | The algorithm has high-confidence in a match, but it's not exact
112-
```flxDevConfidencePing``` | An address "ping" is used - just detecting a device at a location, but not verifying the device type.
110+
|```flxDevConfidenceExact``` | The algorithm can perform an exact match|
111+
|```flxDevConfidenceFuzzy``` | The algorithm has high-confidence in a match, but it's not exact|
112+
|```flxDevConfidencePing``` | An address "ping" is used - just detecting a device at a location, but not verifying the device type.|
113113
114114
> Note: Only one device with a PING confidence is allowed at an address.
115115
@@ -119,7 +119,7 @@ This example is taken from the device driver for the BME280 device.
119119
120120
The class definition - ```flxDevBME280.h```
121121
122-
```C++
122+
```cpp
123123
// What is the name used to ID this device?
124124
#define kBME280DeviceName "bme280";
125125
@@ -166,19 +166,20 @@ To complete the auto-discovery capabilities of the system, besides the implement
166166

167167
This is call is placed before the class implementation and has the following signature:
168168

169-
```C++
169+
```cpp
170170
flxRegisterDevice(DeviceClassName);
171171
```
172172
173173
Where `DeviceClassName` is the class name of the device being registered.
174174
175175
Once a device is registered, it is available for auto-detection and loading by the framework during the startup process of system.
176176
177-
> Note: The ```flxRegisterDevice()``` call is a macro that defines a global object using a c++ template. The object is instantiated on system startup (all globals are), and in the constructor of the object, it registers itself with the device discovery system.
177+
> ![note]
178+
> The ```flxRegisterDevice()``` call is a macro that defines a global object using a c++ template. The object is instantiated on system startup (all globals are), and in the constructor of the object, it registers itself with the device discovery system.
178179
179180
Building off the above BME280 example, the implementation looks like:
180181
181-
```C++
182+
```cpp
182183
#define kBMEAddressDefault 0x77
183184
#define kBMEAddressAlt1 0x76
184185
@@ -204,15 +205,15 @@ flxDevBME280::flxDevBME280()
204205
}
205206
```
206207

207-
Notes
208-
209-
* This example includes the implementation of ```defaultDeviceAddress[]```, the class variable holding the addresses for the device.
210-
* The device is registered before the class constructor
211-
* In the constructor, the device identity is set, which is based of runtime conditions.
208+
> [!note]
209+
>
210+
> * This example includes the implementation of ```defaultDeviceAddress[]```, the class variable holding the addresses for the device.
211+
> * The device is registered before the class constructor
212+
> * In the constructor, the device identity is set, which is based of runtime conditions.
212213
213214
The isConnected() method for this example is:
214215

215-
```C++
216+
```cpp
216217
bool flxDevBME280::isConnected(flxBusI2C &i2cDriver, uint8_t address)
217218
{
218219

@@ -223,25 +224,25 @@ bool flxDevBME280::isConnected(flxBusI2C &i2cDriver, uint8_t address)
223224
}
224225
```
225226
226-
Note
227-
228-
* This is a static (has no `this` instance) and as such uses the methods on the passed in I2C bus driver to determine in a BME280 is connected to the system
227+
> [!note]
228+
>
229+
> * This is a static (has no `this` instance) and as such uses the methods on the passed in I2C bus driver to determine in a BME280 is connected to the system
229230
230231
### Startup Sequence
231232
232233
The last part of implementing a device descriptor/driver class is the addition of an initialization method, named ``onInitialize()``.
233234
234-
##### Method Signature
235+
#### Method Signature {#on-init-method}
235236
236-
```C++
237+
```cpp
237238
bool onInitialize(TwoWire &);
238239
```
239240

240241
The only argument to this methods is the Arduino I2C `TwoWire` class, which the class can use to initialize the device. The method returns `true` on success, `false` on failure.
241242

242243
The BME280 example implementation:
243244

244-
```C++
245+
```cpp
245246
bool flxDevBME280::onInitialize(TwoWire &wirePort)
246247
{
247248

@@ -251,7 +252,8 @@ bool flxDevBME280::onInitialize(TwoWire &wirePort)
251252
}
252253
```
253254
254-
> Note: The ```address()``` method returns the device address for this instance of the driver.
255+
> [!note]
256+
> The ```address()``` method returns the device address for this instance of the driver.
255257
256258
### Determining if a Device is Initialized
257259

docs/doxygen/doxygen-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ ALWAYS_DETAILED_SEC = YES
171171
# operators of the base classes will not be shown.
172172
# The default value is: NO.
173173

174-
INLINE_INHERITED_MEMB = YES
174+
INLINE_INHERITED_MEMB = NO
175175

176176
# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
177177
# before files name in the file list and in the header files. If set to NO the

docs/parameters.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
2-
# Parameters
1+
# Parameters Overview {#parameters_overview}
32

43
Parameters represent the method to read or pass in a specific data _value_ to an operation object withing the SDK. Parameters can be thought of as the data values passed into or returned from a function call. Parameter objects provide a means to support dynamically discoverable input and output data for a particular operation within the framework.
54

65
There are two types of Parameter objects with the framework: Input Parameters ("functions") and Output Parameters
76

8-
### Parameter Attributes
7+
## Parameter Attributes
98

109
The following are key attributes of parameters within the framework
1110

@@ -14,7 +13,7 @@ The following are key attributes of parameters within the framework
1413
* Parameter objects can act like a function
1514
* Parameter objects allow introspection - they can be discovered and manipulated at runtime via software
1615

17-
#### Parameter Data Types
16+
### Parameter Data Types
1817

1918
The following types are available for properties
2019

@@ -126,7 +125,7 @@ Note
126125
127126
Data limits define restrictions on the values the input parameter accepts. There are two types of data limits: range and valid value sets.
128127
129-
*Data Range*
128+
_Data Range_
130129
This represents the minimum and maximum values a input parameter will accept. The values can be specified at parameter definition and also set at runtime.
131130
132131
To set the range at parameter definition, just set the declared parameter to the range using a C++ initializer list ```{ min, max}```
@@ -151,7 +150,7 @@ Using the example parameter from above:
151150

152151
This changes the data range accepted by the input parameter and deletes any existing data limit.
153152

154-
*Data Valid Value Set*
153+
_Data Valid Value Set_
155154
This represents data limit provides a defined set of valid values for the input parameter. The limit is defined by a set of _name,value_ pairs that enable a human readable presentation for the values a input parameter will accept. The values can be specified at parameter definition and also set at runtime.
156155

157156
To set the valid values at parameter definition, just set the declared parameter to the range using a C++ initializer list of name value pairs:

docs/properties.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
\addtogroup module_properties
2-
@{
31

4-
# Properties
2+
# Properties Overview {#properties_overview}
53

64
Properties represent the "_settings_" for a particular object within the system. This property values describe their object, as well as how the object behaves/operates within the system.
75

@@ -369,5 +367,3 @@ Or for an entire parameter list:
369367
```
370368
371369
The values are added to the current valid value list. If a _ValidValue_ data limit was not in place when called, any current limit (i.e. range limit) is deleted and a valid value limit is put in place.
372-
373-
@}

0 commit comments

Comments
 (0)