Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_um6.h File Reference

Driver for CH Robotics UM6 IMU/AHRS subsystem. More...

#include "generated/airframe.h"
#include "subsystems/imu.h"
#include "mcu_periph/uart.h"
#include "subsystems/ahrs.h"
#include "subsystems/ins.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 __UM6Link(dev, _x)   dev##_x
 
#define _UM6Link(dev, _x)   __UM6Link(dev, _x)
 
#define UM6Link(_x)   _UM6Link(UM6_LINK, _x)
 
#define UM6Buffer()   UM6Link(ChAvailable())
 
#define ImuScaleGyro(_imu)   {}
 
#define ImuScaleAccel(_imu)   {}
 
#define ImuScaleMag(_imu)   {}
 
#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
 
#define imu_um6_event(_callback1, _callback2, _callback3)
 
#define ReadUM6Buffer()
 
#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler)
 

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)
 

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

Macro Definition Documentation

#define __UM6Link (   dev,
  _x 
)    dev##_x

Definition at line 42 of file imu_um6.h.

#define _UM6Link (   dev,
  _x 
)    __UM6Link(dev, _x)

Definition at line 43 of file imu_um6.h.

#define IMU_UM6_ACCEL_PROC   0x5E

Definition at line 77 of file imu_um6.h.

Referenced by UM6_packet_read_message().

#define IMU_UM6_BUFFER_LENGTH   32

Definition at line 63 of file imu_um6.h.

#define IMU_UM6_COMMUNICATION_REG   0x00

Definition at line 67 of file imu_um6.h.

Referenced by imu_impl_init().

#define IMU_UM6_DATA_OFFSET   5

Definition at line 64 of file imu_um6.h.

Referenced by UM6_packet_read_message().

#define IMU_UM6_EULER   0x62

Definition at line 79 of file imu_um6.h.

Referenced by UM6_packet_read_message().

#define imu_um6_event (   _callback1,
  _callback2,
  _callback3 
)
Value:
{ \
} \
_callback1(); \
_callback2(); \
_callback3(); \
} \
}
struct UM6Packet UM6_packet
Definition: imu_um6.c:37
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer
#define FALSE
Definition: imu_chimu.h:141
bool_t msg_available
Definition: imu_um6.h:101
void UM6_packet_read_message(void)
Definition: imu_um6.c:208
#define ReadUM6Buffer()
Definition: imu_um6.h:136
#define UM6Buffer()
Definition: imu_um6.h:46

Definition at line 123 of file imu_um6.h.

#define IMU_UM6_GET_DATA   0xAE

Definition at line 72 of file imu_um6.h.

#define IMU_UM6_GET_FIRMWARE_CMD   0xAA

Definition at line 69 of file imu_um6.h.

#define IMU_UM6_GYRO_PROC   0x5C

Definition at line 76 of file imu_um6.h.

Referenced by UM6_packet_read_message().

#define IMU_UM6_LONG_DELAY   4000000

Definition at line 65 of file imu_um6.h.

#define IMU_UM6_MAG_PROC   0x60

Definition at line 78 of file imu_um6.h.

Referenced by UM6_packet_read_message().

#define IMU_UM6_MISC_CONFIG_REG   0x01

Definition at line 68 of file imu_um6.h.

Referenced by imu_impl_init().

#define IMU_UM6_QUAT   0x64

Definition at line 80 of file imu_um6.h.

Referenced by UM6_packet_read_message().

#define IMU_UM6_RESET_EKF_CMD   0xAD

Definition at line 71 of file imu_um6.h.

Referenced by UM6_imu_align().

#define IMU_UM6_SET_ACCEL_REF   0xAF

Definition at line 73 of file imu_um6.h.

Referenced by UM6_imu_align().

#define IMU_UM6_SET_MAG_REF   0xB0

Definition at line 74 of file imu_um6.h.

Referenced by UM6_imu_align().

#define IMU_UM6_ZERO_GYROS_CMD   0xAC

Definition at line 70 of file imu_um6.h.

Referenced by UM6_imu_align().

#define ImuEvent (   _gyro_handler,
  _accel_handler,
  _mag_handler 
)
Value:
{ \
imu_um6_event(_gyro_handler, _accel_handler, _mag_handler); \
}
#define imu_um6_event(_callback1, _callback2, _callback3)
Definition: imu_um6.h:123

Definition at line 141 of file imu_um6.h.

#define ImuScaleAccel (   _imu)    {}

Definition at line 56 of file imu_um6.h.

#define ImuScaleGyro (   _imu)    {}

Definition at line 51 of file imu_um6.h.

#define ImuScaleMag (   _imu)    {}

Definition at line 61 of file imu_um6.h.

#define ReadUM6Buffer ( )
Value:
{ \
while (UM6Link(ChAvailable())&&!UM6_packet.msg_available) \
}
struct UM6Packet UM6_packet
Definition: imu_um6.c:37
void UM6_packet_parse(uint8_t c)
Definition: imu_um6.c:286
#define UM6Link(_x)
Definition: imu_um6.h:44
bool_t msg_available
Definition: imu_um6.h:101

Definition at line 136 of file imu_um6.h.

#define UM6Buffer ( )    UM6Link(ChAvailable())

Definition at line 46 of file imu_um6.h.

#define UM6Link (   _x)    _UM6Link(UM6_LINK, _x)

Definition at line 44 of file imu_um6.h.

Referenced by UM6_send_packet().

Enumeration Type Documentation

Enumerator
UM6PacketWaiting 
UM6PacketReadingS 
UM6PacketReadingN 
UM6PacketReadingPT 
UM6PacketReadingAddr 
UM6PacketReadingData 

Definition at line 109 of file imu_um6.h.

enum UM6Status
Enumerator
UM6Uninit 
UM6Running 

Definition at line 118 of file imu_um6.h.

Function Documentation

Variable Documentation

uint16_t chk_calc

Definition at line 46 of file imu_um6.c.

Referenced by GX3_verify_chk(), and UM6_verify_chk().

uint16_t chk_rec

Definition at line 47 of file imu_um6.c.

Referenced by UM6_verify_chk().

uint8_t PacketAddr

Definition at line 43 of file imu_um6.c.

Referenced by UM6_packet_parse(), and UM6_packet_read_message().

uint8_t PacketLength

Definition at line 41 of file imu_um6.c.

Referenced by UM6_packet_parse(), and UM6_packet_read_message().

uint8_t PacketType

Definition at line 42 of file imu_um6.c.

Referenced by UM6_packet_parse().

struct FloatEulers UM6_eulers

Definition at line 52 of file imu_um6.c.

Referenced by UM6_packet_read_message().

volatile uint8_t UM6_imu_available
struct UM6Packet UM6_packet

Definition at line 37 of file imu_um6.c.

Referenced by imu_impl_init(), UM6_packet_parse(), and UM6_packet_read_message().

struct FloatQuat UM6_quat

Definition at line 53 of file imu_um6.c.

Referenced by UM6_packet_read_message().

enum UM6Status UM6_status

Definition at line 44 of file imu_um6.c.

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