ChibiOS 21.11.4
Generic Compass Interface

EX Generic Compass Interface. More...

Detailed Description

EX Generic Compass Interface.

Collaboration diagram for Generic Compass Interface:

Macro Functions (BaseCompass)

#define compassGetAxesNumber(ip)
 Compass get axes number.
#define compassReadRaw(ip, dp)
 Compass read raw data.
#define compassReadCooked(ip, dp)
 Compass read cooked data.
#define compassSetBias(ip, bp)
 Updates compass bias data from received buffer.
#define compassResetBias(ip)
 Reset compass bias data restoring it to zero.
#define compassSetSensitivity(ip, sp)
 Updates compass sensitivity data from received buffer.
#define compassResetSensitivity(ip)
 Reset compass sensitivity data restoring it to its typical value.

Data Structures

struct  BaseCompassVMT
 BaseCompass virtual methods table. More...
struct  BaseCompass
 Base compass class. More...

Macros

#define _base_compass_methods_alone
 BaseCompass specific methods.
#define _base_compass_methods
 BaseCompass specific methods with inherited ones.
#define _base_compass_data    _base_sensor_data
 BaseCompass specific data.

Macro Definition Documentation

◆ _base_compass_methods_alone

#define _base_compass_methods_alone
Value:
/* Invoke the set bias procedure.*/ \
msg_t (*set_bias)(void *instance, float biases[]); \
/* Remove bias stored data.*/ \
msg_t (*reset_bias)(void *instance); \
/* Invoke the set sensitivity procedure.*/ \
msg_t (*set_sensitivity)(void *instance, float sensitivities[]); \
/* Restore sensitivity stored data to default.*/ \
msg_t (*reset_sensitivity)(void *instance);

BaseCompass specific methods.

Definition at line 49 of file ex_compass.h.

◆ _base_compass_methods

#define _base_compass_methods
Value:
_base_sensor_methods \
_base_compass_methods_alone

BaseCompass specific methods with inherited ones.

Definition at line 63 of file ex_compass.h.

◆ _base_compass_data

#define _base_compass_data    _base_sensor_data

BaseCompass specific data.

Definition at line 77 of file ex_compass.h.

◆ compassGetAxesNumber

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

Compass get axes number.

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

Definition at line 107 of file ex_compass.h.

◆ compassReadRaw

#define compassReadRaw ( ip,
dp )
Value:
(ip)->vmt->read_raw(ip, dp)

Compass read raw data.

Parameters
[in]ippointer to a BaseCompass 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 122 of file ex_compass.h.

◆ compassReadCooked

#define compassReadCooked ( ip,
dp )
Value:
(ip)->vmt->read_cooked(ip, dp)

Compass read cooked data.

Parameters
[in]ippointer to a BaseCompass 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 137 of file ex_compass.h.

◆ compassSetBias

#define compassSetBias ( ip,
bp )
Value:
(ip)->vmt->set_bias(ip, bp)

Updates compass bias data from received buffer.

Note
The bias buffer must have the same length of the the compass axes number.
Parameters
[in]ippointer to a BaseCompass class.
[in]bppointer to a buffer of bias values.
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 154 of file ex_compass.h.

◆ compassResetBias

#define compassResetBias ( ip)
Value:
(ip)->vmt->reset_bias(ip)

Reset compass bias data restoring it to zero.

Parameters
[in]ippointer to a BaseCompass class.
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 168 of file ex_compass.h.

◆ compassSetSensitivity

#define compassSetSensitivity ( ip,
sp )
Value:
(ip)->vmt->set_sensitivity(ip, sp)

Updates compass sensitivity data from received buffer.

Note
The sensitivity buffer must have the same length of the the compass axes number.
Parameters
[in]ippointer to a BaseCompass class.
[in]sppointer to a buffer of sensitivity values.
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 185 of file ex_compass.h.

◆ compassResetSensitivity

#define compassResetSensitivity ( ip)
Value:
(ip)->vmt->reset_sensitivity(ip)

Reset compass sensitivity data restoring it to its typical value.

Parameters
[in]ippointer to a BaseCompass class.
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 200 of file ex_compass.h.