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
imu_um6.c File Reference

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

+ Include dependency graph for imu_um6.c:

Go to the source code of this file.

Functions

void UM6_imu_align (void)
 
void UM6_send_packet (uint8_t *packet_buffer, uint8_t packet_length)
 
uint16_t UM6_calculate_checksum (uint8_t packet_buffer[], uint8_t packet_length)
 
bool_t UM6_verify_chk (uint8_t packet_buffer[], uint8_t packet_length)
 
void imu_impl_init (void)
 must be defined by underlying hardware More...
 
void imu_periodic (void)
 optional. More...
 
void UM6_packet_read_message (void)
 
void UM6_packet_parse (uint8_t c)
 
void imu_scale_gyro (struct Imu *_imu)
 
void imu_scale_accel (struct Imu *_imu)
 
void imu_scale_mag (struct Imu *_imu)
 
void imu_um6_publish (void)
 

Variables

struct UM6Packet UM6_packet
 
uint8_t buf_out [IMU_UM6_BUFFER_LENGTH]
 
uint16_t data_chk
 
uint8_t PacketLength
 
uint8_t PacketType
 
uint8_t PacketAddr
 
enum UM6Status UM6_status
 
uint16_t chk_calc
 
uint16_t chk_rec
 
struct FloatVect3 UM6_accel
 
struct FloatRates UM6_rate
 
struct FloatVect3 UM6_mag
 
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.c.

Function Documentation

void imu_impl_init ( void  )

must be defined by underlying hardware

must be defined by underlying hardware

Todo:
drdy int handling for adxl345
Todo:
eoc interrupt for itg3200, polling for now (including status reg)
Todo:
drdy int handling for adxl345
Todo:
eoc interrupt for itg3200, polling for now (including status reg)
Todo:
drdy int handling for adxl345

Definition at line 135 of file imu_um6.c.

References Mpu60x0Config::accel_range, APOGEE_ACCEL_RANGE, APOGEE_GYRO_RANGE, APOGEE_LOWPASS_FILTER, APOGEE_SMPLRT_DIV, buf_out, UM6Packet::chksm_error, Mpu60x0_I2c::config, Mpu60x0I2cSlave::configure, configure_baro_slave(), data_chk, Mpu60x0Config::dlpf_cfg, FALSE, Mpu60x0Config::gyro_range, UM6Packet::hdr_error, Mpu60x0Config::i2c_bypass, imu_apogee, IMU_UM6_COMMUNICATION_REG, IMU_UM6_MISC_CONFIG_REG, ImuApogee::mpu, MPU60X0_ADDR_ALT, mpu60x0_i2c_init(), UM6Packet::msg_available, UM6Packet::msg_idx, Mpu60x0Config::nb_slaves, Mpu60x0Config::slaves, Mpu60x0Config::smplrt_div, UM6Packet::status, TRUE, UM6_calculate_checksum(), UM6_imu_align(), UM6_packet, UM6_send_packet(), UM6_status, UM6PacketWaiting, and UM6Uninit.

+ Here is the call graph for this function:

void imu_periodic ( void  )

optional.

If not provided by implementation, empty function is used

optional.

Read the MPU60x0 every periodic call and the HMC58XX every 10th call.

Definition at line 195 of file imu_um6.c.

void imu_scale_accel ( struct Imu _imu)

Definition at line 365 of file imu_um6.c.

void imu_scale_gyro ( struct Imu _imu)

Definition at line 364 of file imu_um6.c.

void imu_scale_mag ( struct Imu _imu)

Definition at line 366 of file imu_um6.c.

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:

uint16_t UM6_calculate_checksum ( uint8_t  packet_buffer[],
uint8_t  packet_length 
)
inline

Definition at line 68 of file imu_um6.c.

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

+ Here is the caller graph for this function:

void UM6_imu_align ( void  )
inline

Definition at line 84 of file imu_um6.c.

References buf_out, data_chk, IMU_UM6_RESET_EKF_CMD, IMU_UM6_SET_ACCEL_REF, IMU_UM6_SET_MAG_REF, IMU_UM6_ZERO_GYROS_CMD, UM6_calculate_checksum(), UM6_send_packet(), UM6_status, UM6Running, and UM6Uninit.

Referenced by imu_impl_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void UM6_send_packet ( uint8_t packet_buffer,
uint8_t  packet_length 
)
inline

Definition at line 77 of file imu_um6.c.

References uart_put_byte().

Referenced by imu_impl_init(), and UM6_imu_align().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool_t UM6_verify_chk ( uint8_t  packet_buffer[],
uint8_t  packet_length 
)
inline

Definition at line 61 of file imu_um6.c.

References chk_calc, chk_rec, and UM6_calculate_checksum().

Referenced by UM6_packet_parse().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

Definition at line 39 of file imu_um6.c.

Referenced by imu_impl_init(), and UM6_imu_align().

uint16_t chk_calc

Definition at line 47 of file imu_um6.c.

Referenced by gx3_verify_chk(), and UM6_verify_chk().

uint16_t chk_rec

Definition at line 48 of file imu_um6.c.

Referenced by UM6_verify_chk().

uint16_t data_chk

Definition at line 40 of file imu_um6.c.

Referenced by imu_impl_init(), and UM6_imu_align().

uint8_t PacketAddr

Definition at line 44 of file imu_um6.c.

Referenced by UM6_packet_parse(), and UM6_packet_read_message().

uint8_t PacketLength

Definition at line 42 of file imu_um6.c.

Referenced by UM6_packet_parse(), and UM6_packet_read_message().

uint8_t PacketType

Definition at line 43 of file imu_um6.c.

Referenced by UM6_packet_parse().

struct FloatVect3 UM6_accel

Definition at line 50 of file imu_um6.c.

Referenced by UM6_packet_read_message().

struct FloatEulers UM6_eulers

Definition at line 53 of file imu_um6.c.

Referenced by UM6_packet_read_message().

struct FloatVect3 UM6_mag

Definition at line 52 of file imu_um6.c.

Referenced by UM6_packet_read_message().

struct UM6Packet UM6_packet

Definition at line 38 of file imu_um6.c.

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

struct FloatQuat UM6_quat

Definition at line 54 of file imu_um6.c.

Referenced by UM6_packet_read_message().

struct FloatRates UM6_rate

Definition at line 51 of file imu_um6.c.

Referenced by UM6_packet_read_message().

enum UM6Status UM6_status

Definition at line 45 of file imu_um6.c.

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