Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
EzOSD Current sensor (I2C)

Module XML file: ezcurrent.xml

Example for airframe file

This example contains all possible configuration options, not all of them are mandatory!

1 <modules>
2  <load name="ezcurrent.xml">
3  <configure name="EZCURRENT_I2C_DEV" value="i2c1" />
4  </load>
5 </modules>

Module configuration options

Configure Options

  • name: EZCURRENT_I2C_DEV value: i2c1
    Description: change default i2c peripheral to i2c1

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.

  • ezcurrent_read_periodic()
    • Frequency in Hz: 1.
    • 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 ezcurrent.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="ezcurrent" dir="sensors">
<doc>
<description>EzOSD Current sensor (I2C).</description>
<configure name="EZCURRENT_I2C_DEV" value="i2c1" description="change default i2c peripheral to i2c1"/>
</doc>
<header>
<file name="ezcurrent.h"/>
</header>
<init fun="ezcurrent_init()"/>
<periodic fun="ezcurrent_read_periodic()" freq="1."/>
<event fun="ezcurrent_read_event()"/>
<makefile target="ap">
<raw>
EZCURRENT_I2C_DEV ?= i2c0
EZCURRENT_I2C_DEV_LOWER=$(shell echo $(EZCURRENT_I2C_DEV) | tr A-Z a-z)
EZCURRENT_I2C_DEV_UPPER=$(shell echo $(EZCURRENT_I2C_DEV) | tr a-z A-Z)
</raw>
<define name="USE_$(EZCURRENT_I2C_DEV_UPPER)"/>
<define name="EZCURRENT_I2C_DEV" value="$(EZCURRENT_I2C_DEV_LOWER)"/>
<file name="ezcurrent.c"/>
<!-- This disables the standard electrical monitoring system -->
<define name="DISABLE_ELECTRICAL" description="Disable default electrical handling"/>
</makefile>
</module>