Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ahrs.c File Reference

Dispatcher to register actual AHRS implementations. More...

#include "subsystems/ahrs.h"
+ Include dependency graph for ahrs.c:

Go to the source code of this file.

Data Structures

struct  AhrsImpl
 references a registered AHRS implementation More...
 

Macros

#define __RegisterAhrs(_x)   _x ## _register()
 
#define _RegisterAhrs(_x)   __RegisterAhrs(_x)
 
#define RegisterAhrs(_x)   _RegisterAhrs(_x)
 
#define AHRS_NB_IMPL   2
 maximum number of AHRS implementations that can register More...
 

Functions

void ahrs_register_impl (AhrsEnableOutput enable)
 Register an AHRS implementation. More...
 
void ahrs_init (void)
 AHRS initialization. More...
 
int ahrs_switch (uint8_t idx)
 Switch to the output of another AHRS impl. More...
 

Variables

struct AhrsImpl ahrs_impls [AHRS_NB_IMPL]
 
uint8_t ahrs_output_idx
 

Detailed Description

Dispatcher to register actual AHRS implementations.

Definition in file ahrs.c.


Data Structure Documentation

struct AhrsImpl

references a registered AHRS implementation

Definition at line 50 of file ahrs.c.

Data Fields
AhrsEnableOutput enable

Macro Definition Documentation

#define __RegisterAhrs (   _x)    _x ## _register()

Definition at line 40 of file ahrs.c.

#define _RegisterAhrs (   _x)    __RegisterAhrs(_x)

Definition at line 41 of file ahrs.c.

#define AHRS_NB_IMPL   2

maximum number of AHRS implementations that can register

Definition at line 46 of file ahrs.c.

Referenced by ahrs_init(), ahrs_register_impl(), and ahrs_switch().

#define RegisterAhrs (   _x)    _RegisterAhrs(_x)

Definition at line 42 of file ahrs.c.

Referenced by ahrs_init().

Function Documentation

void ahrs_init ( void  )

AHRS initialization.

Called at startup. Registers/initializes the default AHRS.

Definition at line 68 of file ahrs.c.

References ahrs_impls, AHRS_NB_IMPL, ahrs_switch(), AhrsImpl::enable, PRIMARY_AHRS, and RegisterAhrs.

Referenced by init_ap(), and main_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ahrs_register_impl ( AhrsEnableOutput  enable)

Register an AHRS implementation.

Adds it to an internal list.

Parameters
enablepointer to function to enable/disable the output of registering AHRS

Definition at line 57 of file ahrs.c.

References ahrs_impls, AHRS_NB_IMPL, and AhrsImpl::enable.

Referenced by ahrs_chimu_register(), ahrs_dcm_register(), ahrs_fc_register(), ahrs_float_invariant_register(), ahrs_gx3_register(), ahrs_ice_register(), ahrs_icq_register(), ahrs_mlkf_register(), and ahrs_sim_register().

+ Here is the caller graph for this function:

int ahrs_switch ( uint8_t  idx)

Switch to the output of another AHRS impl.

Parameters
idxindex of the AHRS impl (0 = PRIMARY_AHRS, 1 = SECONDARY_AHRS).

Definition at line 84 of file ahrs.c.

References ahrs_impls, AHRS_NB_IMPL, ahrs_output_idx, AhrsImpl::enable, FALSE, and TRUE.

Referenced by ahrs_init().

+ Here is the caller graph for this function:

Variable Documentation

struct AhrsImpl ahrs_impls[AHRS_NB_IMPL]

Definition at line 54 of file ahrs.c.

Referenced by ahrs_init(), ahrs_register_impl(), and ahrs_switch().

uint8_t ahrs_output_idx

Definition at line 55 of file ahrs.c.

Referenced by ahrs_switch().