Commit Graph

19 Commits

Author SHA1 Message Date
mirkix 93941c3349 AP_HAL_Linux: Add support for using SPI devices of the same type. 2015-09-18 09:15:09 +10:00
Gustavo Jose de Sousa 4af2a9a9cc AP_HAL_Linux: SPI: adapt to the new signature of transaction() 2015-09-01 20:26:05 +10:00
Gustavo Jose de Sousa 124b750c10 AP_HAL_Linux: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Lucas De Marchi fde43a77b3 AP_HAL_Linux: allow to change spi device state
Allowing to change the SPI device state allows us to save the
information whether the device was already initialized and avoid 2
separate drivers to initialize it.
2015-07-06 10:48:06 +10:00
Lucas De Marchi b211b86204 AP_HAL_Linux: don't manually define number of spi devices
It's error-prone, let's make the compiler define it for us.
2015-07-06 10:07:22 +10:00
mirkix c58a022111 AP_HAL_Linux: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
John Williams 0fe3959d7e AP_HAL_Linux: Add support for in-kernel SPI CS handling
Add support for /dev/spidev<bus>.<cs> in-kernel SPI CS handling, and convert
existing SPI devices over.

 * Add a new member _subdev to the LinuxSPIDeviceDriver class, and initialiser
   in LinuxSPIDevice constructor.  Use subdev 0 for GPIO-managed CS
 * Extend the _cs_pin to signed 16 bits and define SPI_CS_KERNEL (-1) for
   kernel-managed CS
 * Move to per-device file descriptors (required for in-kernel CS)
 * Extend spidev filenames to include bus and subdevice numbers, possibly
   longer than 1 digit each
 * Allow support for platforms enumerating /dev/spidevNNN from non-zero bases
 * Convert existing users over to the new API

Signed-off-by: John Williams <john@whelanwilliams.net>
2014-11-26 09:55:09 +11:00
Staroselskii Georgii bf860ee41f AP_HAL_Linux: Ublox SPI stub 2014-11-14 10:28:34 +11:00
Andrew Tridgell a4ef512f10 SPIDriver: fixed handling of 0 based SPI bus numbers 2014-08-19 10:08:16 +10:00
Mikhail Avkhimenia a09fbb4171 HAL_Linux: Add SPI configuration for Navio
This changes the SPI bus number to be zero based on Linux
2014-08-12 22:13:00 +10:00
Andrew Tridgell 03e8e5f2b9 HAL_Linux: setup for all 6 SPI devices for PXF cape 2014-07-19 13:23:37 +10:00
Andrew Tridgell 6312b9f8c0 HAL_Linux: allow different SPI and GPIO devices on different boards
this fixes the Replay utility, which uses subtype NONE, and will make
it easier to port to new boards
2014-07-14 09:44:37 +10:00
Andrew Tridgell a46d8dbd51 HAL_Linux: make the spi driver fd part of the manager, not device
it should be one connection to the kernel per bus, not one per device
2014-07-14 09:44:36 +10:00
Andrew Tridgell 5b438471a7 HAL_Linux: added set_bus_speed() support to SPI driver
used by MPU6000 driver for setup registers
2014-07-14 09:44:33 +10:00
Andrew Tridgell d0b007248f HAL_Linux: fixed SPI semaphore, and panic on CS error
This adds a check for trying to assert two CS pins on the same bus
at the same time. The change involves moving the _device handles into the
DeviceManager class, and accessing via static methods.

This also moves the semaphore to be per-bus rather than per-device,
which fixes the problem with bad MS5611 transfers.

Pair-Programmed-With: Victor, Sid, Anuj and Philip
2014-07-14 09:32:29 +10:00
Víctor Mayoral Vilches b0742fbb5b HAL_Linux: Add FRAM SPI support. 2014-07-14 09:31:18 +10:00
Víctor Mayoral Vilches d330cbecb3 HAL_Linux: Make the CS variables more readable in SPIDriver 2014-07-14 09:30:06 +10:00
Víctor Mayoral Vilches 651cb58ebc HAL_Linux: Add CS capabilities to the SPI driver. 2014-07-14 09:29:45 +10:00
Andrew Tridgell 884af71ef6 HAL_Linux: added SPI support 2013-09-29 00:57:13 +10:00