U-blox GPS (UART)
Driver for u-blox GPS modules parsing the binary UBX protocol.
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
1 <module name="gps_ublox">
2 <configure name="UBX_GPS_PORT" value="UARTx" />
3 <configure name="UBX_GPS_BAUD" value="B38400" />
Module configuration options
Configure Options
- name:
UBX_GPS_PORT
value: UARTx
Description: UART where the GPS is connected to (UART1, UART2, etc
- name:
UBX_GPS_BAUD
value: B38400
Description: UART baud rate
Auto-loaded modules
The following modules are automatically loaded (just as if you had added them in the airframe file)
Module functions
Init Functions
These initialization functions are called once on startup.
Event Functions
These event functions are called in each cycle of the module event loop.
Periodic Functions
These functions are called periodically at the specified frequency from the module periodic loop.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw gps_ublox.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_ublox" dir="gps">
<doc>
<description>
U-blox GPS (UART)
Driver for u-blox GPS modules parsing the binary UBX protocol.
</description>
<configure name="UBX_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="UBX_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_ubx_init()"/>
<periodic fun="gps_ubx_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_ubx_event()"/>
<makefile target="ap">
<configure name="UBX_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="UBX_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_ubx.c" dir="subsystems/gps"/>
<define name="USE_$(UBX_GPS_PORT_UPPER)"/>
<define name="UBX_GPS_LINK" value="$(UBX_GPS_PORT_LOWER)"/>
<define name="$(UBX_GPS_PORT_UPPER)_BAUD" value="$(UBX_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), ublox))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_ubx.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_UBX
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_UBX
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
endif
</raw>
</makefile>
</module>