Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ezcurrent module

EzOSD Current sensor (I2C).

No detailed description...

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

<module name="ezcurrent">
b'<configure name="EZCURRENT_I2C_DEV" value="i2c1" />\n '
</module>

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">
<configure name="EZCURRENT_I2C_DEV" default="i2c0" case="upper|lower"/>
<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>