Paparazzi UAS  v5.15_devel-229-g3fb4ee4
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pmw3901.h File Reference
#include "mcu_periph/spi.h"
#include <stdbool.h>
#include <math.h>
+ Include dependency graph for pmw3901.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pmw3901_t
 

Macros

#define SPI_BUFFER_SIZE   8
 

Enumerations

enum  pmw3901_state {
  PMW3901_IDLE, PMW3901_READ_MOTION, PMW3901_READ_DELTAXLOW, PMW3901_READ_DELTAXHIGH,
  PMW3901_READ_DELTAYLOW, PMW3901_READ_DELTAYHIGH
}
 

Functions

void pmw3901_init (struct pmw3901_t *pmw, struct spi_periph *periph, uint8_t slave_idx)
 
void pmw3901_event (struct pmw3901_t *pmw)
 
bool pmw3901_is_idle (struct pmw3901_t *pmw)
 
void pmw3901_start_read (struct pmw3901_t *pmw)
 
bool pmw3901_data_available (struct pmw3901_t *pmw)
 
bool pmw3901_get_data (struct pmw3901_t *pmw, int16_t *delta_x, int16_t *delta_y)
 

Data Structure Documentation

struct pmw3901_t

Definition at line 60 of file pmw3901.h.

+ Collaboration diagram for pmw3901_t:
Data Fields
bool data_available
int16_t delta_x
int16_t delta_y
struct spi_periph * periph
float rad_per_px
uint8_t readwrite_state
uint32_t readwrite_timeout
volatile uint8_t spi_input_buf[SPI_BUFFER_SIZE]
volatile uint8_t spi_output_buf[SPI_BUFFER_SIZE]
enum pmw3901_state state
struct spi_transaction trans

Macro Definition Documentation

#define SPI_BUFFER_SIZE   8

Definition at line 48 of file pmw3901.h.

Enumeration Type Documentation

Enumerator
PMW3901_IDLE 
PMW3901_READ_MOTION 
PMW3901_READ_DELTAXLOW 
PMW3901_READ_DELTAXHIGH 
PMW3901_READ_DELTAYLOW 
PMW3901_READ_DELTAYHIGH 

Definition at line 51 of file pmw3901.h.

Function Documentation

bool pmw3901_data_available ( struct pmw3901_t pmw)

Definition at line 322 of file pmw3901.c.

References pmw3901_t::data_available.

Referenced by opticflow_pmw3901_event().

+ Here is the caller graph for this function:

bool pmw3901_get_data ( struct pmw3901_t pmw,
int16_t delta_x,
int16_t delta_y 
)

Definition at line 326 of file pmw3901.c.

References pmw3901_t::data_available, pmw3901_t::delta_x, and pmw3901_t::delta_y.

Referenced by opticflow_pmw3901_event().

+ Here is the caller graph for this function:

bool pmw3901_is_idle ( struct pmw3901_t pmw)

Definition at line 312 of file pmw3901.c.

References PMW3901_IDLE, and pmw3901_t::state.

Referenced by opticflow_pmw3901_periodic(), and pmw3901_start_read().

+ Here is the caller graph for this function:

void pmw3901_start_read ( struct pmw3901_t pmw)

Definition at line 316 of file pmw3901.c.

References pmw3901_is_idle(), PMW3901_READ_MOTION, and pmw3901_t::state.

Referenced by opticflow_pmw3901_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: