ardupilot/libraries/AP_HAL_Linux
Lucas De Marchi a4c1b0d75f AP_HAL_Linux: add constructor to find I2C bus reliably
The device number in /dev may not be reliable from one boot to another
due to the initialization order of each bus.

For example, in Minnow Board Max, the exposed I2C buses may be i2c-7 and
i2c-8 or i2c-8 and i2c-9 depending if the platform driver in the kernel
is initialized before or after the PCI.

It also may change with different version and configuration of the DT or
UEFI used making another kernel driver to bind to the device. This means that
for Minnow Board Max we need to use something like below to pass to the
constructor:

	static const char * const i2c_devpaths[] = {
	    /* UEFI with lpss set to ACPI */
	    "/devices/platform/80860F41:05",
	    /* UEFI with lpss set to PCI */
	    "/devices/pci0000:00/0000:00:18.6",
	     NULL
	};

The devpath here is the one returned by udev with the following command:

	udevadm info -q path /dev/<i2c-device>

In contrary to the device number in /dev/i2c-N, this path in sysfs is
stable across reboots and can only change if there's a change in the
UEFI firmware or the board's device tree.

This patch assumes the currently supported boards don't have this
problem so it's not touching them.
2015-06-30 09:10:54 +10:00
..
examples/BusTest BusTest: Fix compilation error with AP_ADC 2015-06-26 21:59:22 +10:00
AnalogIn_Navio.cpp AP_HAL_Linux: use functor macros 2015-05-26 13:46:53 +10:00
AnalogIn_Navio.h AP_HAL_Linux: renamed AnalogIn_Navio 2015-04-14 10:16:26 +10:00
AnalogIn.cpp HAL_Linux: use board subtypes 2014-07-14 09:44:35 +10:00
AnalogIn.h AP_HAL: added board_voltage AnalogIn method 2014-02-14 21:25:38 +11:00
AP_HAL_Linux_Main.h HAL_Linux: use board subtypes 2014-07-14 09:44:35 +10:00
AP_HAL_Linux_Namespace.h AP_HAL_Linux: Add RcInput and RcOutput with only one PRU when using a BBB. BBBMINI use the RC AIO PRU firmware already 2015-03-16 09:33:54 +11:00
AP_HAL_Linux_Private.h AP_HAL_Linux: renamed AnalogIn_Navio 2015-04-14 10:16:26 +10:00
AP_HAL_Linux.h HAL_Linux: use board subtypes 2014-07-14 09:44:35 +10:00
dsm.cpp HAL_Linux: fixed build warnings 2014-10-09 16:49:23 +11:00
dsm.h HAL_Linux: added low level DSM decoder 2014-10-08 12:50:50 +11:00
GPIO_BBB.cpp AP_HAL_Linux: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
GPIO_BBB.h AP_HAL_Linux: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
GPIO_RPI.cpp AP_HAL_Linux: add RPi version runtime detection 2015-04-14 10:16:25 +10:00
GPIO_RPI.h AP_HAL_Linux: add RPi version runtime detection 2015-04-14 10:16:25 +10:00
GPIO.cpp HAL_Linux: add GPIO driver for Raspberry Pi 2014-10-30 13:30:07 +11:00
GPIO.h AP_HAL_Linux: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
HAL_Linux_Class.cpp HAL_Linux: added udp example to help 2015-06-03 21:47:01 +10:00
HAL_Linux_Class.h AP_HAL_Linux: initial Linux AP_HAL 2013-09-28 21:24:01 +10:00
I2CDriver.cpp AP_HAL_Linux: add constructor to find I2C bus reliably 2015-06-30 09:10:54 +10:00
I2CDriver.h AP_HAL_Linux: add constructor to find I2C bus reliably 2015-06-30 09:10:54 +10:00
RCInput_AioPRU.cpp AP_HAL_Linux: Add RcInput and RcOutput with only one PRU when using a BBB. BBBMINI use the RC AIO PRU firmware already 2015-03-16 09:33:54 +11:00
RCInput_AioPRU.h AP_HAL_Linux: Add RcInput and RcOutput with only one PRU when using a BBB. BBBMINI use the RC AIO PRU firmware already 2015-03-16 09:33:54 +11:00
RCInput_Navio.cpp AP_HAL_Linux: Navio RCInput reimplemented. 2015-06-29 16:45:43 +10:00
RCInput_Navio.h AP_HAL_Linux: Navio RCInput reimplemented. 2015-06-29 16:45:43 +10:00
RCInput_PRU.cpp AP_HAL_Linux: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
RCInput_PRU.h hal_ap_linux: Make PRU constants private to reduce #define namespace pollution. 2014-10-30 13:51:41 +11:00
RCInput_ZYNQ.cpp HAL_Linux: RCInput support for Zynq 2014-11-14 14:10:35 +11:00
RCInput_ZYNQ.h HAL_Linux: RCInput support for Zynq 2014-11-14 14:10:35 +11:00
RCInput.cpp HAL_Linux: accept a smaller sync pulse width 2015-02-08 21:47:28 +11:00
RCInput.h HAL_Linux: Basic Zynq Linux platform support 2014-11-14 10:21:04 +11:00
RCOutput_AioPRU.cpp AP_HAL_Linux: Fix loading Firmware 2015-06-18 10:13:49 +10:00
RCOutput_AioPRU.h AP_HAL_Linux: Add RcInput and RcOutput with only one PRU when using a BBB. BBBMINI use the RC AIO PRU firmware already 2015-03-16 09:33:54 +11:00
RCOutput_Navio.cpp AP_HAL_Linux: added buffering in RCOutput_Navio 2015-04-14 10:16:25 +10:00
RCOutput_Navio.h AP_HAL_Linux: added buffering in RCOutput_Navio 2015-04-14 10:16:25 +10:00
RCOutput_PRU.cpp HAL_Linux: split off RCOutput class to be specific to PXF and ERLE 2014-08-19 20:03:33 +10:00
RCOutput_PRU.h hal_ap_linux: Make PRU constants private to reduce #define namespace pollution. 2014-10-30 13:51:41 +11:00
RCOutput_ZYNQ.cpp HAL_Linux: RCInput support for Zynq 2014-11-14 14:10:35 +11:00
RCOutput_ZYNQ.h AP_HAL_Linux: Fix compiler warning of MAX_PWMS redefinition (previously defined) 2015-04-06 15:34:50 -07:00
sbus.cpp HAL_Linux: fixed build warnings 2014-10-09 16:49:23 +11:00
sbus.h HAL_Linux: added SBUS decoder from PX4 project 2014-10-07 14:57:34 +11:00
Scheduler.cpp AP_HAL_Linux: Changes in Scheduler: Added defines for delays, RCIN_RERIOD changed 2015-06-29 16:45:42 +10:00
Scheduler.h AP_HAL: use noreturn attribute on panic 2015-06-08 21:09:08 +10:00
Semaphores.cpp HAL_Linux: implement millis64() and micros64() 2014-08-20 08:00:21 +10:00
Semaphores.h HAL_Linux: use board subtypes 2014-07-14 09:44:35 +10:00
SPIDriver.cpp AP_HAL_Linux: added support for dynamic speed configration in LinuxSPIUARTDriver 2015-04-14 10:45:49 +10:00
SPIDriver.h AP_HAL_Linux: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
SPIUARTDriver.cpp AP_HAL_Linux: added support for dynamic speed configration in LinuxSPIUARTDriver 2015-04-14 10:45:49 +10:00
SPIUARTDriver.h AP_HAL_Linux: added LinuxSPIUARTDriver that can handle SPI-driven Ublox 2015-01-07 08:41:12 +11:00
Storage_FRAM.cpp HAL_Linux: fixed some warnings 2014-11-08 11:49:09 +11:00
Storage_FRAM.h HAL_Linux:Create subclass to handle FRAM Storage under main Storage Class 2014-11-08 11:36:09 +11:00
Storage.cpp HAL_Linux: re-fix dirty mask bug in Storage 2014-11-08 11:55:55 +11:00
Storage.h HAL_Linux:Create subclass to handle FRAM Storage under main Storage Class 2014-11-08 11:36:09 +11:00
ToneAlarmDriver.cpp HAL_Linux:create ToneAlarmDriver as a separate class 2014-11-15 16:59:06 +11:00
ToneAlarmDriver.h HAL_Linux: added ToneAlarmDriver.h 2014-11-15 21:25:55 +11:00
UARTDriver.cpp AP_HAL_Linux: fixed TCP client connection in LinuxUARTDriver 2015-04-14 15:59:33 +10:00
UARTDriver.h AP_HAL_Linux: added LinuxSPIUARTDriver that can handle SPI-driven Ublox 2015-01-07 08:41:12 +11:00
Util.cpp HAL_Linux: fixed #if for linux builds 2015-01-22 15:58:20 +11:00
Util.h HAL_Linux: Add set_system_clock 2015-01-22 15:43:16 +11:00