Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
bat_voltage_ardrone2.c File Reference

Read battery voltage on ARDrone2 and publish to electrical subsystem. More...

#include "modules/sensors/bat_voltage_ardrone2.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/time.h>
#include <unistd.h>
#include <math.h>
#include "mcu_periph/i2c_smbus.h"
#include "modules/energy/electrical.h"
+ Include dependency graph for bat_voltage_ardrone2.c:

Go to the source code of this file.

Functions

void electrical_ardrone2_setup (void)
 
void bat_voltage_ardrone2_init (void)
 
void bat_voltage_ardrone2_periodic (void)
 

Variables

static int fd
 

Detailed Description

Read battery voltage on ARDrone2 and publish to electrical subsystem.

Read the battery voltage on ARDrone2.

Definition in file bat_voltage_ardrone2.c.

Function Documentation

◆ bat_voltage_ardrone2_init()

void bat_voltage_ardrone2_init ( void  )

Definition at line 48 of file bat_voltage_ardrone2.c.

References electrical_ardrone2_setup(), fd, and I2C_SLAVE_FORCE.

+ Here is the call graph for this function:

◆ bat_voltage_ardrone2_periodic()

void bat_voltage_ardrone2_periodic ( void  )

Definition at line 89 of file bat_voltage_ardrone2.c.

References electrical, electrical_ardrone2_setup(), fd, i2c_smbus_read_byte_data(), and Electrical::vsupply.

+ Here is the call graph for this function:

◆ electrical_ardrone2_setup()

void electrical_ardrone2_setup ( void  )

Definition at line 65 of file bat_voltage_ardrone2.c.

References fd, and i2c_smbus_write_byte_data().

Referenced by bat_voltage_ardrone2_init(), and bat_voltage_ardrone2_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ fd