ChibiOS 21.11.4
Generic Sensor Interface

EX Generic Sensor Interface. More...

Detailed Description

EX Generic Sensor Interface.

Collaboration diagram for Generic Sensor Interface:

Macro Functions (BaseSensor)

#define sensorGetChannelNumber(ip)
 Sensors get channels number.
#define sensorReadRaw(ip, dp)
 Sensors read raw data.
#define sensorReadCooked(ip, dp)
 Sensors read cooked data.

Data Structures

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

Macros

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

Macro Definition Documentation

◆ _base_sensor_methods_alone

#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[]);

BaseSensor specific methods.

Definition at line 47 of file ex_sensors.h.

◆ _base_sensor_methods

#define _base_sensor_methods
Value:
_base_object_methods \
_base_sensor_methods_alone

BaseSensor specific methods with inherited ones.

Definition at line 58 of file ex_sensors.h.

◆ _base_sensor_data

#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 ex_sensors.h.

◆ sensorGetChannelNumber

#define sensorGetChannelNumber ( ip)
Value:
(ip)->vmt->get_channels_number(ip)
static const struct EFlashDriverVMT vmt
Definition hal_efl.c:71

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 ex_sensors.h.

◆ sensorReadRaw

#define sensorReadRaw ( ip,
dp )
Value:
(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 ex_sensors.h.

◆ sensorReadCooked

#define sensorReadCooked ( ip,
dp )
Value:
(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 ex_sensors.h.