Commit Graph

23 Commits

Author SHA1 Message Date
Andrew Tridgell cb77cc772c HAL_PX4: implement I2C bus masks 2018-07-10 15:39:47 +10:00
Andrew Tridgell ded22a6766 HAL_PX4: fixed I2C get_device() interface
just stubs for now
2018-01-15 11:46:02 +11:00
Andrew Tridgell 3402d07651 HAL_PX4: fixed a race condition on i2c init
we could call init on two devices with the same name, which caused
init_ok to be false. This could cause the SMBus battery to fail to
initialise

Thanks to Michael duBreuil for finding this!
2017-10-26 18:21:56 +11:00
José Roberto de Souza 9ee007f924 AP_HAL_PX4: Map PX4_I2C_BUS_EXPANSION1 2017-08-04 12:47:01 -07:00
Andrew Tridgell 3415dfb46c HAL_PX4: implement split transfers for I2C 2017-04-18 18:15:04 +10:00
Lucas De Marchi 91dabbe418 AP_HAL_PX4: implement method to ajust periodic callback
Just setting up the periodic callback sampling time on initialization
may not work well for sensors that need to request for a sample with a
bus transaction, sleep and then read the new data. That's because the
function will be kept calling at a periodic rate, while the time in
which we can read the value is not really that sampling time, but rather
the time in which sensor was last read + the time spent in the function
before sending a new sample request.

Instead of creating a new type of thread to handle this case, just
implement the minimal and easy case of updating the period for this
callback, that can only be called from inside the callback function.
2017-03-24 12:06:19 +11:00
Andrew Tridgell e2192d5b4d HAL_PX4: report user bus number not system bus number 2016-12-05 16:51:49 -08:00
Andrew Tridgell f039a37971 HAL_PX4: set names on all bus threads 2016-11-28 10:18:52 +11:00
Andrew Tridgell f04b186879 HAL_PX4: fixed bug in instantiation of I2C bus threads
we ended up with a thread per device instead of a thread per bus!
2016-11-28 09:53:19 +11:00
Andrew Tridgell 252f90ba36 HAL_PX4: drop I2C speed to 100kHz
reduce I2C errors on long cables for all sensors
2016-11-21 10:29:52 +11:00
Andrew Tridgell 41018feb3a HAL_PX4: split I2C transfers
this avoids SCL low with a stop condition, which doesn't work with
some devices
2016-11-12 14:18:14 +11:00
Andrew Tridgell 01fadb6e90 HAL_PX4: added per-device perf counter for I2C devices 2016-11-09 17:08:11 +11:00
Andrew Tridgell 922d5a74f7 HAL_PX4: print msg when I2C device is closed 2016-11-09 17:08:09 +11:00
Andrew Tridgell 16489d2a13 HAL_PX4: implement device IDs for I2C and SPI 2016-11-09 17:08:04 +11:00
Andrew Tridgell 1bb450c722 HAL_PX4: moved to common DeviceBus class for thread management in I2C and SPI 2016-11-09 17:07:58 +11:00
Andrew Tridgell 88df9c7029 HAL_PX4: added thread-per-bus implementation for I2C 2016-11-09 17:07:55 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
khancyr c4b009f4b5 AP_HAL_PX4 : remove unused variable 2016-07-19 17:44:22 -03:00
Andrew Tridgell 1b8da3bce2 HAL_PX4: implement I2CDevice driver for PX4 2016-07-15 12:24:03 -03:00
Andrew Tridgell 8a7627474f Revert "AP_HAL_PX4: use new I2CDevice interface"
This reverts commit f767918e0e.

These commits broke startup on PX4
2016-05-11 12:19:00 +10:00
Andrew Tridgell 8c06e6cddc Revert "AP_HAL_PX4: embed PX4_I2C object into I2CDevice"
This reverts commit 54fd3702c3.

These commits broke startup on PX4
2016-05-11 12:18:45 +10:00
Lucas De Marchi 54fd3702c3 AP_HAL_PX4: embed PX4_I2C object into I2CDevice
Otherwise we would destroy PX4_I2C object after returning from
I2CDeviceManager::get_device(). Since this implementation is very
simple, just make PX4_I2C as an internal class and embed it into the
I2CDevice object.
2016-05-10 15:39:24 -03:00
Luiz Ywata f767918e0e AP_HAL_PX4: use new I2CDevice interface 2016-05-10 15:12:30 -03:00