|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <drivers/device/i2c.h>#include <lib/parameters/param.h>#include <perf/perf_counter.h>#include <px4_platform_common/px4_config.h>#include <px4_platform_common/defines.h>#include <px4_platform_common/getopt.h>#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>#include <px4_platform_common/module.h>#include <uORB/topics/distance_sensor.h>#include <uORB/uORB.h>Go to the source code of this file.
Classes | |
| class | TERARANGER |
Namespaces | |
| teraranger | |
| Local functions in support of the shell command. | |
Macros | |
| #define | TERARANGER_BUS_DEFAULT PX4_I2C_BUS_EXPANSION |
| #define | TERARANGER_DEVICE_PATH "/dev/teraranger" |
| #define | TERARANGER_ONE_BASEADDR 0x30 |
| #define | TERARANGER_EVO_BASEADDR 0x31 |
| #define | TERARANGER_MEASURE_REG 0x00 |
| #define | TERARANGER_WHO_AM_I_REG 0x01 |
| #define | TERARANGER_WHO_AM_I_REG_VAL 0xA1 |
| #define | TERARANGER_ONE_MAX_DISTANCE (14.00f) |
| #define | TERARANGER_ONE_MIN_DISTANCE (0.20f) |
| #define | TERARANGER_EVO_3M_MAX_DISTANCE (3.0f) |
| #define | TERARANGER_EVO_3M_MIN_DISTANCE (0.10f) |
| #define | TERARANGER_EVO_60M_MAX_DISTANCE (60.0f) |
| #define | TERARANGER_EVO_60M_MIN_DISTANCE (0.50f) |
| #define | TERARANGER_EVO_600HZ_MAX_DISTANCE (8.0f) |
| #define | TERARANGER_EVO_600HZ_MIN_DISTANCE (0.75f) |
| #define | TERARANGER_MEASUREMENT_INTERVAL 50_us |
Functions | |
| static uint8_t | crc8 (uint8_t *p, uint8_t len) |
| int | teraranger::start (const uint8_t orientation) |
| Attempt to start driver on all available I2C busses. More... | |
| int | teraranger::start_bus (const int i2c_bus, const uint8_t orientation) |
| Start the driver on a specific bus. More... | |
| int | teraranger::status () |
| Print the driver status. More... | |
| int | teraranger::stop () |
| Stop the driver. More... | |
| int | teraranger::usage () |
| Prints info about the driver argument usage. More... | |
| __EXPORT int | teraranger_main (int argc, char *argv[]) |
| Driver 'main' command. More... | |
Variables | |
| static const uint8_t | crc_table [] |
| TERARANGER * | teraranger::g_dev |
Driver for the TeraRanger One range finders connected via I2C.
Definition in file teraranger.cpp.
| #define TERARANGER_BUS_DEFAULT PX4_I2C_BUS_EXPANSION |
Definition at line 55 of file teraranger.cpp.
Referenced by teraranger_main().
| #define TERARANGER_DEVICE_PATH "/dev/teraranger" |
Definition at line 56 of file teraranger.cpp.
| #define TERARANGER_EVO_3M_MAX_DISTANCE (3.0f) |
Definition at line 69 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_EVO_3M_MIN_DISTANCE (0.10f) |
Definition at line 70 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_EVO_600HZ_MAX_DISTANCE (8.0f) |
Definition at line 75 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_EVO_600HZ_MIN_DISTANCE (0.75f) |
Definition at line 76 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_EVO_60M_MAX_DISTANCE (60.0f) |
Definition at line 72 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_EVO_60M_MIN_DISTANCE (0.50f) |
Definition at line 73 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_EVO_BASEADDR 0x31 |
Definition at line 58 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_MEASURE_REG 0x00 |
Definition at line 61 of file teraranger.cpp.
Referenced by TERARANGER::measure().
| #define TERARANGER_MEASUREMENT_INTERVAL 50_us |
Definition at line 78 of file teraranger.cpp.
Referenced by TERARANGER::print_info(), and TERARANGER::start().
| #define TERARANGER_ONE_BASEADDR 0x30 |
Definition at line 57 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_ONE_MAX_DISTANCE (14.00f) |
Definition at line 66 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_ONE_MIN_DISTANCE (0.20f) |
Definition at line 67 of file teraranger.cpp.
Referenced by TERARANGER::init().
| #define TERARANGER_WHO_AM_I_REG 0x01 |
Definition at line 62 of file teraranger.cpp.
Referenced by TERARANGER::probe().
| #define TERARANGER_WHO_AM_I_REG_VAL 0xA1 |
Definition at line 63 of file teraranger.cpp.
Referenced by TERARANGER::probe().
|
static |
Definition at line 180 of file teraranger.cpp.
References crc_table.
Referenced by TERARANGER::collect(), DShotTelemetry::decodeByte(), and px4::bst::BST::send_packet().
| __EXPORT int teraranger_main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Driver 'main' command.
Definition at line 574 of file teraranger.cpp.
References teraranger::start(), teraranger::start_bus(), teraranger::status(), teraranger::stop(), TERARANGER_BUS_DEFAULT, and teraranger::usage().
|
static |
Definition at line 155 of file teraranger.cpp.
Referenced by crc8().