Skip to content

Commit b58b98e

Browse files
committed
Add extra setval and getval methods. Pass payload size to newCfgValget
1 parent fd5dfee commit b58b98e

File tree

4 files changed

+237
-67
lines changed

4 files changed

+237
-67
lines changed

README.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ Migrating to v3 is easy. There are two small changes all users will need to make
5454
v3 is _mostly_ backward-compatible with v2, but there have been some important changes. If in doubt, please look at the updated [examples](./examples).
5555
They have all been updated and tested with v3.
5656

57+
### VAL_LAYER
58+
5759
Because all module configuration is performed using the Configuration Interface, you will find that the **VAL_LAYER** has been added as
5860
a parameter in many methods. The set methods default to using ```VAL_LAYER_RAM_BBR``` - i.e. the configuration will be changed and stored in both
59-
RAM and Battery-Backed RAM. Options are: ```VAL_LAYER_RAM```, ```VAL_LAYER_BBR```, ```VAL_LAYER_FLASH``` (if your module has flash memory attached),
61+
RAM and Battery-Backed RAM but not flash. Options are: ```VAL_LAYER_RAM```, ```VAL_LAYER_BBR```, ```VAL_LAYER_FLASH``` (if your module has flash memory attached),
6062
```VAL_LAYER_RAM_BBR``` and ```VAL_LAYER_ALL``` (all three).
6163

6264
Please check your code. If you are using ```maxWait```, you will need to specify the LAYER too. E.g.:
@@ -84,6 +86,9 @@ Please check your code. If you are using ```maxWait```, you will need to specify
8486
```
8587

8688
Likewise, when reading (getting) the configuration, you can specify ```VAL_LAYER_RAM``` or ```VAL_LAYER_DEFAULT```. The methods default to ```VAL_LAYER_RAM```.
89+
(```VAL_LAYER_BBR``` and ```VAL_LAYER_FLASH``` are also supported - but earlier ZED-F9P's NACK'd reading those layers.)
90+
91+
### VALSET and VALGET
8792

8893
v3 provides a new way of reading (getting) values from the Configuration Interface: ```newCfgValget```, ```addCfgValget``` and ```sendCfgValget```.
8994
Please see the [VALSET and VALGET examples](./examples/VALGET_and_VALSET/) for more details.
@@ -106,6 +111,28 @@ To configure the ports, please use the methods:
106111
bool setSPIInput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
107112
```
108113

114+
### Template VALSET and VALGET
115+
116+
Please also note that as of Jan 10th 2023 the u-blox Config Keys defined in [u-blox_config_keys.h](./src/u-blox_config_keys.h) now have their size encoded into them.
117+
We OR extra data into the unused bits in each key to define the size. This allows set and get template methods to cope with the different sizes. E.g.:
118+
119+
```
120+
// CFG-ANA: AssistNow Autonomous and Offline configuration
121+
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
122+
const uint32_t UBLOX_CFG_ANA_USE_ANA = UBX_CFG_L | 0x10230001; // Use AssistNow Autonomous
123+
const uint32_t UBLOX_CFG_ANA_ORBMAXERR = UBX_CFG_U2 | 0x30230002; // Maximum acceptable (modeled) orbit error in m. Range is from 5 to 1000.
124+
```
125+
126+
```UBX_CFG_L``` is a logical boolean single bit, stored as 8-bit U1 (uint8_t). ```UBX_CFG_U2``` is 2-byte (16-bit) unsigned (uint16_t). Etc..
127+
128+
If you are using the keys in your own code, you can restore the original key value by ANDing with the inverse of ```UBX_CFG_SIZE_MASK``` :
129+
130+
```
131+
key &= ~UBX_CFG_SIZE_MASK; // Mask off the size identifer bits
132+
```
133+
134+
The get and set template methods are based on an idea by Michael Ammann. Thank you @mazgch
135+
109136
## Compatibility
110137

111138
v3 of the library provides support for generation F9 and M10 u-blox GNSS modules.

keywords.txt

+13
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ getVal8 KEYWORD2
225225
getVal16 KEYWORD2
226226
getVal32 KEYWORD2
227227
getVal64 KEYWORD2
228+
getValSigned8 KEYWORD2
229+
getValSigned16 KEYWORD2
230+
getValSigned32 KEYWORD2
231+
getValSigned64 KEYWORD2
232+
getValFloat KEYWORD2
233+
getValDouble KEYWORD2
228234

229235
newCfgValget KEYWORD2
230236
addCfgValget KEYWORD2
@@ -239,12 +245,19 @@ setVal8 KEYWORD2
239245
setVal16 KEYWORD2
240246
setVal32 KEYWORD2
241247
setVal64 KEYWORD2
248+
setValSigned8 KEYWORD2
249+
setValSigned16 KEYWORD2
250+
setValSigned32 KEYWORD2
251+
setValSigned64 KEYWORD2
252+
setValFloat KEYWORD2
253+
setValDouble KEYWORD2
242254

243255
newCfgValset KEYWORD2
244256
newCfgValset8 KEYWORD2
245257
newCfgValset16 KEYWORD2
246258
newCfgValset32 KEYWORD2
247259
newCfgValset64 KEYWORD2
260+
addCfgValset KEYWORD2
248261
addCfgValsetN KEYWORD2
249262
addCfgValset8 KEYWORD2
250263
addCfgValset16 KEYWORD2

0 commit comments

Comments
 (0)