Skip to content

Commit 8f5ac90

Browse files
committed
fix typos, formmatting and minor issues
1 parent 3eb430c commit 8f5ac90

File tree

3 files changed

+15
-39
lines changed

3 files changed

+15
-39
lines changed

docs/device_writing.md

+7-17
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The key capabilities provided by the implemented framework device class are:
1313

1414
The device class should following the naming pattern `flxDev[Name]`, where Name is a unique name of the class.
1515

16-
The implementation requires separate header and implementation files, since a several class variables and a global object are defined that required the use of an implementation file.
16+
The implementation requires separate header and implementation files, since several class variables and a global object are defined that required the use of an implementation file.
1717

18-
The new device class should subclass from the frameworks ```flxDevice``` class, using the ```flxDeviceI2CType<DeviceName>``` template. Additionally, the device class subclasses from the underlying driver class in most cases. This allows the descriptor class to support the existing driver's interface.
18+
The new device class should subclass from the frameworks ```flxDevice``` class, using the ```flxDeviceI2CType<DeviceName>``` template. Additionally, the device class subclasses from the underlying Arduino driver class in most cases. This allows the descriptor class to support the existing driver's interface.
1919

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

@@ -32,7 +32,7 @@ class flxDevBME280 : public flxDeviceI2CType<flxDevBME280>, public BME280
3232
3333
## Automatic Device Discovery
3434
35-
The framework supports runtime discovery of connected devices. This is performed using information from the framework device class, while not creating a device instance until the device is actually detected.
35+
The framework supports runtime discovery of connected devices. This is performed using information from the framework device class, and not creating a device instance until the device is actually detected.
3636
3737
To accomplish this task, class level (static) methods and data are implemented by the device object. Each device class implements the following:
3838
@@ -43,8 +43,6 @@ To accomplish this task, class level (static) methods and data are implemented b
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]
47-
>
4846
>* Often the device implements the address list as a class level variable
4947
>* It is common to define a constant or macro for the device name and return it from ```getDeviceName()```
5048
@@ -93,7 +91,7 @@ This method returns a constant C string.
9391

9492
#### Connected Confidence
9593

96-
This method returns the confidence level for the algorithm in the devices ```isConnected()``` algorithm in exactly determining if a device is connected at the specific address.
94+
This method returns the confidence level for the algorithm in the devices ```isConnected()``` method in exactly determining if a device is connected at the specific address.
9795

9896
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.
9997

@@ -111,8 +109,6 @@ The return value should be one of the following:
111109
|```flxDevConfidenceFuzzy``` | The algorithm has high-confidence in a match, but it's not exact|
112110
|```flxDevConfidencePing``` | An address "ping" is used - just detecting a device at a location, but not verifying the device type.|
113111
114-
> [!note]
115-
>
116112
> Only one device with a PING confidence is allowed at an address.
117113
118114
#### Example Method Definition
@@ -126,7 +122,7 @@ The class definition - ```flxDevBME280.h```
126122
#define kBME280DeviceName "bme280";
127123
128124
// Define our class - note sub-classing from the Qwiic Library
129-
class flxDevBME280 : public flxDevice<flxDevBME280>, public BME280
125+
class flxDevBME280 : public flxDeviceI2CType<flxDevBME280>, public BME280
130126
{
131127
132128
public:
@@ -160,7 +156,7 @@ class flxDevBME280 : public flxDevice<flxDevBME280>, public BME280
160156
* This device defined its name, bme280, using the macro `kBME280DeviceName`
161157
* Default device addresses are contained in a class variable ```defaultDeviceAddress[];```
162158
* The method ```onInitialize()``` is called after the object is instantiated.
163-
* The class subclasses from flxDevice, passing in the class name to the template. The class also subclasses from the Arduino Library class - ```BME280```
159+
* The class subclasses from flxDeviceI2CType, passing in the class name to the template. The class also subclasses from the Arduino Library class - ```BME280```
164160

165161
### Auto Discovery - Class Implementation
166162

@@ -204,8 +200,6 @@ flxDevBME280::flxDevBME280()
204200
}
205201
```
206202

207-
> [!note]
208-
>
209203
> * This example includes the implementation of ```defaultDeviceAddress[]```, the class variable holding the addresses for the device.
210204
> * The device is registered before the class constructor
211205
> * In the constructor, the device identity is set, which is based of runtime conditions.
@@ -223,8 +217,6 @@ bool flxDevBME280::isConnected(flxBusI2C &i2cDriver, uint8_t address)
223217
}
224218
```
225219
226-
> [!note]
227-
>
228220
> * 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
229221
230222
### Startup Sequence
@@ -251,8 +243,6 @@ bool flxDevBME280::onInitialize(TwoWire &wirePort)
251243
}
252244
```
253245
254-
> [!note]
255-
>
256246
> The ```address()``` method returns the device address for this instance of the driver.
257247
258248
### Determining if a Device is Initialized

docs/parameters.md

+7-19
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ The following types are available for properties
2020
* bool
2121
* int8
2222
* int16
23-
* int
23+
* int32
2424
* uint8
2525
* uint16
26-
* uint
26+
* uint32
2727
* float
2828
* double
2929
* string
@@ -51,8 +51,6 @@ For the framework, two types of Parameter classes exist.
5151
* Input Parameter - Defines a Parameter to set input value to an operation. These are referred to as functions at times - especially in the user experience of an application.
5252
* Output Parameter - Defines a Parameter to get an output value from an operation
5353

54-
> [!note]
55-
>
5654
> The get and set operations on a parameter are mapped to methods implemented by the containing class.
5755
5856
### Input Parameter Objects
@@ -78,10 +76,10 @@ Where:
7876
* #flxParameterInBool - bool parameter
7977
* #flxParameterInInt8 - integer8 parameter
8078
* #flxParameterInInt16 - integer16 parameter
81-
* #flxParameterInInt - integer parameter
82-
* #flxParameterInUint8 - unsigned integer8
83-
* #flxParameterInUint16 - unsigned integer15
84-
* #flxParameterInUint - unsigned integer
79+
* #flxParameterInInt32 - integer parameter
80+
* #flxParameterInUInt8 - unsigned integer8
81+
* #flxParameterInUInt16 - unsigned integer15
82+
* #flxParameterInUInt32 - unsigned integer
8583
* #flxParameterInFloat - float
8684
* #flxParameterInDouble - double
8785
* #flxParameterInString - string -> std::string
@@ -99,8 +97,6 @@ Where:
9997
* parameter_type - the type of the parameter (bool, int, uint, float, double, std::string)
10098
* ClassName - the name of the containing class for the property
10199

102-
> [!note]
103-
>
104100
> By convention, writer method names are prefixed by ```write_```
105101
106102
##### Example
@@ -117,8 +113,6 @@ public:
117113
}
118114
```
119115
120-
> [!note]
121-
>
122116
> * By convention declaring the input writer method as private. This can be optional
123117
> * The writer method must be declared before defining the parameter
124118
> * The use of the `write_` prefix on the writer methods help identify the methods as supporting a parameter.
@@ -192,7 +186,7 @@ Using the example parameter from above:
192186
```cpp
193187
// Add valid values ...
194188
my_input.addDataLimitValidValue("ONE K", 100.);
195-
my_input.addDataLimitValidValue("ONE K", 100.);
189+
my_input.addDataLimitValidValue("TWO K", 200.);
196190
```
197191

198192
Or for an entire parameter list:
@@ -271,8 +265,6 @@ public:
271265
}
272266
```
273267

274-
> [!note]
275-
>
276268
> * By convention declaring the output reader method as private. This can be optional
277269
> * The reader method must be declared before defining the parameter
278270
> * The use of the `read_` prefix on the writer methods help identify the methods as supporting a parameter.
@@ -322,8 +314,6 @@ Where
322314
* ClassName - the name of the containing class for the property
323315
* On success, a true value is returned, false on error.
324316
325-
> [!note]
326-
>
327317
> By convention, reader method names are prefixed by ```read_```
328318
329319
In the reader methods, the data and dimensions of the array are set in the array object.
@@ -361,8 +351,6 @@ public:
361351
}
362352
```
363353
364-
> [!note]
365-
>
366354
> * By convention declaring the output reader method as private. This can be optional
367355
> * The reader method must be declared before defining the parameter
368356
> * The use of the `read_` prefix on the writer methods help identify the methods as supporting a parameter.

docs/properties.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ public:
232232
}
233233
```
234234
235-
> [!note]
236-
>
237235
> * By convention the getters and setters are declared as private. This can be optional
238236
> * The getter and setter methods must be declared before defining the property
239237
> * The use of `set_` and `get_` prefixes on the setter and getter methods help identify the methods as supporting a property.
@@ -351,7 +349,7 @@ Simple Example:
351349
```cpp
352350
// Add valid values ...
353351
my_property.addDataLimitValidValue("ONE K", 100.);
354-
my_property.addDataLimitValidValue("ONE K", 100.);
352+
my_property.addDataLimitValidValue("TWO K", 200.);
355353
```
356354

357355
Or for an entire parameter list:

0 commit comments

Comments
 (0)