Module XML file: ins_vn100.xml
No detailed description...
Example for airframe file
This example contains all possible configuration options, not all of them are mandatory!
2 <load name="ins_vn100.xml">
3 <configure name="VN100_SPI_DEV" value="spiX" />
4 <configure name="VN100_SLAVE_IDX" value="SPI_SLAVEX" />
Module configuration options
Configure Options
- name:
VN100_SPI_DEV
value: spiX
Description: select spi peripherals (default spi1)
- name:
VN100_SLAVE_IDX
value: SPI_SLAVEX
Description: spi slave index
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.
- vn100_periodic_task()
- Frequency in Hz: 60
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
- vn100_report_task()
- Frequency in Hz: 4
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw ins_vn100.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="vn100" dir="ins">
<doc>
<description>VectorNav VN100 (SPI)</description>
<configure name="VN100_SPI_DEV" value="spiX" description="select spi peripherals (default spi1)"/>
<configure name="VN100_SLAVE_IDX" value="SPI_SLAVEX" description="spi slave index"/>
</doc>
<!-- <conflicts>ins</conflicts> -->
<header>
<file name="ins_vn100.h"/>
</header>
<init fun="vn100_init()"/>
<periodic fun="vn100_periodic_task()" freq="60"/>
<periodic fun="vn100_report_task()" freq="4"/>
<event fun="vn100_event_task()"/>
<makefile>
<raw>
VN100_SPI_DEV ?= spi1
VN100_SPI_DEV_LOWER=$(shell echo $(VN100_SPI_DEV) | tr A-Z a-z)
VN100_SPI_DEV_UPPER=$(shell echo $(VN100_SPI_DEV) | tr a-z A-Z)
VN100_SLAVE_IDX ?= spi_slave0
VN100_SLAVE_IDX_LOWER=$(shell echo $(VN100_SLAVE_IDX) | tr A-Z a-z)
VN100_SLAVE_IDX_UPPER=$(shell echo $(VN100_SLAVE_IDX) | tr a-z A-Z)
include $(CFG_SHARED)/spi_master.makefile
</raw>
<define name="USE_$(VN100_SPI_DEV_UPPER)" />
<define name="USE_$(VN100_SLAVE_IDX_UPPER)" />
<define name="VN100_SPI_DEV" value="$(VN100_SPI_DEV_LOWER)" />
<define name="VN100_SLAVE_IDX" value="$(VN100_SLAVE_IDX_UPPER)" />
<file name="ins_vn100.c"/>
</makefile>
</module>