Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mag_ist8310.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Freek van Tienen <freek.v.tienen@gmail.com>
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
28#include "mcu_periph/uart.h"
29#include "pprzlink/messages.h"
31#include "generated/airframe.h"
32#include "modules/core/abi.h"
33
34#ifndef IST8310_CHAN_X
35#define IST8310_CHAN_X 1
36#endif
37#ifndef IST8310_CHAN_Y
38#define IST8310_CHAN_Y 0
39#endif
40#ifndef IST8310_CHAN_Z
41#define IST8310_CHAN_Z 2
42#endif
43#ifndef IST8310_CHAN_X_SIGN
44#define IST8310_CHAN_X_SIGN +
45#endif
46#ifndef IST8310_CHAN_Y_SIGN
47#define IST8310_CHAN_Y_SIGN +
48#endif
49#ifndef IST8310_CHAN_Z_SIGN
50#define IST8310_CHAN_Z_SIGN +
51#endif
52
54
56{
58
59#if MODULE_IST8310_UPDATE_AHRS && defined(IST8310_MAG_TO_IMU_PHI) && defined(IST8310_MAG_TO_IMU_THETA) && defined(IST8310_MAG_TO_IMU_PSI)
60 struct Int32RMat mag_to_imu;
65 };
67
69#endif
70}
71
76
78{
80
82#if MODULE_IST8310_UPDATE_AHRS
83 // current timestamp
85
86 // set channel order
87 struct Int32Vect3 mag = {
91 };
92
94#endif
95#if MODULE_IST8310_SYNC_SEND
97#endif
98#if MODULE_IST8310_UPDATE_AHRS || MODULE_IST8310_SYNC_SEND
100#endif
101 }
102}
103
Main include for ABI (AirBorneInterface).
#define MAG_IST8310_SENDER_ID
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define ANGLE_BFP_OF_REAL(_af)
#define int32_rmat_of_eulers
Rotation matrix from Euler angles.
euler angles
rotation matrix
void imu_set_defaults_mag(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct Int32Vect3 *scale)
Set the defaults for a mag sensor WARNING: Should be called before sensor is publishing messages to e...
Definition imu.c:640
void ist8310_event(struct IST8310 *ist)
Definition ist8310.c:111
void ist8310_init(struct IST8310 *ist, struct i2c_periph *i2c_p, uint8_t addr)
Initialize IST8310 struct.
Definition ist8310.c:34
union IST8310::@328 data
static void ist8310_periodic(struct IST8310 *ist)
convenience function: read or start configuration if not already initialized
Definition ist8310.h:77
volatile bool data_available
data ready flag
Definition ist8310.h:63
Default IST8310 structure.
Definition ist8310.h:55
#define IST8310_ADDR
#define IST8310_CHAN_Y
Definition mag_ist8310.c:38
#define IST8310_CHAN_Z_SIGN
Definition mag_ist8310.c:50
void mag_ist8310_report(void)
#define IST8310_CHAN_Z
Definition mag_ist8310.c:41
#define IST8310_CHAN_X
Definition mag_ist8310.c:35
struct IST8310 mag_ist8310
Definition mag_ist8310.c:53
#define IST8310_CHAN_X_SIGN
Definition mag_ist8310.c:44
#define IST8310_CHAN_Y_SIGN
Definition mag_ist8310.c:47
void mag_ist8310_module_event(void)
Definition mag_ist8310.c:77
void mag_ist8310_module_periodic(void)
Definition mag_ist8310.c:72
void mag_ist8310_module_init(void)
Definition mag_ist8310.c:55
Module wrapper for Isentek IST8310 magnetometers.
uint16_t foo
Definition main_demo5.c:58
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.