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

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

Classes

struct  ist8310_bus_option
 

Functions

void start (enum IST8310_BUS busid, int address, enum Rotation rotation)
 Start the driver. More...
 
bool start_bus (struct ist8310_bus_option &bus, int address, enum Rotation rotation)
 start driver for a specific bus option More...
 
struct ist8310_bus_optionfind_bus (enum IST8310_BUS busid)
 find a bus structure for a busid More...
 
void test (enum IST8310_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 IST8310_BUS busid)
 Reset the driver. More...
 
int info (enum IST8310_BUS busid)
 Print a little info about the driver. More...
 
int calibrate (enum IST8310_BUS busid)
 Automatic scale calibration. More...
 
void usage ()
 Prints info about the driver argument usage. More...
 

Variables

struct ist8310::ist8310_bus_option bus_options []
 

Detailed Description

Local functions in support of the shell command.

Function Documentation

◆ calibrate()

int ist8310::calibrate ( enum IST8310_BUS  busid)

Automatic scale calibration.

Basic idea:

output = (ext field +- 1.1 Ga self-test) * scale factor

and consequently:

1.1 Ga = (excited - normal) * scale factor scale factor = (excited - normal) / 1.1 Ga

sxy = (excited - normal) / 766 | for conf reg. B set to 0x60 / Gain = 3 sz = (excited - normal) / 713 | for conf reg. B set to 0x60 / Gain = 3

By subtracting the non-excited measurement the pure 1.1 Ga reading can be extracted and the sensitivity of all axes can be matched.

SELF TEST OPERATION To check the IST8310L for proper operation, a self test feature in incorporated in which the sensor will change the polarity on all 3 axis. The values with and with and without selftest on shoult be compared and if the absolete value are equal the IC is functional.

Definition at line 1329 of file ist8310.cpp.

References ist8310::ist8310_bus_option::devpath, err, fd, find_bus(), IST8310::ioctl(), MAGIOCCALIBRATE, and OK.

Referenced by ist8310_main().

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

◆ find_bus()

struct ist8310_bus_option & ist8310::find_bus ( enum IST8310_BUS  busid)

find a bus structure for a busid

Definition at line 1230 of file ist8310.cpp.

References bus_options, errx, IST8310_BUS_ALL, and NUM_BUS_OPTIONS.

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

Here is the caller graph for this function:

◆ info()

int ist8310::info ( enum IST8310_BUS  busid)

Print a little info about the driver.

Definition at line 1383 of file ist8310.cpp.

References ist8310::ist8310_bus_option::busid, ist8310::ist8310_bus_option::dev, ist8310::ist8310_bus_option::devpath, find_bus(), and IST8310::print_info().

Referenced by ist8310_main().

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

◆ reset()

void ist8310::reset ( enum IST8310_BUS  busid)

Reset the driver.

Definition at line 1354 of file ist8310.cpp.

References ist8310::ist8310_bus_option::devpath, err, fd, find_bus(), IST8310::ioctl(), SENSOR_POLLRATE_DEFAULT, SENSORIOCRESET, and SENSORIOCSPOLLRATE.

Referenced by ist8310_main().

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

◆ start()

void ist8310::start ( enum IST8310_BUS  busid,
int  address,
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 1204 of file ist8310.cpp.

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

Referenced by ist8310_main().

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

◆ start_bus()

bool ist8310::start_bus ( struct ist8310_bus_option bus,
int  address,
enum Rotation  rotation 
)

start driver for a specific bus option

Definition at line 1164 of file ist8310.cpp.

References ist8310::ist8310_bus_option::dev, errx, fd, IST8310::ioctl(), OK, SENSOR_POLLRATE_DEFAULT, and SENSORIOCSPOLLRATE.

Referenced by start().

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

◆ test()

void ist8310::test ( enum IST8310_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 1249 of file ist8310.cpp.

References ist8310::ist8310_bus_option::devpath, err, errx, fd, find_bus(), IST8310::ioctl(), mag_report, MAGIOCGEXTERNAL, and IST8310::read().

Referenced by ist8310_main().

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

◆ usage()

void ist8310::usage ( void  )

Prints info about the driver argument usage.

Prints info about the driver argument usage.

Definition at line 1393 of file ist8310.cpp.

References IST8310_BUS_I2C_ADDR, IST8310_BUS_I2C_EXTERNAL, and IST8310_BUS_I2C_INTERNAL.

Referenced by ist8310_main().

Here is the caller graph for this function:

Variable Documentation

◆ bus_options

struct ist8310::ist8310_bus_option ist8310::bus_options[]
Initial value:
= {
{ IST8310_BUS_I2C_EXTERNAL, "/dev/ist8310_ext", PX4_I2C_BUS_EXPANSION, NULL },
}

Referenced by find_bus(), and start().