Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
opticflow_pmw3901.c File Reference
#include "modules/sensors/opticflow_pmw3901.h"
#include "modules/core/abi.h"
#include "modules/datalink/downlink.h"
#include "generated/modules.h"
#include "state.h"
#include "std.h"
#include <math.h>
+ Include dependency graph for opticflow_pmw3901.c:

Go to the source code of this file.

Macros

#define OPTICFLOW_PMW3901_SENSOR_ANGLE   270
 
#define OPTICFLOW_PMW3901_SUBPIXEL_FACTOR   100
 
#define OPTICFLOW_PMW3901_STD_PX   50
 
#define OPTICFLOW_PMW3901_AGL_ID   ABI_BROADCAST
 
#define OPTICFLOW_PMW3901_AGL_TIMEOUT_US   500000
 

Functions

static void agl_cb (uint8_t sender_id, uint32_t stamp, float distance)
 
static bool agl_valid (uint32_t at_ts)
 
static void opticflow_pmw3901_publish (int16_t delta_x, int16_t delta_y, uint32_t ts_usec)
 
void opticflow_pmw3901_init (void)
 
void opticflow_pmw3901_periodic (void)
 
void opticflow_pmw3901_event (void)
 

Variables

struct opticflow_pmw3901_t of_pmw
 
abi_event agl_ev
 
static float agl_dist
 
static uint32_t agl_ts
 

Detailed Description

Author
Tom van Dijk Driver for PMW3901 optical flow sensor

Definition in file opticflow_pmw3901.c.

Macro Definition Documentation

◆ OPTICFLOW_PMW3901_AGL_ID

#define OPTICFLOW_PMW3901_AGL_ID   ABI_BROADCAST

Definition at line 52 of file opticflow_pmw3901.c.

◆ OPTICFLOW_PMW3901_AGL_TIMEOUT_US

#define OPTICFLOW_PMW3901_AGL_TIMEOUT_US   500000

Definition at line 57 of file opticflow_pmw3901.c.

◆ OPTICFLOW_PMW3901_SENSOR_ANGLE

#define OPTICFLOW_PMW3901_SENSOR_ANGLE   270

Definition at line 40 of file opticflow_pmw3901.c.

◆ OPTICFLOW_PMW3901_STD_PX

#define OPTICFLOW_PMW3901_STD_PX   50

Definition at line 48 of file opticflow_pmw3901.c.

◆ OPTICFLOW_PMW3901_SUBPIXEL_FACTOR

#define OPTICFLOW_PMW3901_SUBPIXEL_FACTOR   100

Definition at line 44 of file opticflow_pmw3901.c.

Function Documentation

◆ agl_cb()

static void agl_cb ( uint8_t  sender_id,
uint32_t  stamp,
float  distance 
)
static

Definition at line 68 of file opticflow_pmw3901.c.

References agl_dist, and agl_ts.

Referenced by opticflow_pmw3901_init().

+ Here is the caller graph for this function:

◆ agl_valid()

static bool agl_valid ( uint32_t  at_ts)
static

Definition at line 74 of file opticflow_pmw3901.c.

References agl_dist, opticflow_pmw3901_t::agl_timeout, agl_ts, and of_pmw.

Referenced by opticflow_pmw3901_publish().

+ Here is the caller graph for this function:

◆ opticflow_pmw3901_event()

void opticflow_pmw3901_event ( void  )

◆ opticflow_pmw3901_init()

◆ opticflow_pmw3901_periodic()

void opticflow_pmw3901_periodic ( void  )

Definition at line 180 of file opticflow_pmw3901.c.

References of_pmw, opticflow_pmw3901_t::pmw, pmw3901_is_idle(), and pmw3901_start_read().

+ Here is the call graph for this function:

◆ opticflow_pmw3901_publish()

static void opticflow_pmw3901_publish ( int16_t  delta_x,
int16_t  delta_y,
uint32_t  ts_usec 
)
static

Variable Documentation

◆ agl_dist

float agl_dist
static

Definition at line 64 of file opticflow_pmw3901.c.

Referenced by agl_cb(), agl_valid(), and opticflow_pmw3901_publish().

◆ agl_ev

abi_event agl_ev

Definition at line 63 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

◆ agl_ts

uint32_t agl_ts
static

Definition at line 65 of file opticflow_pmw3901.c.

Referenced by agl_cb(), and agl_valid().

◆ of_pmw