|
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Copyright (C) 2026 Fabien-B fabie.nosp@m.n-b@.nosp@m.githu.nosp@m.b.co.nosp@m.m This file is part of paparazzi. More...
#include "modules/decawave/dw1000_range_arduino.h"#include "std.h"#include "mcu_periph/uart.h"#include "modules/core/abi.h"#include "modules/core/abi_sender_ids.h"#include "modules/decawave/trilateration.h"#include "generated/airframe.h"#include <stdio.h>#include <stdlib.h>#include <string.h>
Include dependency graph for dw1000_range_arduino.c:Go to the source code of this file.
Data Structures | |
| struct | DW1000RangeArduino |
| DW1000 Arduino range parser state. More... | |
Macros | |
| #define | DW_STX 0xFE |
| frame sync byte | |
| #define | DW_WAIT_STX 0 |
| Parsing states. | |
| #define | DW_GET_DATA 1 |
| #define | DW_GET_CK 2 |
| #define | DW_NB_DATA 6 |
Functions | |
| static float | float_from_buf (uint8_t *b) |
| Utility function to get float from buffer. | |
| static uint16_t | uint16_from_buf (uint8_t *b) |
| Utility function to get uint16_t from buffer. | |
| static void | send_anchor_data (struct DW1000RangeArduino *dw) |
| Send range data decoded from the serial frame. | |
| static void | dw1000_range_arduino_parse (struct DW1000RangeArduino *dw, uint8_t c) |
| Data parsing function. | |
| void | dw1000_range_arduino_init (void) |
| void | dw1000_range_arduino_event (void) |
Variables | |
| struct DW1000RangeArduino | dw1000_range_arduino |
Copyright (C) 2026 Fabien-B fabie.nosp@m.n-b@.nosp@m.githu.nosp@m.b.co.nosp@m.m This file is part of paparazzi.
See LICENCE file.
Driver to get ranging data from Decawave DW1000 modules connected to Arduino Decawave DW1000 modules (http://www.decawave.com/products/dwm1000-module) are Ultra-Wide-Band devices that can be used for communication and ranging. Especially, using 3 modules as anchors can provide data for a localization system based on trilateration. The DW1000 is using a SPI connection, but an arduino-compatible board can be used with the library https://github.com/thotro/arduino-dw1000 to hyde the low level drivers and provide direct ranging informations.
Definition in file dw1000_range_arduino.c.
| struct DW1000RangeArduino |
DW1000 Arduino range parser state.
Definition at line 38 of file dw1000_range_arduino.c.
Collaboration diagram for DW1000RangeArduino:| Data Fields | ||
|---|---|---|
| uint8_t | buf[DW_NB_DATA] | incoming data buffer |
| uint8_t | ck | checksum |
| struct uart_periph * | dev | |
| uint8_t | idx | buffer index |
| uint8_t | state | parser state |
| #define DW_GET_CK 2 |
Definition at line 34 of file dw1000_range_arduino.c.
| #define DW_GET_DATA 1 |
Definition at line 33 of file dw1000_range_arduino.c.
| #define DW_NB_DATA 6 |
Definition at line 35 of file dw1000_range_arduino.c.
| #define DW_STX 0xFE |
frame sync byte
Definition at line 29 of file dw1000_range_arduino.c.
| #define DW_WAIT_STX 0 |
Parsing states.
Definition at line 32 of file dw1000_range_arduino.c.
Definition at line 114 of file dw1000_range_arduino.c.
References DW1000RangeArduino::dev, dw1000_range_arduino, dw1000_range_arduino_parse(), foo, uart_char_available(), and uart_getch().
Here is the call graph for this function:Definition at line 109 of file dw1000_range_arduino.c.
References DW1000RangeArduino::dev, dw1000_range_arduino, and foo.
|
static |
Data parsing function.
Definition at line 74 of file dw1000_range_arduino.c.
References DW_GET_CK, DW_GET_DATA, DW_NB_DATA, DW_STX, DW_WAIT_STX, foo, and send_anchor_data().
Referenced by dw1000_range_arduino_event().
Here is the call graph for this function:
Here is the caller graph for this function:Utility function to get float from buffer.
Definition at line 50 of file dw1000_range_arduino.c.
Referenced by send_anchor_data().
Here is the caller graph for this function:
|
static |
Send range data decoded from the serial frame.
Definition at line 64 of file dw1000_range_arduino.c.
References float_from_buf(), foo, get_sys_time_usec(), uint16_from_buf(), UWB_DW1000_ARDUINO_ID, and UWB_POSITIONING_TAG_ID.
Referenced by dw1000_range_arduino_parse().
Here is the call graph for this function:
Here is the caller graph for this function:Utility function to get uint16_t from buffer.
Definition at line 57 of file dw1000_range_arduino.c.
Referenced by send_anchor_data().
Here is the caller graph for this function:| struct DW1000RangeArduino dw1000_range_arduino |
Definition at line 46 of file dw1000_range_arduino.c.
Referenced by dw1000_range_arduino_event(), and dw1000_range_arduino_init().