Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
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) |
struct 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 |
enum pmw3901_state |
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().
void pmw3901_event | ( | struct pmw3901_t * | pmw | ) |
Definition at line 274 of file pmw3901.c.
References pmw3901_t::data_available, pmw3901_t::delta_x, pmw3901_t::delta_y, PMW3901_IDLE, PMW3901_READ_DELTAXHIGH, PMW3901_READ_DELTAXLOW, PMW3901_READ_DELTAYHIGH, PMW3901_READ_DELTAYLOW, PMW3901_READ_MOTION, PMW3901_REG_DELTA_X_H, PMW3901_REG_DELTA_X_L, PMW3901_REG_DELTA_Y_H, PMW3901_REG_DELTA_Y_L, PMW3901_REG_MOTION, readRegister_nonblocking(), and pmw3901_t::state.
Referenced by opticflow_pmw3901_event().
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().
void pmw3901_init | ( | struct pmw3901_t * | pmw, |
struct spi_periph * | periph, | ||
uint8_t | slave_idx | ||
) |
Definition at line 249 of file pmw3901.c.
References spi_transaction::after_cb, spi_transaction::before_cb, spi_transaction::bitorder, spi_transaction::cdiv, spi_transaction::cpha, spi_transaction::cpol, pmw3901_t::data_available, pmw3901_t::delta_x, pmw3901_t::delta_y, spi_transaction::dss, initializeSensor(), spi_transaction::input_buf, spi_transaction::output_buf, pmw3901_t::periph, PMW3901_IDLE, PMW3901_RAD_PER_PX, PMW3901_SPI_CDIV, pmw3901_t::rad_per_px, spi_transaction::select, spi_transaction::slave_idx, pmw3901_t::spi_input_buf, pmw3901_t::spi_output_buf, SPICphaEdge1, SPICpolIdleLow, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, pmw3901_t::state, spi_transaction::status, and pmw3901_t::trans.
Referenced by opticflow_pmw3901_init().
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().
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().