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

Generic interface for sensors. More...

#include "pios_sensors.h"
#include <stddef.h>
#include <pios_thread.h>

Go to the source code of this file.

Data Structures

struct  PIOS_Sensor
 The list of queue handles / callbacks. More...
 

Functions

int32_t PIOS_SENSORS_Init ()
 Initialize the PIOS_SENSORS interface. More...
 
static bool PIOS_SENSORS_QueueCallback (void *ctx, void *buf, int ms_to_wait, int *next_call)
 
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...
 
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...
 
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...
 

Variables

static struct PIOS_Sensor sensors [PIOS_SENSOR_NUM]
 
static int32_t max_gyro_rate
 

Detailed Description

Generic interface for sensors.

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

Definition in file pios_sensors.c.