Commit Graph

11 Commits

Author SHA1 Message Date
Andrew Tridgell 2bab0efc41 HAL_Linux: implement HAL_GPIO_SCRIPT support
this allows Linux boards to trigger an external script on GPIO
writes. This can be hooked up to relays with either RC options or
mavlink or mission items to trigger actions that can be scripted
2019-07-06 09:02:54 +10:00
Peter Barker eb73a14da8 AP_HAL_Linux: add missing override keywords 2019-02-22 15:01:09 +00:00
Peter Barker 42c711a5b2 AP_HAL_Linux: remove pointless attach_interrupt override 2018-08-31 08:32:08 +10:00
Peter Barker 8d5a9ead48 AP_HAL_Linux: attach_interrupt now takes a functor
AP_HAL_Linux: add type-safety for interrupt types
2018-08-21 20:34:01 +09:00
Michael du Breuil 1f7ee55211 AP_HAL_Linux: Remove GPIO::analogPinToDigitalPin() 2018-07-11 23:09:52 -07:00
Lucas De Marchi f36e8d9c05 AP_HAL_Linux: remove AP_HAL_Linux_Namespace header
This centralized namespace header encourages centralizing things on
umbrella headers that are a pain to maintain. Force each part of
AP_HAL_Linux to include what is used.

While at it, do some whitespace cleanups and minor changes to adhere to
coding style.
2016-07-29 20:25:03 -03:00
Lucas De Marchi 71e10c9132 AP_HAL_Linux: fix include order
Sort include alphabetically and make them in order:

Main header
system headers
library headers
local headers

While reordering, change a include of endian.h to our sparse-endian.h
which is more reliant to toolchain changes.
2016-05-18 23:05:56 -03:00
Lucas De Marchi 45c6b750f2 AP_HAL_Linux: remove ifdef checks for HAL_BOARD_LINUX
Everything inside libraries/AP_HAL_Linux is for Linux boards, there's
not need to add the ifdefs.
2016-05-18 23:05:56 -03:00
Lucas De Marchi 47f25a0aa0 AP_HAL_Linux: remove _export_pins() method
The initial idea was to export all pins to be used at once, so we
created _export_pins() to take all of them and a wrapper method,
_export_pin() to export a single one. However we never export more than
one pin at once.
2016-01-04 15:12:49 -02:00
José Roberto de Souza 0c0d595b55 AP_HAL_Linux: Export GPIO pin inside of pinMode()
Make sure pinMode() method exports the pin before using it. Otherwise
the export method would need to be called, differently from other GPIO
implementations.

Since now export_pin and export_pins are called only internally, reduce
their visibility to protected.
2016-01-04 15:12:49 -02:00
Gustavo Jose de Sousa cdf70f6fe5 AP_HAL_Linux: add GPIO_Sysfs
This commit adds the class Linux::GPIO_Sysfs. This class provides a generic
implementation of AP_HAL::GPIO on Linux by using GPIO Sysfs Interface
(https://www.kernel.org/doc/Documentation/gpio/sysfs.txt).

The channel() interface should be preferred in places that need to be
fast. Since it maintains the file descriptor open this is much faster
than opening and closing it.
2015-10-22 12:04:52 +11:00