Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
mateksys_3901_l0x.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Paparazzi Team
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, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
27 /*
28 Since the is no official MSP2 nor MSP1 message definition we choose for time being that
29 the IDs to be compatible with INAV as see here
30 https://github.com/iNavFlight/inav/blob/master/src/main/msp/msp_protocol_v2_sensor.h
31 https://github.com/iNavFlight/inav/wiki/MSP-V2
32 */
33 
34 #ifndef MATEKSYS_3901_L0X_H
35 #define MATEKSYS_3901_L0X_H
36 
37 #include "std.h"
38 #include "stdbool.h"
39 
40 #define MSP2_IS_SENSOR_MESSAGE(x) ((x) >= 0x1F00 && (x) <= 0x1FFF)
41 
42 #define MSP2_SENSOR_RANGEFINDER 0x1F01
43 #define MSP2_SENSOR_OPTIC_FLOW 0x1F02
44 
70 };
71 
73  struct link_device *device;
75  float time_usec;
84  float distancemm;
86  float velocityX;
87  float velocityY;
89  float scaler_x;
90  float scaler_y;
91 };
92 
93 extern struct Mateksys3901l0X mateksys3901l0x;
94 
95 extern void mateksys3901l0x_init(void);
96 extern void mateksys3901l0x_event(void);
97 extern void mateksys3901l0x_downlink(void);
98 extern void mateksys_3901_l0x_scale_X(float scalex);
99 extern void mateksys_3901_l0x_scale_Y(float scaley);
100 
101 #endif /* MATEKSYS_3901_L0X_H */
102 
void mateksys3901l0x_downlink(void)
void mateksys_3901_l0x_scale_X(float scalex)
Scale the Flow X.
void mateksys3901l0x_init(void)
Initialization function.
enum Mateksys3901l0XParseStatus parse_status
void mateksys3901l0x_event(void)
Receive bytes from the UART port and parse them.
uint8_t distancemm_quality
void mateksys_3901_l0x_scale_Y(float scaley)
Scale the Flow Y.
Mateksys3901l0XParseStatus
@ MATEKSYS_3901_L0X_PARSE_DISTANCEQUALITY
@ MATEKSYS_3901_L0X_PARSE_POINTER
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B4
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B1
@ MATEKSYS_3901_L0X_PARSE_FUNCTION_ID_B2
@ MATEKSYS_3901_L0X_PARSE_CHECKSUM
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B2
@ MATEKSYS_3901_L0X_PARSE_HEAD
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B2
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B3
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B3
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B3
@ MATEKSYS_3901_L0X_INITIALIZE
@ MATEKSYS_3901_L0X_PARSE_LENGTH
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B2
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B4
@ MATEKSYS_3901_L0X_PARSE_MOTIONQUALITY
@ MATEKSYS_3901_L0X_PARSE_DIRECTION
@ MATEKSYS_3901_L0X_PARSE_FUNCTION_ID_B1
@ MATEKSYS_3901_L0X_PARSE_SIZE
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B1
@ MATEKSYS_3901_L0X_PARSE_HEAD2
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B4
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B1
struct link_device * device
struct Mateksys3901l0X mateksys3901l0x
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98