Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
pmw3901.h File Reference
#include "mcu_periph/spi.h"
#include "modules/core/threads.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_DELTAXHIGH , PMW3901_READ_DELTAXLOW ,
  PMW3901_READ_DELTAYHIGH , PMW3901_READ_DELTAYLOW
}
 

Functions

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

Data Structure Documentation

◆ pmw3901_t

struct pmw3901_t

Definition at line 61 of file pmw3901.h.

+ Collaboration diagram for pmw3901_t:
Data Fields
pprz_bsem_t bsem
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
pprz_thread_t thd_handle
struct spi_transaction trans

Macro Definition Documentation

◆ SPI_BUFFER_SIZE

#define SPI_BUFFER_SIZE   8

Definition at line 49 of file pmw3901.h.

Enumeration Type Documentation

◆ pmw3901_state

Enumerator
PMW3901_IDLE 
PMW3901_READ_MOTION 
PMW3901_READ_DELTAXHIGH 
PMW3901_READ_DELTAXLOW 
PMW3901_READ_DELTAYHIGH 
PMW3901_READ_DELTAYLOW 

Definition at line 52 of file pmw3901.h.

Function Documentation

◆ pmw3901_get_data()

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

Definition at line 260 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:

◆ pmw3901_init()