Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
gps_ubx_ucenter.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2011 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  * Initial author: C. De Wagter
22  */
23 
31 #include "subsystems/gps/gps_ubx.h"
32 #include "ubx_protocol.h"
34 
35 #if PRINT_DEBUG_GPS_UBX_UCENTER
36 #include <stdio.h>
37 #define DEBUG_PRINT(...) printf(__VA_ARGS__)
38 #else
39 #define DEBUG_PRINT(...) {}
40 #endif
41 
44 //
45 // UCENTER: init, periodic and event
46 #ifndef GPS_I2C
48 #endif
50 
51 #define GPS_UBX_UCENTER_STATUS_STOPPED 0
52 #define GPS_UBX_UCENTER_STATUS_AUTOBAUD 1
53 #define GPS_UBX_UCENTER_STATUS_CONFIG 2
54 #define GPS_UBX_UCENTER_STATUS_WAITING 3
55 
56 #define GPS_UBX_UCENTER_REPLY_NONE 0
57 #define GPS_UBX_UCENTER_REPLY_ACK 1
58 #define GPS_UBX_UCENTER_REPLY_NACK 2
59 #define GPS_UBX_UCENTER_REPLY_VERSION 3
60 #define GPS_UBX_UCENTER_REPLY_CFG_PRT 4
61 
62 // Target baudrate for the module
63 #define UBX_GPS_BAUD (UBX_GPS_LINK).baudrate
64 
65 // All U-Center data
67 
68 
70 // Init Function
71 
73 {
74  // Start UCenter
77  gps_ubx_ucenter.cnt = 0;
78 
82 
87 
88  for (int i = 0; i < GPS_UBX_UCENTER_CONFIG_STEPS; i++) {
89  gps_ubx_ucenter.replies[i] = 0;
90  }
91 
92  gps_ubx_ucenter.dev = &(UBX_GPS_LINK).device;
93 }
94 
95 
97 // Periodic Function
98 // -time-based configuration
99 
101 {
102  switch (gps_ubx_ucenter.status) {
103  // Save processing time inflight
105  return;
106  break;
107  // Automatically Determine Current Baudrate
109 #ifdef GPS_I2C
110  gps_ubx_ucenter.cnt = 0;
112 #else
115  gps_ubx_ucenter.cnt = 0;
116 #if PRINT_DEBUG_GPS_UBX_UCENTER
117  if (gps_ubx_ucenter.baud_init > 0) {
118  DEBUG_PRINT("Initial ublox baudrate found: %u\n", gps_ubx_ucenter.baud_init);
119  } else {
120  DEBUG_PRINT("WARNING: Unable to determine the ublox baudrate. Autoconfiguration is unlikely to work.\n");
121  }
122 #endif
123  } else {
125  }
126 #endif /* GPS_I2C */
127  break;
128  // Send Configuration
132 #ifdef GPS_I2C
133  gps_i2c_begin();
134 #endif
135  gps_ubx_ucenter.cnt = 0;
136  } else {
138 #ifdef GPS_I2C
140  }
141  break;
143  if (gps_i2c_tx_is_ready()) {
145 #endif /*GPS_I2C*/
146  }
147  break;
148  default:
149  // stop this module now...
150  // todo
151  break;
152  }
153 }
154 
156 // Event Function
157 // -fetch replies: ACK and VERSION info
158 
160 {
161  // Save processing time inflight
163  return;
164  }
165 
166  // Read Configuration Reply's
167  switch (gps_ubx.msg_class) {
168  case UBX_ACK_ID:
169  if (gps_ubx.msg_id == UBX_ACK_ACK_ID) {
171  DEBUG_PRINT("ACK\n");
172  } else if (gps_ubx.msg_id == UBX_ACK_NAK_ID) {
174  DEBUG_PRINT("NACK\n");
175  }
176  break;
177  case UBX_MON_ID:
178  if (gps_ubx.msg_id == UBX_MON_VER_ID) {
180  gps_ubx_ucenter.sw_ver_h = UBX_MON_VER_c(gps_ubx.msg_buf, 0) - '0';
181  gps_ubx_ucenter.sw_ver_l = 10 * (UBX_MON_VER_c(gps_ubx.msg_buf, 2) - '0');
182  gps_ubx_ucenter.sw_ver_l += UBX_MON_VER_c(gps_ubx.msg_buf, 3) - '0';
183  gps_ubx_ucenter.hw_ver_h = UBX_MON_VER_c(gps_ubx.msg_buf, 33) - '0';
184  gps_ubx_ucenter.hw_ver_h += 10 * (UBX_MON_VER_c(gps_ubx.msg_buf, 32) - '0');
185  gps_ubx_ucenter.hw_ver_l = UBX_MON_VER_c(gps_ubx.msg_buf, 37) - '0';
186  gps_ubx_ucenter.hw_ver_l += 10 * (UBX_MON_VER_c(gps_ubx.msg_buf, 36) - '0');
187 
188  DEBUG_PRINT("ublox sw_ver: %u.%u\n", gps_ubx_ucenter.sw_ver_h, gps_ubx_ucenter.sw_ver_l);
189  DEBUG_PRINT("ublox hw_ver: %u.%u\n", gps_ubx_ucenter.hw_ver_h, gps_ubx_ucenter.hw_ver_l);
190  } else if (gps_ubx.msg_id == UBX_MON_GNSS_ID) {
191  gps_ubx_ucenter.gnss_in_use = UBX_MON_GNSS_enabled(gps_ubx.msg_buf);
192  }
193  break;
194  case UBX_CFG_ID:
195  if (gps_ubx.msg_id == UBX_CFG_PRT_ID) {
197  gps_ubx_ucenter.port_id = UBX_CFG_PRT_PortId(gps_ubx.msg_buf, 0);
198  gps_ubx_ucenter.baud_run = UBX_CFG_PRT_Baudrate(gps_ubx.msg_buf, 0);
199 
200  DEBUG_PRINT("gps_ubx_ucenter.baud_run: %u\n", gps_ubx_ucenter.baud_run);
201  DEBUG_PRINT("gps_ubx_ucenter.port_id: %u\n", gps_ubx_ucenter.port_id);
202  }
203  break;
204  default:
205  break;
206  }
207 }
208 
211 //
212 // UCENTER Configuration Functions
213 
220 static inline void gps_ubx_ucenter_config_port_poll(void)
221 {
222  UbxSend_CFG_PRT_POLL(gps_ubx_ucenter.dev);
223 }
224 
237 static inline void gps_ubx_ucenter_enable_msg(uint8_t class, uint8_t id, uint8_t rate)
238 {
239  UbxSend_CFG_MSG(gps_ubx_ucenter.dev, class, id, rate);
240 }
241 
250 #ifndef GPS_I2C
252 {
253  switch (nr) {
254  case 0:
255  case 1:
256  // Very important for some modules:
257  // Give the GPS some time to boot (up to 0.75 second)
258  break;
259  case 2:
261  uart_periph_set_baudrate(&(UBX_GPS_LINK), B38400); // Try the most common first?
263  break;
264  case 3:
267  return false;
268  }
270  uart_periph_set_baudrate(&(UBX_GPS_LINK), B9600); // Maybe the factory default?
272  break;
273  case 4:
276  return false;
277  }
279  uart_periph_set_baudrate(&(UBX_GPS_LINK), B57600); // The high-rate default?
281  break;
282  case 5:
285  return false;
286  }
288  uart_periph_set_baudrate(&(UBX_GPS_LINK), B4800); // Default NMEA baudrate?
290  break;
291  case 6:
294  return false;
295  }
297  uart_periph_set_baudrate(&(UBX_GPS_LINK), B115200); // Last possible option for ublox
299  break;
300  case 7:
303  return false;
304  }
306  uart_periph_set_baudrate(&(UBX_GPS_LINK), B230400); // Last possible option for ublox
308  break;
309  case 8:
312  return false;
313  }
314 
315  // Autoconfig Failed... let's setup the failsafe baudrate
316  // Should we try even a different baudrate?
317  gps_ubx_ucenter.baud_init = 0; // Set as zero to indicate that we couldn't verify the baudrate
318  uart_periph_set_baudrate(&(UBX_GPS_LINK), B9600);
319  return false;
320  default:
321  break;
322  }
323  return true;
324 }
325 #endif /* GPS_I2C */
326 // UBlox internal Navigation Solution
328 
329 #define NAV_DYN_STATIONARY 1
330 #define NAV_DYN_PEDESTRIAN 2
331 #define NAV_DYN_AUTOMOTIVE 3
332 #define NAV_DYN_SEA 4
333 #define NAV_DYN_AIRBORNE_1G 5
334 #define NAV_DYN_AIRBORNE_2G 6 // paparazzi default
335 #define NAV_DYN_AIRBORNE_4G 7
336 
337 #define NAV5_DYN_PORTABLE 0 // ublox default
338 #define NAV5_DYN_FIXED 1
339 #define NAV5_DYN_STATIONARY 2
340 #define NAV5_DYN_PEDESTRIAN 3
341 #define NAV5_DYN_AUTOMOTIVE 4
342 #define NAV5_DYN_SEA 5
343 #define NAV5_DYN_AIRBORNE_1G 6
344 #define NAV5_DYN_AIRBORNE_2G 7 // paparazzi default
345 #define NAV5_DYN_AIRBORNE_4G 8
346 
347 #ifndef GPS_UBX_NAV5_DYNAMICS
348 #define GPS_UBX_NAV5_DYNAMICS NAV5_DYN_AIRBORNE_2G
349 #endif
350 
351 #ifndef GPS_UBX_ENABLE_NMEA_DATA_MASK
352 #define GPS_UBX_ENABLE_NMEA_DATA_MASK 0x00
353 #endif
354 
355 #define NAV5_MASK 0x05 // Apply dynamic model and position fix mode settings
356 
357 #define NAV5_2D_ONLY 1
358 #define NAV5_3D_ONLY 2 // paparazzi default
359 #define NAV5_AUTO 3 // ublox default
360 
361 #define NAV5_DEFAULT_MIN_ELEV 5 // deg
362 #define NAV5_DEFAULT_PDOP_MASK 25 // no units
363 #define NAV5_DEFAULT_TDOP_MASK 25 // no units
364 #define NAV5_DEFAULT_P_ACC 100 // m
365 #define NAV5_DEFAULT_T_ACC 300 // m
366 #define NAV5_DEFAULT_STATIC_HOLD_THRES 0 // cm/s
367 
368 #define IGNORED 0
369 #define RESERVED 0
370 
371 static inline void gps_ubx_ucenter_config_nav(void)
372 {
373  // New ublox firmware v5 or higher uses CFG_NAV5 message, CFG_NAV is no longer available
374  // If version message couldn't be fetched, default to NAV5
375  DEBUG_PRINT("sw_ver: %i, hw_ver: %i\n", gps_ubx_ucenter.sw_ver_h, gps_ubx_ucenter.hw_ver_h);
378  UbxSend_CFG_NAV(gps_ubx_ucenter.dev,
379  NAV_DYN_AIRBORNE_2G, 3, 16, 24, 20, 5, 0, 0x3C,
380  0x3C, 0x14, 0x03E8 , 0x0000, 0x0, 0x17, 0x00FA, 0x00FA,
381  0x0064, 0x012C, 0x000F, 0x00, 0x00);
382  } else {
383  UbxSend_CFG_NAV5(gps_ubx_ucenter.dev,
387  }
388 }
389 
390 
391 
393 // UBlox port and protocol GPS configuration
394 
395 #ifdef GPS_PORT_ID
396 #warning "GPS_PORT_ID is no longer needed by the ublox ucenter for automatically configuration. Please remove this defined variable and double check that autoconfig is working as expected."
397 #endif
398 
399 // UART mode: 8N1 with reserved1 set for compatability with A4
400 #define UBX_UART_MODE_MASK 0x000008D0
401 
402 #define UBX_PROTO_MASK 0x0001
403 #define NMEA_PROTO_MASK 0x0002
404 #define RTCM_PROTO_MASK 0x0004
405 #define RTCM3_PROTO_MASK 0x0020
406 
407 #define GPS_PORT_DDC 0x00
408 #define GPS_PORT_UART1 0x01
409 #define GPS_PORT_UART2 0x02
410 #define GPS_PORT_USB 0x03
411 #define GPS_PORT_SPI 0x04
412 #define GPS_PORT_RESERVED 0x05
413 
414 #ifndef GPS_UBX_UCENTER_RATE
415 #define GPS_UBX_UCENTER_RATE 0x00FA // In milliseconds. 0x00FA = 250ms = 4Hz
416 #endif
417 
418 static inline void gps_ubx_ucenter_config_port(void)
419 {
420  switch (gps_ubx_ucenter.port_id) {
421  // I2C Interface
422  case GPS_PORT_DDC:
423 #ifdef GPS_I2C
424  UbxSend_CFG_PRT(gps_ubx_ucenter.dev, gps_ubx_ucenter.port_id, 0x0, 0x0, (0x42 << 1), 0x0, UBX_PROTO_MASK,
425  UBX_PROTO_MASK, 0x0, 0x0);
426 #else
427  DEBUG_PRINT("WARNING: Please include the gps_i2c module.\n");
428 #endif
429  break;
430  // UART Interface
431  case GPS_PORT_UART1:
432  case GPS_PORT_UART2:
433  UbxSend_CFG_PRT(gps_ubx_ucenter.dev,
437  break;
438  // USB Interface
439  case GPS_PORT_USB:
440  UbxSend_CFG_PRT(gps_ubx_ucenter.dev,
441  gps_ubx_ucenter.port_id, 0x0, 0x0, 0x0, 0x0,
443  break;
444  case GPS_PORT_SPI:
445  DEBUG_PRINT("WARNING: ublox SPI port is currently not supported.\n");
446  break;
447  default:
448  DEBUG_PRINT("WARNING: Unknown ublox port id: %u\n", gps_ubx_ucenter.port_id);
449  break;
450  }
451 }
452 
453 #define GPS_SBAS_ENABLED 0x01
454 
455 #define GPS_SBAS_RANGING 0x01
456 #define GPS_SBAS_CORRECTIONS 0x02
457 #define GPS_SBAS_INTEGRITY 0x04
458 
459 #define GPS_SBAS_MAX_SBAS 3 // Default ublox setting uses 3 SBAS channels(?)
460 
461 #define GPS_SBAS_AUTOSCAN 0x00
462 
463 static inline void gps_ubx_ucenter_config_sbas(void)
464 {
465  // Since March 2nd 2011 EGNOS is released for aviation purposes
469 }
470 
471 // Text Telemetry for Debugging
472 #undef GOT_PAYLOAD
473 
475 {
476  DEBUG_PRINT("gps_ubx_ucenter_configure nr: %u\n", nr);
477 
478  // Store the reply of the last configuration step and reset
481  }
482 
483  switch (nr) {
484  case 0:
485  // Use old baudrate to issue a baudrate change command
487  break;
488  case 1:
489 #ifndef GPS_I2C
490 #if PRINT_DEBUG_GPS_UBX_UCENTER
492  DEBUG_PRINT("ublox did not acknowledge port configuration.\n");
493  } else {
494  DEBUG_PRINT("Changed ublox baudrate to: %u\n", UART_SPEED(gps_ubx_ucenter.baud_target));
495  }
496 #endif
497  // Now the GPS baudrate should have changed
500 #endif /*GPS_I2C*/
501  UbxSend_MON_GET_VER(gps_ubx_ucenter.dev);
502  break;
503  case 2:
504  case 3:
505  case 4:
506  case 5:
507  // UBX_G5010 takes 0.7 seconds to answer a firmware request
508  // Version info is important for proper configuration as different firmwares have different settings
509  break;
510  case 6:
511  // Configure CFG-NAV(5) message
513  break;
514  case 7:
515  // Geodetic Position Solution
516  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_POSLLH_ID, 1);
517  break;
518  case 8:
519  // Velocity Solution in NED
520  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_VELNED_ID, 1);
521  break;
522  case 9:
523  // Receiver Navigation Status
524  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_STATUS_ID, 1);
525  break;
526  case 10:
527  // Space Vehicle Information
528  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_SVINFO_ID, 10);
529  break;
530  case 11:
531  // Navigation Solution Information
532 #if GPS_UBX_UCENTER_SLOW_NAV_SOL
533  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_SOL_ID, 8);
534 #else
535  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_SOL_ID, 1);
536 #endif
537  break;
538  case 12:
539  // Disable UTM on old Lea4P
540  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_POSUTM_ID, 0);
541  break;
542  case 13:
543  // Enable Position Velocity time solution
544  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_PVT_ID, 1);
545  break;
546  case 14:
547  // SBAS Configuration
549  break;
550  case 15:
551  // Poll Navigation/Measurement Rate Settings
552  UbxSend_CFG_RATE(gps_ubx_ucenter.dev, GPS_UBX_UCENTER_RATE, 0x0001, 0x0000);
553  break;
554  case 16:
555  // Raw Measurement Data
556 #if USE_GPS_UBX_RXM_RAW
557  gps_ubx_ucenter_enable_msg(UBX_RXM_ID, UBX_RXM_RAW_ID, 1);
558 #endif
559  break;
560  case 17:
561  // Subframe Buffer
562 #if USE_GPS_UBX_RXM_SFRB
563  gps_ubx_ucenter_enable_msg(UBX_RXM_ID, UBX_RXM_SFRB_ID, 1);
564 #endif
565  break;
566 #if USE_GPS_UBX_RTCM
567  case 18:
568  DEBUG_PRINT("CFG_DGNSS\n");
569  UbxSend_CFG_DGNSS(gps_ubx_ucenter.dev, 0x03, RESERVED, RESERVED);
570  break;
571  case 19:
572  DEBUG_PRINT("Enable RELPOSNED\n");
573  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_RELPOSNED_ID, 1);
574  break;
575  case 20:
576  DEBUG_PRINT("Enable HPPPOSLLH\n");
577  gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_HPPOSLLH_ID, 1);
578  break;
579  case 21:
580  DEBUG_PRINT("Enable RXM_RTCM\n");
581  gps_ubx_ucenter_enable_msg(UBX_RXM_ID, UBX_RXM_RTCM_ID, 1);
582  break;
583 #endif
584  case 22:
585  // Try to save on non-ROM devices...
586  UbxSend_CFG_CFG(gps_ubx_ucenter.dev, 0x00000000, 0xffffffff, 0x00000000);
587  break;
588  case 23:
589  UbxSend_MON_GET_GNSS(gps_ubx_ucenter.dev);
590  break;
591  case 24:
592  break;
593  case 25:
594 #if DEBUG_GPS_UBX_UCENTER
595  // Debug Downlink the result of all configuration steps: see messages
596  // To view, enable DEBUG message in your telemetry configuration .xml
598  for (int i = 0; i < GPS_UBX_UCENTER_CONFIG_STEPS; i++) {
599  DEBUG_PRINT("%u\n", gps_ubx_ucenter.replies[i]);
600  }
601 #endif
602 #ifdef DOWNLINK_TRANSPORT
603  {
608  }
609 #endif
610  return false;
611  default:
612  break;
613  }
614 
616  return true; // Continue, except for the last case
617 }
618 
620 {
621  return gps_ubx_ucenter.status;
622 }
UBX_UART_MODE_MASK
#define UBX_UART_MODE_MASK
Definition: gps_ubx_ucenter.c:400
GPS_PORT_DDC
#define GPS_PORT_DDC
Definition: gps_ubx_ucenter.c:407
NAV5_DEFAULT_TDOP_MASK
#define NAV5_DEFAULT_TDOP_MASK
Definition: gps_ubx_ucenter.c:363
GPS_UBX_UCENTER_REPLY_ACK
#define GPS_UBX_UCENTER_REPLY_ACK
Definition: gps_ubx_ucenter.c:57
NAV5_DEFAULT_STATIC_HOLD_THRES
#define NAV5_DEFAULT_STATIC_HOLD_THRES
Definition: gps_ubx_ucenter.c:366
GPS_SBAS_AUTOSCAN
#define GPS_SBAS_AUTOSCAN
Definition: gps_ubx_ucenter.c:461
gps_ubx_ucenter_struct::replies
char replies[GPS_UBX_UCENTER_CONFIG_STEPS]
Definition: gps_ubx_ucenter.h:57
RESERVED
#define RESERVED
Definition: gps_ubx_ucenter.c:369
GpsUbx::msg_buf
uint8_t msg_buf[GPS_UBX_MAX_PAYLOAD]
Definition: gps_ubx.h:56
IGNORED
#define IGNORED
Definition: gps_ubx_ucenter.c:368
GpsUbx::msg_class
uint8_t msg_class
Definition: gps_ubx.h:58
GPS_UBX_ENABLE_NMEA_DATA_MASK
#define GPS_UBX_ENABLE_NMEA_DATA_MASK
Definition: gps_ubx_ucenter.c:352
NAV5_DEFAULT_T_ACC
#define NAV5_DEFAULT_T_ACC
Definition: gps_ubx_ucenter.c:365
gps_ubx_ucenter_struct::hw_ver_l
uint16_t hw_ver_l
Definition: gps_ubx_ucenter.h:50
GPS_UBX_NAV5_DYNAMICS
#define GPS_UBX_NAV5_DYNAMICS
Definition: gps_ubx_ucenter.c:348
GPS_SBAS_ENABLED
#define GPS_SBAS_ENABLED
Definition: gps_ubx_ucenter.c:453
gps_ubx_ucenter_struct
Definition: gps_ubx_ucenter.h:37
NMEA_PROTO_MASK
#define NMEA_PROTO_MASK
Definition: gps_ubx_ucenter.c:403
GPS_PORT_UART2
#define GPS_PORT_UART2
Definition: gps_ubx_ucenter.c:409
GPS_UBX_UCENTER_STATUS_WAITING
#define GPS_UBX_UCENTER_STATUS_WAITING
Definition: gps_ubx_ucenter.c:54
GPS_UBX_UCENTER_REPLY_NONE
#define GPS_UBX_UCENTER_REPLY_NONE
Definition: gps_ubx_ucenter.c:56
gps_ubx_ucenter_config_nav
static void gps_ubx_ucenter_config_nav(void)
Definition: gps_ubx_ucenter.c:371
B230400
#define B230400
Definition: uart_arch.h:49
gps_ubx.h
UBX protocol specific code.
DEBUG_PRINT
#define DEBUG_PRINT(...)
Definition: gps_ubx_ucenter.c:39
GPS_UBX_UCENTER_REPLY_NACK
#define GPS_UBX_UCENTER_REPLY_NACK
Definition: gps_ubx_ucenter.c:58
GPS_UBX_UCENTER_REPLY_CFG_PRT
#define GPS_UBX_UCENTER_REPLY_CFG_PRT
Definition: gps_ubx_ucenter.c:60
gps_ubx_ucenter_struct::hw_ver_h
uint16_t hw_ver_h
Definition: gps_ubx_ucenter.h:49
GPS_UBX_UCENTER_STATUS_AUTOBAUD
#define GPS_UBX_UCENTER_STATUS_AUTOBAUD
Definition: gps_ubx_ucenter.c:52
GPS_UBX_UCENTER_STATUS_CONFIG
#define GPS_UBX_UCENTER_STATUS_CONFIG
Definition: gps_ubx_ucenter.c:53
NAV5_MASK
#define NAV5_MASK
Definition: gps_ubx_ucenter.c:355
gps_ubx_ucenter_struct::gnss_in_use
uint8_t gnss_in_use
Definition: gps_ubx_ucenter.h:52
gps_ubx_ucenter_struct::cnt
uint8_t cnt
Definition: gps_ubx_ucenter.h:40
gps_ubx
struct GpsUbx gps_ubx
Definition: gps_ubx.c:75
gps_ubx_ucenter_struct::baud_run
uint32_t baud_run
Definition: gps_ubx_ucenter.h:43
B4800
#define B4800
Definition: uart_arch.h:42
gps_ubx_ucenter_struct::dev
struct link_device * dev
Definition: gps_ubx_ucenter.h:60
GPS_UBX_UCENTER_CONFIG_STEPS
#define GPS_UBX_UCENTER_CONFIG_STEPS
U-Center Variables.
Definition: gps_ubx_ucenter.h:35
NAV_DYN_AIRBORNE_2G
#define NAV_DYN_AIRBORNE_2G
Definition: gps_ubx_ucenter.c:334
GPS_PORT_USB
#define GPS_PORT_USB
Definition: gps_ubx_ucenter.c:410
uart_periph_set_baudrate
void uart_periph_set_baudrate(struct uart_periph *p, uint32_t baud)
Set baudrate.
Definition: uart_arch.c:984
NAV5_DEFAULT_PDOP_MASK
#define NAV5_DEFAULT_PDOP_MASK
Definition: gps_ubx_ucenter.c:362
GPS_SBAS_CORRECTIONS
#define GPS_SBAS_CORRECTIONS
Definition: gps_ubx_ucenter.c:456
gps_ubx_ucenter_struct::baud_target
uint32_t baud_target
Definition: gps_ubx_ucenter.h:44
GPS_SBAS_MAX_SBAS
#define GPS_SBAS_MAX_SBAS
Definition: gps_ubx_ucenter.c:459
gps_ubx_ucenter_struct::sw_ver_l
uint8_t sw_ver_l
Definition: gps_ubx_ucenter.h:47
GPS_UBX_UCENTER_RATE
#define GPS_UBX_UCENTER_RATE
Definition: gps_ubx_ucenter.c:415
GPS_SBAS_RANGING
#define GPS_SBAS_RANGING
Definition: gps_ubx_ucenter.c:455
GpsUbx::msg_id
uint8_t msg_id
Definition: gps_ubx.h:57
GPS_UBX_UCENTER_REPLY_VERSION
#define GPS_UBX_UCENTER_REPLY_VERSION
Definition: gps_ubx_ucenter.c:59
gps_ubx_ucenter_struct::status
uint8_t status
Definition: gps_ubx_ucenter.h:38
gps_ubx_ucenter
struct gps_ubx_ucenter_struct gps_ubx_ucenter
Definition: gps_ubx_ucenter.c:66
uint8_t
unsigned char uint8_t
Definition: types.h:14
gps_ubx_ucenter.h
Configure Ublox GPS.
GPS_UBX_UCENTER_STATUS_STOPPED
#define GPS_UBX_UCENTER_STATUS_STOPPED
Definition: gps_ubx_ucenter.c:51
UART_SPEED
#define UART_SPEED(_def)
Definition: uart_arch.h:54
gps_ubx_ucenter_periodic
void gps_ubx_ucenter_periodic(void)
Definition: gps_ubx_ucenter.c:100
gps_ubx_ucenter_get_status
int gps_ubx_ucenter_get_status(void)
Definition: gps_ubx_ucenter.c:619
GPS_SBAS_INTEGRITY
#define GPS_SBAS_INTEGRITY
Definition: gps_ubx_ucenter.c:457
gps_ubx_ucenter_config_sbas
static void gps_ubx_ucenter_config_sbas(void)
Definition: gps_ubx_ucenter.c:463
B57600
#define B57600
Definition: uart_arch.h:46
gps_ubx_ucenter_config_port_poll
static void gps_ubx_ucenter_config_port_poll(void)
Polls the u-blox port configuration When the payload is omitted (zero length), the configuration for ...
Definition: gps_ubx_ucenter.c:220
gps_ubx_ucenter_enable_msg
static void gps_ubx_ucenter_enable_msg(uint8_t class, uint8_t id, uint8_t rate)
Enable u-blox message at desired period.
Definition: gps_ubx_ucenter.c:237
NAV5_DEFAULT_P_ACC
#define NAV5_DEFAULT_P_ACC
Definition: gps_ubx_ucenter.c:364
B9600
#define B9600
Definition: uart_arch.h:43
gps_ubx_ucenter_autobaud
static bool gps_ubx_ucenter_autobaud(uint8_t nr)
Automatically determine the baudrate of the u-blox module.
Definition: gps_ubx_ucenter.c:251
B38400
#define B38400
Definition: uart_arch.h:45
gps_ubx_ucenter_configure
static bool gps_ubx_ucenter_configure(uint8_t nr)
Definition: gps_ubx_ucenter.c:474
UBX_GPS_BAUD
#define UBX_GPS_BAUD
Definition: gps_ubx_ucenter.c:63
gps_i2c_begin
void gps_i2c_begin(void)
config is done, begin reading messages
Definition: gps_ubx_i2c.c:160
GPS_PORT_UART1
#define GPS_PORT_UART1
Definition: gps_ubx_ucenter.c:408
gps_ubx_ucenter_event
void gps_ubx_ucenter_event(void)
Definition: gps_ubx_ucenter.c:159
NAV5_DEFAULT_MIN_ELEV
#define NAV5_DEFAULT_MIN_ELEV
Definition: gps_ubx_ucenter.c:361
logger_uart_parse.nr
nr
Definition: logger_uart_parse.py:9
FALSE
#define FALSE
Definition: std.h:5
gps_ubx_ucenter_config_port
static void gps_ubx_ucenter_config_port(void)
Definition: gps_ubx_ucenter.c:418
gps_ubx_ucenter_struct::sw_ver_h
uint8_t sw_ver_h
Definition: gps_ubx_ucenter.h:46
gps_ubx_ucenter_struct::baud_init
uint32_t baud_init
Definition: gps_ubx_ucenter.h:42
NAV5_3D_ONLY
#define NAV5_3D_ONLY
Definition: gps_ubx_ucenter.c:358
UBX_PROTO_MASK
#define UBX_PROTO_MASK
Definition: gps_ubx_ucenter.c:402
gps_i2c_tx_is_ready
bool gps_i2c_tx_is_ready(void)
is driver ready to send a message
Definition: gps_ubx_i2c.c:155
GPS_PORT_SPI
#define GPS_PORT_SPI
Definition: gps_ubx_ucenter.c:411
gps_ubx_ucenter_struct::port_id
uint8_t port_id
Port identifier number.
Definition: gps_ubx_ucenter.h:55
gps_ubx_ucenter_struct::reply
uint8_t reply
Definition: gps_ubx_ucenter.h:39
gps_ubx_ucenter_init
void gps_ubx_ucenter_init(void)
Definition: gps_ubx_ucenter.c:72
RTCM3_PROTO_MASK
#define RTCM3_PROTO_MASK
Definition: gps_ubx_ucenter.c:405
B115200
#define B115200
Definition: uart_arch.h:48