APM:Libraries
Macros | Variables
AP_Compass_IST8310.cpp File Reference
#include "AP_Compass_IST8310.h"
#include <stdio.h>
#include <utility>
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/utility/sparse-endian.h>
#include <AP_Math/AP_Math.h>
Include dependency graph for AP_Compass_IST8310.cpp:

Go to the source code of this file.

Macros

#define WAI_REG   0x0
 
#define DEVICE_ID   0x10
 
#define OUTPUT_X_L_REG   0x3
 
#define OUTPUT_X_H_REG   0x4
 
#define OUTPUT_Y_L_REG   0x5
 
#define OUTPUT_Y_H_REG   0x6
 
#define OUTPUT_Z_L_REG   0x7
 
#define OUTPUT_Z_H_REG   0x8
 
#define CNTL1_REG   0xA
 
#define CNTL1_VAL_SINGLE_MEASUREMENT_MODE   0x1
 
#define CNTL2_REG   0xB
 
#define CNTL2_VAL_SRST   1
 
#define AVGCNTL_REG   0x41
 
#define AVGCNTL_VAL_XZ_0   (0)
 
#define AVGCNTL_VAL_XZ_2   (1)
 
#define AVGCNTL_VAL_XZ_4   (2)
 
#define AVGCNTL_VAL_XZ_8   (3)
 
#define AVGCNTL_VAL_XZ_16   (4)
 
#define AVGCNTL_VAL_Y_0   (0 << 3)
 
#define AVGCNTL_VAL_Y_2   (1 << 3)
 
#define AVGCNTL_VAL_Y_4   (2 << 3)
 
#define AVGCNTL_VAL_Y_8   (3 << 3)
 
#define AVGCNTL_VAL_Y_16   (4 << 3)
 
#define PDCNTL_REG   0x42
 
#define PDCNTL_VAL_PULSE_DURATION_NORMAL   0xC0
 
#define SAMPLING_PERIOD_USEC   (10 * AP_USEC_PER_MSEC)
 
#define IST8310_RESOLUTION   0.3
 

Variables

static const int16_t IST8310_MAX_VAL_XY = (1600 / IST8310_RESOLUTION) + 1
 
static const int16_t IST8310_MIN_VAL_XY = -IST8310_MAX_VAL_XY
 
static const int16_t IST8310_MAX_VAL_Z = (2500 / IST8310_RESOLUTION) + 1
 
static const int16_t IST8310_MIN_VAL_Z = -IST8310_MAX_VAL_Z
 
const AP_HAL::HALhal
 

Macro Definition Documentation

◆ AVGCNTL_REG

#define AVGCNTL_REG   0x41

Definition at line 44 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ AVGCNTL_VAL_XZ_0

#define AVGCNTL_VAL_XZ_0   (0)

Definition at line 45 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_XZ_16

#define AVGCNTL_VAL_XZ_16   (4)

Definition at line 49 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ AVGCNTL_VAL_XZ_2

#define AVGCNTL_VAL_XZ_2   (1)

Definition at line 46 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_XZ_4

#define AVGCNTL_VAL_XZ_4   (2)

Definition at line 47 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_XZ_8

#define AVGCNTL_VAL_XZ_8   (3)

Definition at line 48 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_Y_0

#define AVGCNTL_VAL_Y_0   (0 << 3)

Definition at line 50 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_Y_16

#define AVGCNTL_VAL_Y_16   (4 << 3)

Definition at line 54 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ AVGCNTL_VAL_Y_2

#define AVGCNTL_VAL_Y_2   (1 << 3)

Definition at line 51 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_Y_4

#define AVGCNTL_VAL_Y_4   (2 << 3)

Definition at line 52 of file AP_Compass_IST8310.cpp.

◆ AVGCNTL_VAL_Y_8

#define AVGCNTL_VAL_Y_8   (3 << 3)

Definition at line 53 of file AP_Compass_IST8310.cpp.

◆ CNTL1_REG

#define CNTL1_REG   0xA

Definition at line 38 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::start_conversion().

◆ CNTL1_VAL_SINGLE_MEASUREMENT_MODE

#define CNTL1_VAL_SINGLE_MEASUREMENT_MODE   0x1

Definition at line 39 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::start_conversion().

◆ CNTL2_REG

#define CNTL2_REG   0xB

Definition at line 41 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ CNTL2_VAL_SRST

#define CNTL2_VAL_SRST   1

Definition at line 42 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ DEVICE_ID

#define DEVICE_ID   0x10

Definition at line 29 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ IST8310_RESOLUTION

#define IST8310_RESOLUTION   0.3

Definition at line 68 of file AP_Compass_IST8310.cpp.

◆ OUTPUT_X_H_REG

#define OUTPUT_X_H_REG   0x4

Definition at line 32 of file AP_Compass_IST8310.cpp.

◆ OUTPUT_X_L_REG

#define OUTPUT_X_L_REG   0x3

Definition at line 31 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::timer().

◆ OUTPUT_Y_H_REG

#define OUTPUT_Y_H_REG   0x6

Definition at line 34 of file AP_Compass_IST8310.cpp.

◆ OUTPUT_Y_L_REG

#define OUTPUT_Y_L_REG   0x5

Definition at line 33 of file AP_Compass_IST8310.cpp.

◆ OUTPUT_Z_H_REG

#define OUTPUT_Z_H_REG   0x8

Definition at line 36 of file AP_Compass_IST8310.cpp.

◆ OUTPUT_Z_L_REG

#define OUTPUT_Z_L_REG   0x7

Definition at line 35 of file AP_Compass_IST8310.cpp.

◆ PDCNTL_REG

#define PDCNTL_REG   0x42

Definition at line 56 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ PDCNTL_VAL_PULSE_DURATION_NORMAL

#define PDCNTL_VAL_PULSE_DURATION_NORMAL   0xC0

Definition at line 57 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

◆ SAMPLING_PERIOD_USEC

#define SAMPLING_PERIOD_USEC   (10 * AP_USEC_PER_MSEC)

Definition at line 59 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init(), and AP_Compass_IST8310::timer().

◆ WAI_REG

#define WAI_REG   0x0

Definition at line 28 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::init().

Variable Documentation

◆ hal

const AP_HAL::HAL& hal

Definition at line 14 of file AC_PID_test.cpp.

◆ IST8310_MAX_VAL_XY

const int16_t IST8310_MAX_VAL_XY = (1600 / IST8310_RESOLUTION) + 1
static

Definition at line 70 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::timer().

◆ IST8310_MAX_VAL_Z

const int16_t IST8310_MAX_VAL_Z = (2500 / IST8310_RESOLUTION) + 1
static

Definition at line 72 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::timer().

◆ IST8310_MIN_VAL_XY

const int16_t IST8310_MIN_VAL_XY = -IST8310_MAX_VAL_XY
static

Definition at line 71 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::timer().

◆ IST8310_MIN_VAL_Z

const int16_t IST8310_MIN_VAL_Z = -IST8310_MAX_VAL_Z
static

Definition at line 73 of file AP_Compass_IST8310.cpp.

Referenced by AP_Compass_IST8310::timer().