ChibiOS/HAL  6.1.0

HAL Generic Sensor Interface. More...

Collaboration diagram for Generic Sensor Interface:

Detailed Description

HAL Generic Sensor Interface.

Macros

#define _base_sensor_methods_alone
 BaseSensor specific methods. More...
 
#define _base_sensor_methods
 BaseSensor specific methods with inherited ones. More...
 
#define _base_sensor_data
 BaseSensor specific data. More...
 

Macro Functions (BaseSensor)

#define sensorGetChannelNumber(ip)   (ip)->vmt->get_channels_number(ip)
 Sensors get channels number. More...
 
#define sensorReadRaw(ip, dp)   (ip)->vmt->read_raw(ip, dp)
 Sensors read raw data. More...
 
#define sensorReadCooked(ip, dp)   (ip)->vmt->read_cooked(ip, dp)
 Sensors read cooked data. More...
 

Data Structures

struct  BaseSensorVMT
 BaseSensor virtual methods table. More...
 
struct  BaseSensor
 Base stream class. More...
 

Macro Definition Documentation

#define _base_sensor_methods_alone
Value:
/* Get number of channels.*/ \
size_t (*get_channels_number)(void *instance); \
/* Reads the sensor raw data.*/ \
msg_t (*read_raw)(void *instance, int32_t axes[]); \
/* Reads the sensor returning normalized data.*/ \
msg_t (*read_cooked)(void *instance, float axes[]);
int32_t msg_t
Type of a message.
Definition: osal.h:160

BaseSensor specific methods.

Definition at line 47 of file hal_sensors.h.

#define _base_sensor_methods
Value:
#define _base_sensor_methods_alone
BaseSensor specific methods.
Definition: hal_sensors.h:47

BaseSensor specific methods with inherited ones.

Definition at line 58 of file hal_sensors.h.

#define _base_sensor_data

BaseSensor specific data.

Note
It is empty because BaseSensor is only an interface without implementation.

Definition at line 74 of file hal_sensors.h.

#define sensorGetChannelNumber (   ip)    (ip)->vmt->get_channels_number(ip)

Sensors get channels number.

Parameters
[in]ippointer to a BaseSensor or derived class.
Returns
The number of channels of the BaseSensor
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 106 of file hal_sensors.h.

#define sensorReadRaw (   ip,
  dp 
)    (ip)->vmt->read_raw(ip, dp)

Sensors read raw data.

Parameters
[in]ippointer to a BaseSensor or derived class.
[in]dppointer to a data array.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more errors occurred.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 120 of file hal_sensors.h.

#define sensorReadCooked (   ip,
  dp 
)    (ip)->vmt->read_cooked(ip, dp)

Sensors read cooked data.

Parameters
[in]ippointer to a BaseSensor or derived class.
[in]dppointer to a data array.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more errors occurred.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 134 of file hal_sensors.h.