Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ahrs_gx3.h File Reference

Driver for Microstrain GX3 IMU/AHRS subsystem. More...

#include "generated/airframe.h"
#include "subsystems/imu.h"
#include "subsystems/ahrs.h"
#include "subsystems/ins.h"
#include "subsystems/gps.h"
#include "mcu_periph/uart.h"
#include "subsystems/ahrs/ahrs_aligner.h"
#include "state.h"
#include "led.h"
+ Include dependency graph for ahrs_gx3.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GX3Packet
 
struct  AhrsFloatQuat
 

Macros

#define ImuScaleGyro(_imu)   {}
 
#define ImuScaleAccel(_imu)   {}
 
#define ImuScaleMag(_imu)   {}
 
#define GX3_MAX_PAYLOAD   128
 
#define GX3_MSG_LEN   67
 
#define GX3_HEADER   0xC8
 
#define GX3_MIN_FREQ   300
 
#define IMU_GX3_LONG_DELAY   4000000
 

Enumerations

enum  GX3PacketStatus { GX3PacketWaiting, GX3PacketReading }
 
enum  GX3Status { GX3Uninit, GX3Running }
 

Functions

void gx3_packet_read_message (void)
 
void gx3_packet_parse (uint8_t c)
 
static void ReadGX3Buffer (void)
 
static void ImuEvent (void(*_gyro_handler)(void), void(*_accel_handler)(void), void(*_mag_handler)(void))
 

Variables

struct AhrsFloatQuat ahrs_impl
 

Detailed Description

Driver for Microstrain GX3 IMU/AHRS subsystem.

Takes care of configuration of the IMU, communication and parsing the received packets. See GX3 datasheet for configuration options.

Author
Michal Podhradsky micha.nosp@m.l.po.nosp@m.dhrad.nosp@m.sky@.nosp@m.aggie.nosp@m.mail.nosp@m..usu..nosp@m.edu

Definition in file ahrs_gx3.h.

Macro Definition Documentation

#define GX3_HEADER   0xC8

Definition at line 63 of file ahrs_gx3.h.

Referenced by gx3_packet_parse().

#define GX3_MAX_PAYLOAD   128

Definition at line 61 of file ahrs_gx3.h.

#define GX3_MIN_FREQ   300

Definition at line 64 of file ahrs_gx3.h.

#define GX3_MSG_LEN   67

Definition at line 62 of file ahrs_gx3.h.

Referenced by gx3_packet_parse(), and gx3_verify_chk().

#define IMU_GX3_LONG_DELAY   4000000

Definition at line 66 of file ahrs_gx3.h.

Referenced by imu_impl_init().

#define ImuScaleAccel (   _imu)    {}

Definition at line 54 of file ahrs_gx3.h.

Referenced by on_accel_event(), and on_gyro_event().

#define ImuScaleGyro (   _imu)    {}

Definition at line 49 of file ahrs_gx3.h.

Referenced by on_gyro_event().

#define ImuScaleMag (   _imu)    {}

Definition at line 59 of file ahrs_gx3.h.

Referenced by mag_hmc58xx_module_event(), and on_mag_event().

Enumeration Type Documentation

Enumerator
GX3PacketWaiting 
GX3PacketReading 

Definition at line 80 of file ahrs_gx3.h.

enum GX3Status
Enumerator
GX3Uninit 
GX3Running 

Definition at line 85 of file ahrs_gx3.h.

Function Documentation

void gx3_packet_parse ( uint8_t  c)

Definition at line 296 of file ahrs_gx3.c.

References ahrs_impl, GX3Packet::chksm_error, FALSE, GX3_HEADER, GX3_MSG_LEN, AhrsFloatQuat::gx3_packet, gx3_verify_chk(), GX3PacketReading, GX3PacketWaiting, GX3Packet::hdr_error, GX3Packet::msg_available, GX3Packet::msg_buf, GX3Packet::msg_idx, GX3Packet::status, and TRUE.

Referenced by ReadGX3Buffer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ImuEvent ( void(*)(void)  _gyro_handler,
void(*)(void)  _accel_handler,
void(*)(void)  _mag_handler 
)
inlinestatic

Definition at line 113 of file ahrs_gx3.h.

References ahrs_impl, FALSE, AhrsFloatQuat::gx3_packet, gx3_packet_read_message(), GX3Packet::msg_available, ReadGX3Buffer(), and uart_char_available().

+ Here is the call graph for this function:

static void ReadGX3Buffer ( void  )
inlinestatic

Definition at line 108 of file ahrs_gx3.h.

References ahrs_impl, AhrsFloatQuat::gx3_packet, gx3_packet_parse(), GX3Packet::msg_available, uart_char_available(), and uart_getch().

Referenced by ImuEvent().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct AhrsFloatQuat ahrs_impl

Definition at line 45 of file ahrs_ardrone2.c.

Referenced by ImuEvent(), and ReadGX3Buffer().