Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
imu_um6.h File Reference
#include "generated/airframe.h"
#include "subsystems/imu.h"
#include "mcu_periph/uart.h"
#include "subsystems/ahrs.h"
+ Include dependency graph for imu_um6.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  UM6Packet
 

Macros

#define IMU_UM6_BUFFER_LENGTH   32
 
#define IMU_UM6_DATA_OFFSET   5
 
#define IMU_UM6_LONG_DELAY   4000000
 
#define IMU_UM6_COMMUNICATION_REG   0x00
 
#define IMU_UM6_MISC_CONFIG_REG   0x01
 
#define IMU_UM6_GET_FIRMWARE_CMD   0xAA
 
#define IMU_UM6_ZERO_GYROS_CMD   0xAC
 
#define IMU_UM6_RESET_EKF_CMD   0xAD
 
#define IMU_UM6_GET_DATA   0xAE
 
#define IMU_UM6_SET_ACCEL_REF   0xAF
 
#define IMU_UM6_SET_MAG_REF   0xB0
 
#define IMU_UM6_GYRO_PROC   0x5C
 
#define IMU_UM6_ACCEL_PROC   0x5E
 
#define IMU_UM6_MAG_PROC   0x60
 
#define IMU_UM6_EULER   0x62
 
#define IMU_UM6_QUAT   0x64
 

Enumerations

enum  UM6PacketStatus {
  UM6PacketWaiting, UM6PacketReadingS, UM6PacketReadingN, UM6PacketReadingPT,
  UM6PacketReadingAddr, UM6PacketReadingData
}
 
enum  UM6Status { UM6Uninit, UM6Running }
 

Functions

void UM6_packet_read_message (void)
 
void UM6_packet_parse (uint8_t c)
 
void imu_um6_publish (void)
 
void imu_um6_init (void)
 
void imu_um6_periodic (void)
 
static void imu_um6_event (void)
 

Variables

struct UM6Packet UM6_packet
 
uint8_t PacketLength
 
uint8_t PacketType
 
uint8_t PacketAddr
 
uint16_t chk_calc
 
uint16_t chk_rec
 
enum UM6Status UM6_status
 
volatile uint8_t UM6_imu_available
 
struct FloatEulers UM6_eulers
 
struct FloatQuat UM6_quat
 

Detailed Description

Driver for CH Robotics UM6 IMU/AHRS subsystem

Takes care of configuration of the IMU, communication and parsing the received packets. See UM6 datasheet for configuration options. Should be used with ahrs_extern_euler AHRS subsystem.

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


Data Structure Documentation

◆ UM6Packet

struct UM6Packet

Definition at line 79 of file imu_um6.h.

Data Fields
uint32_t chksm_error
uint32_t hdr_error
bool msg_available
uint8_t msg_buf[IMU_UM6_BUFFER_LENGTH]
uint8_t msg_idx
uint8_t status

Macro Definition Documentation

◆ IMU_UM6_ACCEL_PROC

#define IMU_UM6_ACCEL_PROC   0x5E

Definition at line 55 of file imu_um6.h.

◆ IMU_UM6_BUFFER_LENGTH

#define IMU_UM6_BUFFER_LENGTH   32

Definition at line 41 of file imu_um6.h.

◆ IMU_UM6_COMMUNICATION_REG

#define IMU_UM6_COMMUNICATION_REG   0x00

Definition at line 45 of file imu_um6.h.

◆ IMU_UM6_DATA_OFFSET

#define IMU_UM6_DATA_OFFSET   5

Definition at line 42 of file imu_um6.h.

◆ IMU_UM6_EULER

#define IMU_UM6_EULER   0x62

Definition at line 57 of file imu_um6.h.

◆ IMU_UM6_GET_DATA

#define IMU_UM6_GET_DATA   0xAE

Definition at line 50 of file imu_um6.h.

◆ IMU_UM6_GET_FIRMWARE_CMD

#define IMU_UM6_GET_FIRMWARE_CMD   0xAA

Definition at line 47 of file imu_um6.h.

◆ IMU_UM6_GYRO_PROC

#define IMU_UM6_GYRO_PROC   0x5C

Definition at line 54 of file imu_um6.h.

◆ IMU_UM6_LONG_DELAY

#define IMU_UM6_LONG_DELAY   4000000

Definition at line 43 of file imu_um6.h.

◆ IMU_UM6_MAG_PROC

#define IMU_UM6_MAG_PROC   0x60

Definition at line 56 of file imu_um6.h.

◆ IMU_UM6_MISC_CONFIG_REG

#define IMU_UM6_MISC_CONFIG_REG   0x01

Definition at line 46 of file imu_um6.h.

◆ IMU_UM6_QUAT

#define IMU_UM6_QUAT   0x64

Definition at line 58 of file imu_um6.h.

◆ IMU_UM6_RESET_EKF_CMD

#define IMU_UM6_RESET_EKF_CMD   0xAD

Definition at line 49 of file imu_um6.h.

◆ IMU_UM6_SET_ACCEL_REF

#define IMU_UM6_SET_ACCEL_REF   0xAF

Definition at line 51 of file imu_um6.h.

◆ IMU_UM6_SET_MAG_REF

#define IMU_UM6_SET_MAG_REF   0xB0

Definition at line 52 of file imu_um6.h.

◆ IMU_UM6_ZERO_GYROS_CMD

#define IMU_UM6_ZERO_GYROS_CMD   0xAC

Definition at line 48 of file imu_um6.h.

Enumeration Type Documentation

◆ UM6PacketStatus

Enumerator
UM6PacketWaiting 
UM6PacketReadingS 
UM6PacketReadingN 
UM6PacketReadingPT 
UM6PacketReadingAddr 
UM6PacketReadingData 

Definition at line 88 of file imu_um6.h.

◆ UM6Status

enum UM6Status
Enumerator
UM6Uninit 
UM6Running 

Definition at line 97 of file imu_um6.h.

Function Documentation

◆ imu_um6_event()

static void imu_um6_event ( void  )
inlinestatic

Definition at line 105 of file imu_um6.h.

References imu_um6_publish(), UM6Packet::msg_available, uart_char_available(), uart_getch(), UM6_packet, UM6_packet_parse(), and UM6_packet_read_message().

+ Here is the call graph for this function:

◆ imu_um6_init()

◆ imu_um6_periodic()

void imu_um6_periodic ( void  )

Definition at line 195 of file imu_um6.c.

◆ imu_um6_publish()

void imu_um6_publish ( void  )

Definition at line 369 of file imu_um6.c.

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

Referenced by imu_um6_event().

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

◆ UM6_packet_parse()

◆ UM6_packet_read_message()

Variable Documentation

◆ chk_calc

uint16_t chk_calc

Definition at line 47 of file imu_um6.c.

Referenced by gx3_verify_chk(), and UM6_verify_chk().

◆ chk_rec

uint16_t chk_rec

Definition at line 48 of file imu_um6.c.

Referenced by UM6_verify_chk().

◆ PacketAddr

uint8_t PacketAddr

Definition at line 44 of file imu_um6.c.

Referenced by UM6_packet_parse(), and UM6_packet_read_message().

◆ PacketLength

uint8_t PacketLength

Definition at line 42 of file imu_um6.c.

Referenced by UM6_packet_parse(), and UM6_packet_read_message().

◆ PacketType

uint8_t PacketType

Definition at line 43 of file imu_um6.c.

Referenced by UM6_packet_parse().

◆ UM6_eulers

struct FloatEulers UM6_eulers

Definition at line 53 of file imu_um6.c.

Referenced by UM6_packet_read_message().

◆ UM6_imu_available

volatile uint8_t UM6_imu_available

◆ UM6_packet

struct UM6Packet UM6_packet

Definition at line 38 of file imu_um6.c.

Referenced by imu_um6_event(), imu_um6_init(), UM6_packet_parse(), and UM6_packet_read_message().

◆ UM6_quat

struct FloatQuat UM6_quat

Definition at line 54 of file imu_um6.c.

Referenced by UM6_packet_read_message().

◆ UM6_status

enum UM6Status UM6_status

Definition at line 45 of file imu_um6.c.

Referenced by imu_um6_init(), UM6_imu_align(), and UM6_packet_read_message().