29 #include "generated/airframe.h"
36 #include "pprzlink/messages.h"
38 #ifndef INS_YAW_NEUTRAL_DEFAULT
39 #define INS_YAW_NEUTRAL_DEFAULT 0.
44 #define VN100_SPI_DEV spi1
48 #ifndef VN100_SLAVE_IDX
49 #define VN100_SLAVE_IDX 0
164 #ifndef INS_VN100_READ_ONLY
308 #include "pprzlink/messages.h"
#define VN100_CmdID_ReadRegister
#define VN100_REG_ADOR_SIZE
VN100_Param Data[VN100_SPI_BUFFER_SIZE]
#define VN100_REG_SBAUD_SIZE
#define VN100_REG_ADOF_SIZE
#define VN100_CmdID_WriteRegister
#define VN100_REG_YMR_SIZE
Common code for AP and FBW telemetry.
void float_eulers_of_quat(struct FloatEulers *e, struct FloatQuat *q)
euler rotation 'ZYX'
enum SPIClockPolarity cpol
clock polarity control
enum SPIClockPhase cpha
clock phase control
enum SPISlaveSelect select
slave selection behavior
enum SPIDataSizeSelect dss
data transfer word size
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
uint16_t input_length
number of data words to read
volatile uint8_t * input_buf
pointer to receive buffer for DMA
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
uint16_t output_length
number of data words to write
enum SPITransactionStatus status
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
@ SPICpolIdleHigh
CPOL = 1.
@ SPISelectUnselect
slave is selected before transaction and unselected after
SPI transaction structure.
static void stateSetNedToBodyEulers_f(struct FloatEulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (float).
static void stateSetBodyRates_f(struct FloatRates *body_rate)
Set vehicle body angular rate (float).
VN100_Req_Packet last_send_packet
struct FloatRMat ins_rmat
VN100_Res_Packet last_received_packet
static bool ins_configure(void)
void vn100_periodic_task(void)
#define INS_YAW_NEUTRAL_DEFAULT
driver for the VectorNav VN100
void vn100_report_task(void)
void vn100_event_task(void)
struct FloatVect3 ins_mag
static void parse_ins_msg(void)
struct FloatVect3 ins_accel
struct FloatEulers ins_eulers
struct FloatRates ins_rates
struct FloatQuat ins_quat
struct spi_transaction vn100_trans
volatile uint8_t ins_msg_received
Interface for the VectorNav VN100 AHRS use the binary protocal on the SPI link.
#define INS_VN100_SET_BAUD
#define INS_VN100_SET_ADOR
#define INS_VN100_SET_ADOF
Architecture independent SPI (Serial Peripheral Interface) API.
API to get/set the generic vehicle states.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.