Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ahrs_gx3.c File Reference
+ Include dependency graph for ahrs_gx3.c:

Go to the source code of this file.

Macros

#define GX3_CHKSM(_ubx_payload)   (uint16_t)((uint16_t)(*((uint8_t*)_ubx_payload+66+1))|(uint16_t)(*((uint8_t*)_ubx_payload+66+0))<<8)
 

Functions

static bool gx3_verify_chk (volatile uint8_t *buff_add)
 
static float bef (volatile uint8_t *c)
 
void ahrs_gx3_align (void)
 
static void send_gx3 (struct transport_tx *trans, struct link_device *dev)
 
void imu_gx3_init (void)
 
void imu_gx3_periodic (void)
 
void gx3_packet_read_message (void)
 
void gx3_packet_parse (uint8_t c)
 
void ahrs_gx3_init (void)
 
void ahrs_gx3_register (void)
 
void imu_scale_gyro (struct Imu *_imu)
 
void imu_scale_accel (struct Imu *_imu)
 
void imu_scale_mag (struct Imu *_imu)
 
void ahrs_gx3_publish_imu (void)
 
static void ReadGX3Buffer (void)
 
void imu_gx3_event (void)
 

Variables

struct AhrsGX3 ahrs_gx3
 Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down. More...
 

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.c.

Macro Definition Documentation

◆ GX3_CHKSM

#define GX3_CHKSM (   _ubx_payload)    (uint16_t)((uint16_t)(*((uint8_t*)_ubx_payload+66+1))|(uint16_t)(*((uint8_t*)_ubx_payload+66+0))<<8)

Definition at line 40 of file ahrs_gx3.c.

Function Documentation

◆ ahrs_gx3_align()

void ahrs_gx3_align ( void  )

Definition at line 76 of file ahrs_gx3.c.

References ahrs_gx3, AhrsGX3::is_aligned, and uart_put_byte().

Referenced by imu_gx3_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ahrs_gx3_init()

void ahrs_gx3_init ( void  )

Definition at line 328 of file ahrs_gx3.c.

References ahrs_gx3, Imu::body_to_imu, imu, AhrsGX3::is_aligned, AhrsGX3::ltp_to_imu_quat, AhrsGX3::mag_offset, orientationGetQuat_f(), and QUAT_COPY.

Referenced by ahrs_gx3_register().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ahrs_gx3_publish_imu()

void ahrs_gx3_publish_imu ( void  )

Definition at line 354 of file ahrs_gx3.c.

References Imu::accel, get_sys_time_usec(), Imu::gyro, imu, IMU_GX3_ID, and Imu::mag.

Referenced by imu_gx3_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ahrs_gx3_register()

void ahrs_gx3_register ( void  )
Todo:
: provide enable function

Definition at line 341 of file ahrs_gx3.c.

References ahrs_gx3_init(), and ahrs_register_impl().

+ Here is the call graph for this function:

◆ bef()

static float bef ( volatile uint8_t c)
inlinestatic

Definition at line 54 of file ahrs_gx3.c.

References c(), f, and p.

Referenced by gx3_packet_read_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gx3_packet_parse()

void gx3_packet_parse ( uint8_t  c)

Definition at line 295 of file ahrs_gx3.c.

References ahrs_gx3, c(), GX3Packet::chksm_error, GX3_HEADER, GX3_MSG_LEN, gx3_verify_chk(), GX3PacketReading, GX3PacketWaiting, GX3Packet::hdr_error, GX3Packet::msg_available, GX3Packet::msg_buf, GX3Packet::msg_idx, AhrsGX3::packet, and GX3Packet::status.

Referenced by ReadGX3Buffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gx3_packet_read_message()

◆ gx3_verify_chk()

static bool gx3_verify_chk ( volatile uint8_t buff_add)
inlinestatic

Definition at line 66 of file ahrs_gx3.c.

References chk_calc, and GX3_MSG_LEN.

Referenced by gx3_packet_parse().

+ Here is the caller graph for this function:

◆ imu_gx3_event()

void imu_gx3_event ( void  )

Definition at line 369 of file ahrs_gx3.c.

References ahrs_gx3, ahrs_gx3_publish_imu(), gx3_packet_read_message(), GX3Packet::msg_available, AhrsGX3::packet, ReadGX3Buffer(), and uart_char_available().

+ Here is the call graph for this function:

◆ imu_gx3_init()

◆ imu_gx3_periodic()

void imu_gx3_periodic ( void  )

Definition at line 219 of file ahrs_gx3.c.

◆ imu_scale_accel()

void imu_scale_accel ( struct Imu _imu)

Definition at line 351 of file ahrs_gx3.c.

◆ imu_scale_gyro()

void imu_scale_gyro ( struct Imu _imu)

Definition at line 350 of file ahrs_gx3.c.

◆ imu_scale_mag()

◆ ReadGX3Buffer()

static void ReadGX3Buffer ( void  )
inlinestatic

Definition at line 362 of file ahrs_gx3.c.

References ahrs_gx3, gx3_packet_parse(), GX3Packet::msg_available, AhrsGX3::packet, uart_char_available(), and uart_getch().

Referenced by imu_gx3_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_gx3()

static void send_gx3 ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 93 of file ahrs_gx3.c.

References ahrs_gx3, AhrsGX3::chksm, GX3Packet::chksm_error, dev, AhrsGX3::freq, GX3Packet::hdr_error, and AhrsGX3::packet.

Referenced by imu_gx3_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ ahrs_gx3

struct AhrsGX3 ahrs_gx3

Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down.

Positive pitch : nose up Positive roll : right wing down Positive yaw : clockwise

Definition at line 48 of file ahrs_gx3.c.

Referenced by ahrs_gx3_align(), ahrs_gx3_init(), gx3_packet_parse(), gx3_packet_read_message(), imu_gx3_event(), imu_gx3_init(), ReadGX3Buffer(), and send_gx3().