Sirf GPS (UART)
Driver for GPS modules using the Sirf binary protocol.
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="gps_sirf">
b'<configure name="SIRF_GPS_PORT" value="UARTx" />\n '
b'<configure name="SIRF_GPS_BAUD" value="B38400" />\n '
</module>
Module configuration options
Configure Options
- name:
SIRF_GPS_PORT
value: UARTx
Description: UART where the GPS is connected to (UART1, UART2, etc
- name:
SIRF_GPS_BAUD
value: B38400
Description: UART baud rate
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_sirf.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_sirf" dir="gps" task="sensors">
<doc>
<description>
Sirf GPS (UART)
Driver for GPS modules using the Sirf binary protocol.
</description>
<configure name="SIRF_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="SIRF_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<dep>
<depends>uart,gps</depends>
<provides>gps</provides>
</dep>
<header>
<file name="gps.h"/>
</header>
<init fun="gps_sirf_init()"/>
<periodic fun="gps_sirf_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_sirf_event()"/>
<makefile target="ap|fbw">
<configure name="SIRF_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="SIRF_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_sirf.c"/>
<define name="USE_$(SIRF_GPS_PORT_UPPER)"/>
<define name="SIRF_GPS_LINK" value="$(SIRF_GPS_PORT_LOWER)"/>
<define name="$(SIRF_GPS_PORT_UPPER)_BAUD" value="$(SIRF_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), sirf))
# this is the secondary GPS
$(TARGET).CFLAGS += -DGPS_SECONDARY_TYPE_H=\"modules/gps/gps_sirf.h\"
$(TARGET).CFLAGS += -DSECONDARY_GPS=GPS_SIRF
else
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_sirf.h\"
$(TARGET).CFLAGS += -DPRIMARY_GPS=GPS_SIRF
endif
else
# plain old single GPS usage
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_sirf.h\"
endif
</raw>
<test>
<define name="PRIMARY_GPS" value="GPS_SIRF"/>
<define name="SIRF_GPS_PORT" value="uart2"/>
<define name="SIRF_GPS_BAUD" value="115200"/>
<define name="USE_UART2"/>
<define name="SIRF_GPS_LINK" value="uart2"/>
</test>
</makefile>
<makefile target="fbw">
<define name="USE_GPS"/>
</makefile>
</module>