Commit Graph

29 Commits

Author SHA1 Message Date
Andrew Tridgell 464dc9102f AP_HAL: added device types for SITL
and fixed a stack init bug for make_bus_id
2018-07-13 10:19:01 +10:00
Andrew Tridgell 2b0a3272fd AP_HAL: support LPS25H on MPU AUX 2018-03-02 12:52:50 +11:00
night-ghost f8569ac39e AP_HAL: added F4Light HAL 2018-02-10 09:14:41 +11:00
Lucas De Marchi a73c1daa2e AP_HAL: Device: remove unused function to read registers
Callers can use be16toh(), be32toh(), etc. There's no need to have a
special function here for each type.
2017-01-26 23:18:27 -08:00
Lucas De Marchi 14519e90ff AP_HAL: Device: remove trailing whitespaces 2017-01-26 23:18:27 -08:00
Lucas De Marchi 5472bc4de1 Global: change Device::PeriodicCb signature
Remove bool return as it's never being used and not supported on PX4.
2017-01-14 10:03:54 +11:00
Randy Mackay a2f6d7c102 AP_HAL: minor comment fix to Device.h 2016-12-24 13:55:31 +09:00
Andrew Tridgell c657ad449b AP_HAL: added get_bus_address()
used to report sensor probing results in drivers
2016-12-05 16:51:49 -08:00
Andrew Tridgell 60c29417f1 AP_HAL: added uint16 access functions 2016-12-05 16:51:49 -08:00
Andrew Tridgell 28a318145c AP_HAL: move set_retries() up to Device class
we really need set_retries() high during init for nearly all i2c
devices, and as many are written against the generic device class
moving it to the Device class makes this a lot easier. It is a NOP on
SPI.
2016-12-02 09:47:51 +11:00
Andrew Tridgell 00ccacb2ab AP_HAL: expose device bus number 2016-11-28 10:18:32 +11:00
Andrew Tridgell 954728c9e9 AP_HAL: added set_chip_select() API
for devices with unusual timings
2016-11-25 21:26:27 +11:00
Andrew Tridgell 7100272f14 AP_HAL: default to register checking every 10th call
this saves having this in nearly all callers
2016-11-25 20:31:36 +11:00
Andrew Tridgell bc614de4b3 AP_HAL: added checked registers interface
allow drivers to easily monitor and correct critical registers
2016-11-11 08:08:55 +11:00
Andrew Tridgell 1990aa96e1 AP_HAL: added get_bus_id_devtype()
used to do versioning on device types
2016-11-09 17:08:06 +11:00
Andrew Tridgell 3d48b6bb3a AP_HAL: added device id tuples to Device class
this allows a bus connection and device type tuple to be identifed as
a 24 bit number for use in user visible device IDs. Every bus
connection has a unique device ID.
2016-11-09 17:08:04 +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
Lucas De Marchi e1ab44f4a3 Global: remove get_fd() from Device API
This was there for compatibility with I2CDriver and SPIDriver. We don't
use them anymore so we can remove the compat method.
2016-08-29 10:27:36 -03:00
Lucas De Marchi 590539f674 AP_HAL_Linux: implement threaded I2C 2016-07-30 00:55:27 -03:00
Lucas De Marchi 37de995960 AP_HAL: update Device interface for periodic tasks
Replace the previous not-implemented interface with a set of new methods
that can be resonably implemented:

    - register_periodic_callback() now receives a functor returning bool
      to easily allow "oneshot" timers

    - adjust_periodic_callback() allows the caller to change the timer
      for a specific handle. This way drivers like MS5611 can adjust the
      timer depending on its state machine: the time to sample
      temperature is smaller than the time to get a pressure sample

    - add unregister_callback(): since we have an opaque pointer, we
      can't tell the user to just delete it in order to unregister the
      callback
2016-07-30 00:55:27 -03:00
Luiz Ywata d5449a6f20 AP_HAL: Add read method
Provide a more intuitive api for reading an I2CDevice.
2016-07-14 17:32:33 -03:00
Lucas De Marchi 1f96336f7c Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
Gustavo Jose de Sousa 66f1ad9ed0 AP_HAL: Device: add support for read flag
Many of our SPI and I2C sensors define the protocol of setting the most
significant bit of the register address in order to perform a read operation.
Thus, enable the use of a "read flag" that is ORed with the register's address.
Since this is an abstraction for general devices, it's a good idea to have zero
as the default value for that flag.

While at it, add documentation to read_registers().
2016-06-27 17:18:35 -03:00
Gustavo Jose de Sousa b6a1d598e3 AP_HAL: Device: document write_register() 2016-06-27 17:18:35 -03:00
Gustavo Jose de Sousa 4693501d9d AP_HAL: Device: add bus_type field
Sometimes it's necessary to know the type of bus to make some decisions where
AP_HAL::Device abstraction is used.
2016-06-27 17:18:35 -03:00
Ricardo de Almeida Gonzaga eb418f54ee AP_HAL: Fix typos 2016-05-13 19:20:06 -03:00
Lucas De Marchi f8e6c5b379 AP_HAL: add helper method to read registers
This just forwards to the transfer() method, avoiding the need in driver
code to have a similar method.
2016-02-16 19:49:08 -02:00
Lucas De Marchi b4ff2d7595 AP_HAL: add helper method to write register
This just forwards to the transfer() method, avoiding the need in driver
code to have a similar method.
2016-02-16 19:49:08 -02:00
Lucas De Marchi 0eb450d379 AP_HAL: Add interface for I2C/SPI devices
These interfaces are intended to abstract I2C and SPI devices for
drivers.
2016-02-16 19:49:08 -02:00