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
drivers/sensors/l86xxx: Make some dependency patches and update documentation
This commit removes the termios dependency of the command to set fix
rate. It makes the MINMEA dependency present in the Kconfig options for
the driver, and it also adds a retry limit to the boot message
verification of 3 times. The documentation has been updated to reflect
the correct signature for the registration function and fix some
formatting.
Signed-off-by: Matteo Golin <[email protected]>
Copy file name to clipboardExpand all lines: Documentation/components/drivers/special/sensors/l86xxx.rst
+53-29Lines changed: 53 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,57 +23,76 @@ the path to the UART interface the module is connected to. You will also need to
23
23
ensure that the baud rate of the UART interface is set to 9600, which is the default
24
24
baud rate of the L86-XXX series of GNSS modules.
25
25
26
-
The driver supports changing the default baud rate and update rate of the GNSS module.
27
-
As a result, you will also need to enable serial TERMIOS support (``CONFIG_SERIAL_TERMIOS``).
28
-
The baud rate and update rate of the GNSS module can be configured using the ``L86_XXX_BAUD`` and ``L86_XXX_FIX_INT`` options respectively.
29
-
Note that a faster update rate will require a higher baud rate to support it and the supported baud rates for the L86-XXX series of GNSS modules are:
26
+
The driver supports changing the default baud rate and update rate of the GNSS
27
+
module. As a result, you will also need to enable serial TERMIOS support
28
+
(``CONFIG_SERIAL_TERMIOS``). The baud rate and update rate of the GNSS module
29
+
can be configured using the ``L86_XXX_BAUD`` and ``L86_XXX_FIX_INT`` options
30
+
respectively. Note that a faster update rate will require a higher baud rate to
31
+
support it and the supported baud rates for the L86-XXX series of GNSS modules
32
+
are:
33
+
30
34
* 4800
31
35
* 9600
32
36
* 14400
33
37
* 19200
34
38
* 38400
35
39
* 57600
36
40
* 115200
41
+
37
42
The baud rate and update rates of the module are changed at registration time.
38
43
39
44
.. code-block:: c
40
45
41
46
#if defined(CONFIG_SENSORS_L86_XXX)
42
47
#include <nuttx/sensors/l86xxx.h>
43
48
44
-
/* Register L86-M33 on USART3 */
49
+
/* Register L86xxx device on USART2 */
45
50
46
-
ret = l86xxx_register("/dev/l86m33", "/dev/ttyS2", 0);
51
+
ret = l86xxx_register("/dev/ttyS2", 0);
47
52
if (ret < 0) {
48
53
syslog(LOG_ERR, "Failed to register L86-M33: %d\n", ret);
49
54
}
50
55
#endif
51
56
52
-
Once the driver is registered, it starts a thread that continuously reads raw output from the specified UART device and
53
-
parses the output according to `NMEA <https://en.wikipedia.org/wiki/NMEA_0183>`_ standards using the
54
-
`minmea <https://github.com/kosma/minmea>`_ library included in NuttX. The driver populates the ``sensor_gnss`` struct
55
-
and pushes it to the appropriate event once all NMEA messages in its sequence have been read.
57
+
Once the driver is registered, it starts a thread that continuously reads raw
58
+
output from the specified UART device and parses the output according to `NMEA
59
+
<https://en.wikipedia.org/wiki/NMEA_0183>`_ standards using the `minmea
60
+
<https://github.com/kosma/minmea>`_ library included in NuttX. The driver
61
+
populates the ``sensor_gnss`` struct and pushes it to the appropriate event once
62
+
all NMEA messages in its sequence have been read.
56
63
57
64
58
65
**uORB commands**
59
66
-----------------
60
-
The driver implements the ``orb_activate``, ``orb_set_interval`` and, ``orb_ioctl`` operations to interact with the device.
61
-
The latter is used to send proprietary 'PMTK' commands which are documented further below.
67
+
68
+
The driver implements the ``orb_activate``, ``orb_set_interval`` and,
69
+
``orb_ioctl`` operations to interact with the device. The latter is used to send
70
+
proprietary 'PMTK' commands which are documented further below.
62
71
63
72
**Activate**
64
73
65
-
There are 4 modes that the L86-XXX GNSS modules can be in. Those are "Full On Mode", "Standby Mode", "Backup Mode", "Periodic Mode" and, "AlwaysLocateTM Mode".
66
-
Calling ``orb_activate`` with ``enable`` set to false will enter the module into "Standby Mode".
67
-
In "Standby Mode", the module doesn't output any NMEA messages but the internal core and I/O power domain are still active.
74
+
There are 4 modes that the L86-XXX GNSS modules can be in:
75
+
76
+
* Full On Mode
77
+
* Standby Mode
78
+
* Backup Mode
79
+
* Periodic Mode
80
+
* AlwaysLocateTM Mode
68
81
69
-
The module can be re-enabled by calling ``orb_activate`` with ``enable`` set to true, which will hot start the module OR by
70
-
sending any 'PMTK' command.
82
+
Calling ``orb_activate`` with ``enable`` set to false will enter the
83
+
module into "Standby Mode". In "Standby Mode", the module doesn't output any
84
+
NMEA messages but the internal core and I/O power domain are still active.
85
+
86
+
The module can be re-enabled by calling ``orb_activate`` with ``enable`` set to
87
+
true, which will hot start the module OR by sending any 'PMTK' command.
71
88
72
89
**Set interval**
73
90
74
-
The L86-XXX GNSS modules support interval rates from 1Hz to 10Hz (100ms - 10000ms). When using ``orb_set_interval``, be aware that
75
-
increasing the interval of the module may also require and increase in baud rate. An example of how this is performed can be found in
76
-
source code of this driver in the register function.
91
+
The L86-XXX GNSS modules support interval rates from 1Hz to 10Hz (100ms -
92
+
10000ms). When using ``orb_set_interval``, be aware that increasing the interval
93
+
of the module may also require and increase in baud rate. An example of how this
94
+
is performed can be found in source code of this driver in the register
95
+
function.
77
96
78
97
Any interval rate outside of the supported range will result in a failed call to this function.
79
98
@@ -82,16 +101,17 @@ Any interval rate outside of the supported range will result in a failed call to
82
101
The ``orb_ioctl`` interface allows one to send proprietary 'PMTK' commands to the L86-XXX GNSS module. It effectively works
83
102
as a wrapper for the command framework outlined by Quectel. The return value of calls to ``orb_ioctl`` follow this pattern:
84
103
85
-
* -EINVAL - Invalid packet
86
-
* -ENOSYS - Unsupported packet type
87
-
* -EIO - Valid packet, but action failed
88
-
* 0 - Valid packet, action succeeded
89
-
* Other - Command failed during writing
104
+
* ``EINVAL`` - Invalid packet
105
+
* ``ENOSYS`` - Unsupported packet type
106
+
* ``EIO`` - Valid packet, but action failed
107
+
* ``0`` - Valid packet, action succeeded
108
+
* Other - Command failed during writing
90
109
91
110
The supported commands are their arguments are listed below.
92
111
93
112
``SNIOC_HOT_START``
94
113
-------------------
114
+
95
115
Used to "Hot start" the GNSS module. Normally hot start means the GNSS module was powered down for less
96
116
than 3 hours (RTC must be alive) and its ephemeris is still valid. As there is no need for downloading
97
117
ephemeris, it is the fastest startup method.
@@ -102,6 +122,7 @@ ephemeris, it is the fastest startup method.
102
122
103
123
``SNIOC_WARM_START``
104
124
--------------------
125
+
105
126
Used to "Warm start" the GNSS module. Warm start means the GNSS module has approximate information of time,
106
127
position and coarse data on satellite positions, but it needs to download ephemeris until it can get a fix.
107
128
@@ -111,6 +132,7 @@ position and coarse data on satellite positions, but it needs to download epheme
111
132
112
133
``SNIOC_COLD_START``
113
134
--------------------
135
+
114
136
Used to "Cold start" the GNSS module. Using this message will force the GNSS module to be restarted without
115
137
any prior location information, including time, position, almanacs and ephemeris data.
116
138
@@ -120,6 +142,7 @@ any prior location information, including time, position, almanacs and ephemeris
120
142
121
143
``SNIOC_FULL_COLD_START``
122
144
-------------------------
145
+
123
146
Used to "Full cold start" the GNSS module. This is effectively the same as a cold restart, but additionally
124
147
clears system and user configurations. In other words, this resets the GNSS module to its factory settings.
125
148
When full-cold started, the GNSS module has no information on its last location.
@@ -130,7 +153,9 @@ When full-cold started, the GNSS module has no information on its last location.
130
153
131
154
``SNIOC_SET_INTERVAL``
132
155
----------------------
133
-
Used to modify the position fix interval of the GNSS module. The argument is an integer between 100 and 10000, default value is 1000.
156
+
157
+
Used to modify the position fix interval of the GNSS module. The argument is an
158
+
integer between 100 and 10000, default value is 1000.
134
159
135
160
.. code-block:: c
136
161
@@ -140,7 +165,7 @@ Used to modify the position fix interval of the GNSS module. The argument is an
140
165
------------------
141
166
.. note::
142
167
143
-
This feature requires termios support to be enabled(``CONFIG_SERIAL_TERMIOS``)
168
+
This feature requires termios support to be enabled(``CONFIG_SERIAL_TERMIOS``)
144
169
145
170
Used to modify the baud rate of the GNSS module. The argument is an integer representing a supported baud rate, default value is 9600.
146
171
Upon sending this command, the baud rate of the UART interface used to communicate with the module is also modified.
@@ -160,6 +185,7 @@ Supported baud rates for the L86-XXX series of GNSS modules are:
160
185
161
186
``SNIOC_SET_OPERATIONAL_MODE``
162
187
------------------------------
188
+
163
189
Used to set the navigation mode of the GNSS module. The argument is an ``L86XXX_OPERATIONAL_MODE`` enum:
0 commit comments