ChibiOS/HAL  6.1.0

HAL Generic Compass Interface. More...

Collaboration diagram for Generic Compass Interface:

Detailed Description

HAL Generic Compass Interface.

Macros

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

Macro Functions (BaseCompass)

#define compassGetAxesNumber(ip)   (ip)->vmt->get_channels_number(ip)
 Compass get axes number. More...
 
#define compassReadRaw(ip, dp)   (ip)->vmt->read_raw(ip, dp)
 Compass read raw data. More...
 
#define compassReadCooked(ip, dp)   (ip)->vmt->read_cooked(ip, dp)
 Compass read cooked data. More...
 
#define compassSetBias(ip, bp)   (ip)->vmt->set_bias(ip, bp)
 Updates compass bias data from received buffer. More...
 
#define compassResetBias(ip)   (ip)->vmt->reset_bias(ip)
 Reset compass bias data restoring it to zero. More...
 
#define compassSetSensitivity(ip, sp)   (ip)->vmt->set_sensitivity(ip, sp)
 Updates compass sensitivity data from received buffer. More...
 
#define compassResetSensitivity(ip)   (ip)->vmt->reset_sensitivity(ip)
 Reset compass sensitivity data restoring it to its typical value. More...
 

Data Structures

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

Macro Definition Documentation

#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);
int32_t msg_t
Type of a message.
Definition: osal.h:160

BaseCompass specific methods.

Definition at line 49 of file hal_compass.h.

#define _base_compass_methods
Value:
#define _base_compass_methods_alone
BaseCompass specific methods.
Definition: hal_compass.h:49

BaseCompass specific methods with inherited ones.

Definition at line 63 of file hal_compass.h.

#define _base_compass_data   _base_sensor_data

BaseCompass specific data.

Definition at line 77 of file hal_compass.h.

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

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

#define compassReadRaw (   ip,
  dp 
)    (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 hal_compass.h.

#define compassReadCooked (   ip,
  dp 
)    (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 hal_compass.h.

#define compassSetBias (   ip,
  bp 
)    (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 hal_compass.h.

#define compassResetBias (   ip)    (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 hal_compass.h.

#define compassSetSensitivity (   ip,
  sp 
)    (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 hal_compass.h.

#define compassResetSensitivity (   ip)    (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 hal_compass.h.