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

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

Functions

int reset ()
 Reset the driver. More...
 
int start (uint8_t rotation)
 Attempt to start driver on all available I2C busses. More...
 
int start_bus (uint8_t rotation, int i2c_bus)
 Start the driver on a specific bus. More...
 
int status ()
 Print the driver status. More...
 
int stop ()
 Stop the driver. More...
 
int 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 usage ()
 Prints info about the driver argument usage. More...
 

Variables

SRF02g_dev
 

Detailed Description

Local functions in support of the shell command.

Function Documentation

◆ reset()

int srf02::reset ( )

Reset the driver.

Definition at line 562 of file srf02.cpp.

References fd, SRF02::ioctl(), px4_close(), px4_open(), SENSOR_POLLRATE_DEFAULT, SENSORIOCRESET, SENSORIOCSPOLLRATE, and SRF02_DEVICE_PATH.

Referenced by srf02_main().

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

◆ start()

int srf02::start ( uint8_t  rotation)

Attempt to start driver on all available I2C busses.

This function will return as soon as the first sensor is detected on one of the available busses or if no sensors are detected.

Definition at line 593 of file srf02.cpp.

References i2c_bus_options, NUM_I2C_BUS_OPTIONS, and start_bus().

Referenced by srf02_main().

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

◆ start_bus()

int srf02::start_bus ( uint8_t  rotation,
int  i2c_bus 
)

Start the driver on a specific bus.

This function only returns if the sensor is up and running or could not be detected successfully.

Definition at line 616 of file srf02.cpp.

References fd, g_dev, SRF02::init(), SRF02::ioctl(), OK, px4_close(), px4_open(), SENSOR_POLLRATE_DEFAULT, SENSORIOCSPOLLRATE, SRF02::SRF02(), and SRF02_DEVICE_PATH.

Referenced by srf02_main(), and start().

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

◆ status()

int srf02::status ( )

Print the driver status.

Definition at line 662 of file srf02.cpp.

References SRF02::print_info().

Referenced by srf02_main().

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

◆ stop()

int srf02::stop ( )

Stop the driver.

Stop the driver.

Definition at line 679 of file srf02.cpp.

References g_dev.

Referenced by srf02_main().

Here is the caller graph for this function:

◆ test()

int srf02::test ( )

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 699 of file srf02.cpp.

References fd, SRF02::ioctl(), OK, px4_open(), SRF02::read(), SENSOR_POLLRATE_DEFAULT, SENSORIOCSPOLLRATE, and SRF02_DEVICE_PATH.

Referenced by srf02_main().

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

◆ usage()

int srf02::usage ( void  )

Prints info about the driver argument usage.

Prints info about the driver argument usage.

Definition at line 762 of file srf02.cpp.

References SRF02_BUS_DEFAULT.

Referenced by srf02_main().

Here is the caller graph for this function:

Variable Documentation

◆ g_dev

SRF02* srf02::g_dev

Definition at line 548 of file srf02.cpp.

Referenced by start_bus(), and stop().