PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <fcntl.h>
#include <math.h>
#include <poll.h>
#include <semaphore.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
#include <board_config.h>
#include <containers/Array.hpp>
#include <drivers/device/device.h>
#include <drivers/device/i2c.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_range_finder.h>
#include <perf/perf_counter.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/getopt.h>
#include <px4_platform_common/module_params.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <uORB/uORB.h>
#include <uORB/topics/distance_sensor.h>
Go to the source code of this file.
Classes | |
class | MB12XX |
Namespaces | |
mb12xx | |
Local functions in support of the shell command. | |
Macros | |
#define | MB12XX_BASE_ADDR 0x70 |
#define | MB12XX_MIN_ADDR 0x5A |
#define | MB12XX_BUS_DEFAULT PX4_I2C_BUS_EXPANSION |
#define | MB12XX_BUS_SPEED 100000 |
#define | MB12XX_DEVICE_PATH "/dev/mb12xx" |
#define | MB12XX_TAKE_RANGE_REG 0x51 |
#define | MB12XX_SET_ADDRESS_1 0xAA |
#define | MB12XX_SET_ADDRESS_2 0xA5 |
#define | MB12XX_MIN_DISTANCE (0.20f) |
#define | MB12XX_MAX_DISTANCE (7.65f) |
#define | MB12XX_MEASURE_INTERVAL 100_ms |
#define | MB12XX_INTERVAL_BETWEEN_SUCCESIVE_FIRES 100_ms |
Functions | |
int | mb12xx::reset () |
Reset the driver. More... | |
int | mb12xx::set_address (const uint8_t address=MB12XX_BASE_ADDR) |
int | mb12xx::start () |
Attempt to start driver on all available I2C busses. More... | |
int | mb12xx::start_bus (const int i2c_bus) |
Start the driver on a specific bus. More... | |
int | mb12xx::status () |
Print the driver status. More... | |
int | mb12xx::stop () |
Stop the driver. More... | |
int | mb12xx::test () |
Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes. More... | |
int | mb12xx::usage () |
Print information about the driver usage. More... | |
__EXPORT int | mb12xx_main (int argc, char *argv[]) |
Driver 'main' command. More... | |
Variables | |
MB12XX * | mb12xx::g_dev |
Driver for the Maxbotix sonar range finders connected via I2C.
Definition in file mb12xx.cpp.
#define MB12XX_BASE_ADDR 0x70 |
Definition at line 73 of file mb12xx.cpp.
Referenced by MB12XX::init(), and mb12xx_main().
#define MB12XX_BUS_DEFAULT PX4_I2C_BUS_EXPANSION |
Definition at line 75 of file mb12xx.cpp.
Referenced by mb12xx_main(), and mb12xx::usage().
#define MB12XX_BUS_SPEED 100000 |
Definition at line 76 of file mb12xx.cpp.
#define MB12XX_DEVICE_PATH "/dev/mb12xx" |
Definition at line 77 of file mb12xx.cpp.
Referenced by pmw3901::test().
#define MB12XX_INTERVAL_BETWEEN_SUCCESIVE_FIRES 100_ms |
Definition at line 89 of file mb12xx.cpp.
Referenced by MB12XX::init().
#define MB12XX_MAX_DISTANCE (7.65f) |
Definition at line 86 of file mb12xx.cpp.
Referenced by MB12XX::collect().
#define MB12XX_MEASURE_INTERVAL 100_ms |
Definition at line 88 of file mb12xx.cpp.
#define MB12XX_MIN_ADDR 0x5A |
Definition at line 74 of file mb12xx.cpp.
Referenced by MB12XX::init().
#define MB12XX_MIN_DISTANCE (0.20f) |
Definition at line 85 of file mb12xx.cpp.
Referenced by MB12XX::collect().
#define MB12XX_SET_ADDRESS_1 0xAA |
Definition at line 81 of file mb12xx.cpp.
Referenced by MB12XX::set_address().
#define MB12XX_SET_ADDRESS_2 0xA5 |
Definition at line 82 of file mb12xx.cpp.
Referenced by MB12XX::set_address().
#define MB12XX_TAKE_RANGE_REG 0x51 |
Definition at line 80 of file mb12xx.cpp.
Referenced by MB12XX::measure().
__EXPORT int mb12xx_main | ( | int | argc, |
char * | argv[] | ||
) |
Driver 'main' command.
Definition at line 599 of file mb12xx.cpp.
References MB12XX_BASE_ADDR, MB12XX_BUS_DEFAULT, mb12xx::reset(), mb12xx::set_address(), mb12xx::start(), mb12xx::start_bus(), mb12xx::status(), mb12xx::stop(), mb12xx::test(), and mb12xx::usage().