Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
charge_sens.c File Reference

I2C interface for University of Reading charge sensor. More...

#include "modules/meteo/charge_sens.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
+ Include dependency graph for charge_sens.c:

Go to the source code of this file.

Macros

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE
 
#define CHARGE_SENS_DEV   i2c0
 
#define CHARGE_SENS_I2C_ADDR   0x78
 
#define CHARGE_NB   10
 

Functions

void charge_sens_init (void)
 
void charge_sens_periodic (void)
 
void charge_sens_event (void)
 

Variables

struct i2c_transaction charge_trans
 
uint16_t charge [CHARGE_NB]
 
int32_t charge_cnt
 

Detailed Description

I2C interface for University of Reading charge sensor.

Definition in file charge_sens.c.

Macro Definition Documentation

#define CHARGE_NB   10

Definition at line 43 of file charge_sens.c.

Referenced by charge_sens_event().

#define CHARGE_SENS_DEV   i2c0

Definition at line 39 of file charge_sens.c.

Referenced by charge_sens_periodic().

#define CHARGE_SENS_I2C_ADDR   0x78

Definition at line 42 of file charge_sens.c.

Referenced by charge_sens_periodic().

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE

Definition at line 35 of file charge_sens.c.

Function Documentation

void charge_sens_event ( void  )
void charge_sens_init ( void  )

Definition at line 49 of file charge_sens.c.

References charge_cnt.

void charge_sens_periodic ( void  )

Definition at line 53 of file charge_sens.c.

References CHARGE_SENS_DEV, CHARGE_SENS_I2C_ADDR, charge_trans, and i2c_receive().

+ Here is the call graph for this function:

Variable Documentation

Definition at line 46 of file charge_sens.c.

Referenced by charge_sens_event().

int32_t charge_cnt

Definition at line 47 of file charge_sens.c.

Referenced by charge_sens_event(), and charge_sens_init().

struct i2c_transaction charge_trans

Definition at line 45 of file charge_sens.c.

Referenced by charge_sens_event(), and charge_sens_periodic().