Telemetry using PPRZ protocol over Bluegiga modules
Bluegiga is a SPI-slave device without Chip select but with a compulsory DRDY
Required: BLUEGIGA_SPI_DEV: the SPI device which MUST have a SLAVE mode without chipselect
Optional: (defaults to SUPERBITRF DRDY) BLUEGIGA_DRDY_GPIO BLUEGIGA_DRDY_GPIO_PIN
On Lisa-s, the Superbit-RF module can be replaced with a bluegiga-bluetooth 4 low power board. This module puts the telemetry over this bluetooth 4 link.
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="telemetry_bluegiga">
b'<define name="BLUEGIGA_DRDY_GPIO" value="GPIOX" />\n '
b'<define name="BLUEGIGA_DRDY_GPIO_PIN" value="GPIOY" />\n '
b'<configure name="BLUEGIGA_SPI_DEV" value="SPIx" />\n '
b'<configure name="MODEM_LED" value="none" />\n '
</module>
Module configuration options
Configure Options
- name:
BLUEGIGA_SPI_DEV
value: SPIx
Description: SPI where the modem is connected to (SPI1, SPI2, etc)
- name:
MODEM_LED
value: none
Description: LED number for modem status, 'none' to disable
Define Options
- name:
BLUEGIGA_DRDY_GPIO
value: GPIOX
Description: GPIO port used for data ready pin
- name:
BLUEGIGA_DRDY_GPIO_PIN
value: GPIOY
Description: GPIO pin number used for data ready pin
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.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw telemetry_bluegiga.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="telemetry_bluegiga" dir="datalink" task="datalink">
<doc>
<description>
Telemetry using PPRZ protocol over Bluegiga modules
Bluegiga is a SPI-slave device without Chip select but with a compulsory DRDY
Required:
BLUEGIGA_SPI_DEV: the SPI device which MUST have a SLAVE mode without chipselect
Optional: (defaults to SUPERBITRF DRDY)
BLUEGIGA_DRDY_GPIO
BLUEGIGA_DRDY_GPIO_PIN
On Lisa-s, the Superbit-RF module can be replaced with a bluegiga-bluetooth 4 low power board.
This module puts the telemetry over this bluetooth 4 link.
</description>
<configure name="BLUEGIGA_SPI_DEV" value="SPIx" description="SPI where the modem is connected to (SPI1, SPI2, etc)"/>
<configure name="MODEM_LED" value="none" description="LED number for modem status, 'none' to disable"/>
<define name="BLUEGIGA_DRDY_GPIO" value="GPIOX" description="GPIO port used for data ready pin"/>
<define name="BLUEGIGA_DRDY_GPIO_PIN" value="GPIOY" description="GPIO pin number used for data ready pin"/>
</doc>
<dep>
<depends>spi_master,datalink_common</depends>
<provides>datalink,telemetry</provides>
</dep>
<header>
<file name="bluegiga_dl.h"/>
</header>
<init fun="bluegiga_dl_init()"/>
<event fun="bluegiga_dl_event()"/>
<makefile target="!sim|nps">
<configure name="BLUEGIGA_SPI_DEV" default="SPI2" case="upper|lower"/>
<configure name="MODEM_LED" default="none"/>
<define name="USE_$(BLUEGIGA_SPI_DEV_UPPER)_SLAVE"/>
<define name="SPI_SLAVE"/>
<define name="BLUEGIGA_SPI_DEV" value="$(BLUEGIGA_SPI_DEV_LOWER)"/>
<define name="MODEM_LED" value="$(MODEM_LED)" cond="ifneq ($(MODEM_LED),none)"/>
<define name="DOWNLINK_DEVICE" value="bluegiga_p"/>
<define name="DOWNLINK_TRANSPORT" value="pprz_bg_tp"/>
<define name="DATALINK" value="BLUEGIGA"/>
<file name="bluegiga_dl.c"/>
<file name="pprz_transport.c" dir="pprzlink/src"/>
<file name="bluegiga.c"/>
<test>
<define name="BLUEGIGA_DRDY_GPIO" value="GPIOA"/>
<define name="BLUEGIGA_DRDY_GPIO_PIN" value="GPIO0"/>
<define name="DOWNLINK_DEVICE" value="bluegiga_p"/>
<define name="BLUEGIGA_SPI_DEV" value="spi2"/>
<define name="SPI_SLAVE"/>
<define name="USE_SPI2_SLAVE"/>
</test>
</makefile>
</module>