dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_sensors.h File Reference

Generic interface for sensors. More...

#include "pios.h"
#include "stdint.h"
#include "pios_queue.h"

Go to the source code of this file.

Data Structures

struct  pios_sensor_gyro_data
 Pios sensor structure for generic gyro data. More...
 
struct  pios_sensor_accel_data
 Pios sensor structure for generic accel data. More...
 
struct  pios_sensor_mag_data
 Pios sensor structure for generic mag data. More...
 
struct  pios_sensor_optical_flow_data
 Pios sensor structure for generic mag data. More...
 
struct  pios_sensor_rangefinder_data
 Pios sensor structure for generic rangefinder data. More...
 
struct  pios_sensor_baro_data
 Pios sensor structure for generic baro data. More...
 

Typedefs

typedef bool(* PIOS_SENSOR_Callback_t )(void *ctx, void *output, int ms_to_wait, int *next_call)
 Function that calls into sensor to get data. More...
 

Enumerations

enum  pios_sensor_type {
  PIOS_SENSOR_ACCEL, PIOS_SENSOR_GYRO, PIOS_SENSOR_MAG, PIOS_SENSOR_BARO,
  PIOS_SENSOR_OPTICAL_FLOW, PIOS_SENSOR_RANGEFINDER, PIOS_SENSOR_NUM
}
 The types of sensors this module supports. More...
 

Functions

int32_t PIOS_SENSORS_Init ()
 Initialize the PIOS_SENSORS interface. More...
 
int32_t PIOS_SENSORS_Register (enum pios_sensor_type type, struct pios_queue *queue)
 Register a queue-based sensor with the PIOS_SENSORS interface. More...
 
int32_t PIOS_SENSORS_RegisterCallback (enum pios_sensor_type type, PIOS_SENSOR_Callback_t callback, void *ctx)
 Register a callback-based sensor with the PIOS_SENSORS interface. More...
 
bool PIOS_SENSORS_IsRegistered (enum pios_sensor_type type)
 Checks if a sensor type is registered with the PIOS_SENSORS interface. More...
 
bool PIOS_SENSORS_GetData (enum pios_sensor_type type, void *buf, int ms_to_wait)
 Get the data for a sensor type. More...
 
void PIOS_SENSORS_SetMaxGyro (int32_t rate)
 Set the maximum gyro rate in deg/s. More...
 
int32_t PIOS_SENSORS_GetMaxGyro ()
 Get the maximum gyro rate in deg/s. More...
 
void PIOS_SENSORS_SetSampleRate (enum pios_sensor_type type, uint32_t sample_rate)
 Set the sample rate of a sensor (Hz) More...
 
uint32_t PIOS_SENSORS_GetSampleRate (enum pios_sensor_type type)
 Get the sample rate of a sensor (Hz) More...
 
void PIOS_SENSORS_SetMissing (enum pios_sensor_type type)
 Assert that an optional (non-accel/gyro), but expected sensor is missing. More...
 
bool PIOS_SENSORS_GetMissing (enum pios_sensor_type type)
 Determine if an optional but expected sensor is missing. More...
 

Detailed Description

Generic interface for sensors.

Author
Tau Labs, http://taulabs.org, Copyright (C) 2012-2014
See Also
The GNU Public License (GPL) Version 3

Definition in file pios_sensors.h.