PX4 Firmware
PX4 Autopilot Software http://px4.io
qmc5883 Namespace Reference

Local functions in support of the shell command. More...

Classes

struct  qmc5883_bus_option
 

Functions

void start (enum QMC5883_BUS busid, enum Rotation rotation)
 Start the driver. More...
 
int stop ()
 Stop the driver. More...
 
bool start_bus (struct qmc5883_bus_option &bus, enum Rotation rotation)
 start driver for a specific bus option More...
 
struct qmc5883_bus_optionfind_bus (enum QMC5883_BUS busid)
 find a bus structure for a busid More...
 
void test (enum QMC5883_BUS busid)
 Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes. More...
 
void reset (enum QMC5883_BUS busid)
 Reset the driver. More...
 
int info (enum QMC5883_BUS busid)
 Print a little info about the driver. More...
 
int temp_enable (QMC5883_BUS busid, bool enable)
 
void usage ()
 Prints info about the driver argument usage. More...
 

Variables

struct qmc5883::qmc5883_bus_option bus_options []
 

Detailed Description

Local functions in support of the shell command.

Function Documentation

◆ find_bus()

struct qmc5883_bus_option & qmc5883::find_bus ( enum QMC5883_BUS  busid)

find a bus structure for a busid

Definition at line 934 of file qmc5883.cpp.

References bus_options, errx, NUM_BUS_OPTIONS, and QMC5883_BUS_ALL.

Referenced by info(), reset(), and test().

Here is the caller graph for this function:

◆ info()

int qmc5883::info ( enum QMC5883_BUS  busid)

Print a little info about the driver.

Definition at line 1041 of file qmc5883.cpp.

References qmc5883::qmc5883_bus_option::busid, qmc5883::qmc5883_bus_option::dev, qmc5883::qmc5883_bus_option::devpath, find_bus(), QMC5883::print_info(), and warnx.

Referenced by qmc5883_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void qmc5883::reset ( enum QMC5883_BUS  busid)

Reset the driver.

Definition at line 1014 of file qmc5883.cpp.

References qmc5883::qmc5883_bus_option::devpath, err, fd, find_bus(), QMC5883::ioctl(), cdev::CDev::open(), SENSOR_POLLRATE_DEFAULT, SENSORIOCRESET, and SENSORIOCSPOLLRATE.

Referenced by qmc5883_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

void qmc5883::start ( enum QMC5883_BUS  busid,
enum Rotation  rotation 
)

Start the driver.

This function call only returns once the driver is either successfully up and running or failed to start.

Definition at line 891 of file qmc5883.cpp.

References bus_options, NUM_BUS_OPTIONS, QMC5883_BUS_ALL, and start_bus().

Referenced by qmc5883_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_bus()

bool qmc5883::start_bus ( struct qmc5883_bus_option bus,
enum Rotation  rotation 
)

start driver for a specific bus option

Definition at line 846 of file qmc5883.cpp.

References cdev::CDev::close(), qmc5883::qmc5883_bus_option::dev, errx, fd, QMC5883::ioctl(), OK, cdev::CDev::open(), QMC5883::QMC5883(), SENSOR_POLLRATE_DEFAULT, SENSORIOCSPOLLRATE, and warnx.

Referenced by start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

int qmc5883::stop ( )

Stop the driver.

Stop the driver.

Definition at line 915 of file qmc5883.cpp.

References bus_options, qmc5883::qmc5883_bus_option::dev, NUM_BUS_OPTIONS, and QMC5883::stop().

Referenced by qmc5883_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ temp_enable()

int qmc5883::temp_enable ( QMC5883_BUS  busid,
bool  enable 
)

◆ test()

void qmc5883::test ( enum QMC5883_BUS  busid)

Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes.

Definition at line 953 of file qmc5883.cpp.

References qmc5883::qmc5883_bus_option::devpath, err, errx, fd, find_bus(), QMC5883::ioctl(), mag_report, MAGIOCGEXTERNAL, cdev::CDev::open(), cdev::CDev::poll(), QMC5883::read(), and warnx.

Referenced by qmc5883_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

void qmc5883::usage ( void  )

Prints info about the driver argument usage.

Prints info about the driver argument usage.

Definition at line 1051 of file qmc5883.cpp.

References warnx.

Referenced by qmc5883_main().

Here is the caller graph for this function:

Variable Documentation

◆ bus_options

struct qmc5883::qmc5883_bus_option qmc5883::bus_options[]
Initial value:
= {
{ QMC5883_BUS_I2C_EXTERNAL, "/dev/qmc5883_ext", &QMC5883_I2C_interface, PX4_I2C_BUS_EXPANSION, NULL },
}
device::Device * QMC5883_I2C_interface(int bus)
Definition: qmc5883_i2c.cpp:83

Referenced by find_bus(), start(), and stop().