Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/ins/ins_vn100.h"
#include "generated/airframe.h"
#include "mcu_periph/spi.h"
#include "state.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"
#include "pprzlink/messages.h"
Go to the source code of this file.
Macros | |
#define | INS_YAW_NEUTRAL_DEFAULT 0. |
driver for the VectorNav VN100 More... | |
#define | VN100_SPI_DEV spi1 |
#define | VN100_SLAVE_IDX 0 |
Functions | |
static void | parse_ins_msg (void) |
void | vn100_init (void) |
static bool | ins_configure (void) |
void | vn100_periodic_task (void) |
void | vn100_event_task (void) |
void | vn100_report_task (void) |
Variables | |
float | ins_roll_neutral |
float | ins_pitch_neutral |
float | ins_yaw_neutral |
struct FloatEulers | ins_eulers |
struct FloatQuat | ins_quat |
struct FloatRates | ins_rates |
struct FloatRMat | ins_rmat |
struct FloatVect3 | ins_accel |
struct FloatVect3 | ins_mag |
volatile uint8_t | ins_msg_received |
VN100_Res_Packet | last_received_packet |
VN100_Req_Packet | last_send_packet |
uint32_t | ins_ador |
uint32_t | ins_adof |
uint32_t | ins_baud |
uint8_t | ins_init_status |
struct spi_transaction | vn100_trans |
#define INS_YAW_NEUTRAL_DEFAULT 0. |
driver for the VectorNav VN100
Definition at line 39 of file ins_vn100.c.
Referenced by vn100_init().
#define VN100_SLAVE_IDX 0 |
Definition at line 49 of file ins_vn100.c.
Referenced by vn100_init().
#define VN100_SPI_DEV spi1 |
Definition at line 44 of file ins_vn100.c.
Referenced by ins_configure(), and vn100_periodic_task().
|
inlinestatic |
Definition at line 109 of file ins_vn100.c.
References VN100_Req_Packet::CmdID, spi_transaction::input_length, ins_init_status, INS_VN100_READY, INS_VN100_SET_ADOF, INS_VN100_SET_ADOR, INS_VN100_SET_BAUD, spi_transaction::output_length, VN100_Req_Packet::RegID, spi_submit(), VN100_CmdID_WriteRegister, VN100_REG_ADOF, VN100_REG_ADOF_SIZE, VN100_REG_ADOR, VN100_REG_ADOR_SIZE, VN100_REG_SBAUD, VN100_REG_SBAUD_SIZE, VN100_SPI_DEV, and vn100_trans.
Referenced by vn100_periodic_task().
|
inlinestatic |
Definition at line 185 of file ins_vn100.c.
References VN100_Res_Packet::Data, VN100_Res_Packet::ErrID, VN100_Param::Float, float_eulers_of_quat(), ins_accel, ins_adof, ins_ador, ins_baud, ins_eulers, ins_mag, ins_quat, ins_rates, FloatRates::p, FloatEulers::phi, FloatEulers::psi, FloatRates::q, FloatQuat::qi, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, FloatRates::r, VN100_Res_Packet::RegID, FloatEulers::theta, VN100_Param::UInt, VN100_Error_None, VN100_REG_ADOF, VN100_REG_ADOR, VN100_REG_QAR, VN100_REG_QMA, VN100_REG_QMR, VN100_REG_QTA, VN100_REG_QTM, VN100_REG_QTN, VN100_REG_QTR, VN100_REG_SBAUD, VN100_REG_YMR, VN100_REG_YPR, FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by vn100_event_task().
void vn100_event_task | ( | void | ) |
Definition at line 160 of file ins_vn100.c.
References ins_eulers, ins_pitch_neutral, ins_rates, ins_roll_neutral, parse_ins_msg(), FloatEulers::phi, FloatEulers::psi, SPITransDone, SPITransFailed, SPITransSuccess, stateSetBodyRates_f(), stateSetNedToBodyEulers_f(), spi_transaction::status, FloatEulers::theta, and vn100_trans.
void vn100_init | ( | void | ) |
Definition at line 85 of file ins_vn100.c.
References spi_transaction::cpha, spi_transaction::cpol, spi_transaction::dss, spi_transaction::input_buf, ins_adof, ins_ador, ins_baud, ins_init_status, INS_VN100_SET_BAUD, ins_yaw_neutral, INS_YAW_NEUTRAL_DEFAULT, spi_transaction::output_buf, spi_transaction::select, spi_transaction::slave_idx, SPICphaEdge2, SPICpolIdleHigh, SPIDss8bit, SPISelectUnselect, SPITransDone, spi_transaction::status, VN100_ADOF, VN100_ADOR, VN100_BAUD, VN100_SLAVE_IDX, and vn100_trans.
void vn100_periodic_task | ( | void | ) |
Definition at line 140 of file ins_vn100.c.
References VN100_Req_Packet::CmdID, spi_transaction::input_length, ins_configure(), spi_transaction::output_length, VN100_Req_Packet::RegID, spi_submit(), SPITransDone, spi_transaction::status, TRUE, VN100_CmdID_ReadRegister, VN100_REG_YMR, VN100_REG_YMR_SIZE, VN100_SPI_DEV, and vn100_trans.
void vn100_report_task | ( | void | ) |
Definition at line 311 of file ins_vn100.c.
References DefaultChannel, DefaultDevice, ins_accel, ins_eulers, ins_mag, ins_quat, ins_rates, FloatRates::p, FloatEulers::phi, FloatEulers::psi, FloatRates::q, FloatQuat::qi, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, FloatRates::r, FloatEulers::theta, FloatVect3::x, FloatVect3::y, and FloatVect3::z.
struct FloatVect3 ins_accel |
Definition at line 61 of file ins_vn100.c.
Referenced by parse_ins_msg(), and vn100_report_task().
uint32_t ins_adof |
Definition at line 73 of file ins_vn100.c.
Referenced by parse_ins_msg(), and vn100_init().
uint32_t ins_ador |
Definition at line 72 of file ins_vn100.c.
Referenced by parse_ins_msg(), and vn100_init().
uint32_t ins_baud |
Definition at line 74 of file ins_vn100.c.
Referenced by parse_ins_msg(), and vn100_init().
struct FloatEulers ins_eulers |
Definition at line 57 of file ins_vn100.c.
Referenced by parse_ins_msg(), vn100_event_task(), and vn100_report_task().
uint8_t ins_init_status |
Definition at line 76 of file ins_vn100.c.
Referenced by ins_configure(), and vn100_init().
struct FloatVect3 ins_mag |
Definition at line 62 of file ins_vn100.c.
Referenced by parse_ins_msg(), and vn100_report_task().
volatile uint8_t ins_msg_received |
Definition at line 64 of file ins_vn100.c.
Referenced by ins_event_check_and_handle().
float ins_pitch_neutral |
Definition at line 54 of file ins_vn100.c.
Referenced by vn100_event_task().
struct FloatQuat ins_quat |
Definition at line 58 of file ins_vn100.c.
Referenced by parse_ins_msg(), and vn100_report_task().
struct FloatRates ins_rates |
Definition at line 59 of file ins_vn100.c.
Referenced by parse_ins_msg(), vn100_event_task(), and vn100_report_task().
struct FloatRMat ins_rmat |
Definition at line 60 of file ins_vn100.c.
float ins_roll_neutral |
Definition at line 53 of file ins_vn100.c.
Referenced by vn100_event_task().
float ins_yaw_neutral |
Definition at line 55 of file ins_vn100.c.
Referenced by vn100_init().
VN100_Res_Packet last_received_packet |
Definition at line 67 of file ins_vn100.c.
VN100_Req_Packet last_send_packet |
Definition at line 69 of file ins_vn100.c.
struct spi_transaction vn100_trans |
Definition at line 82 of file ins_vn100.c.
Referenced by ins_configure(), vn100_event_task(), vn100_init(), and vn100_periodic_task().