Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
dust_gp2y.c File Reference

Sharp GP2Y1010AU dust sensor interface. More...

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

Go to the source code of this file.

Macros

#define GP2Y_I2C_DEV   i2c0
 
#define GP2Y_SLAVE_ADDR   0xED
 

Functions

void dust_gp2y_init (void)
 
void dust_gp2y_periodic (void)
 
void dust_gp2y_event (void)
 

Variables

uint8_t dust_gp2y_status
 
uint16_t dust_gp2y_density
 
float dust_gp2y_density_f
 
struct i2c_transaction gp2y_trans
 

Detailed Description

Sharp GP2Y1010AU dust sensor interface.

This reads the values for dust density from the Sharp GP2Y1010AU0F sensor through I2C (needs I2C ADC at the sensor).

Definition in file dust_gp2y.c.

Macro Definition Documentation

#define GP2Y_I2C_DEV   i2c0

Definition at line 46 of file dust_gp2y.c.

Referenced by dust_gp2y_periodic().

#define GP2Y_SLAVE_ADDR   0xED

Definition at line 49 of file dust_gp2y.c.

Referenced by dust_gp2y_periodic().

Function Documentation

void dust_gp2y_init ( void  )

Definition at line 51 of file dust_gp2y.c.

References dust_gp2y_status, and DUST_GP2Y_UNINIT.

void dust_gp2y_periodic ( void  )

Definition at line 56 of file dust_gp2y.c.

References DUST_GP2Y_IDLE, dust_gp2y_status, DUST_GP2Y_UNINIT, GP2Y_I2C_DEV, GP2Y_SLAVE_ADDR, gp2y_trans, i2c_receive(), and sys_time::nb_sec.

+ Here is the call graph for this function:

Variable Documentation

uint16_t dust_gp2y_density

Definition at line 39 of file dust_gp2y.c.

Referenced by dust_gp2y_event().

float dust_gp2y_density_f

Definition at line 40 of file dust_gp2y.c.

Referenced by dust_gp2y_event().

uint8_t dust_gp2y_status

Definition at line 38 of file dust_gp2y.c.

Referenced by dust_gp2y_init(), and dust_gp2y_periodic().

struct i2c_transaction gp2y_trans

Definition at line 42 of file dust_gp2y.c.

Referenced by dust_gp2y_event(), and dust_gp2y_periodic().