Commit Graph

70 Commits

Author SHA1 Message Date
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
Staroselskii Georgii f7846403e1 AP_HAL_Linux: enabled SPI-driven LSM9DS1 for Navio 2 2016-05-10 17:24:43 -03:00
Julien Beraud c22d791bfc AP_HAL_Linux: Add SPI driver for bebop 2016-05-03 16:43:39 -03:00
mirkix 2aba5a4643 AP_HAL_Linux: BBBmini add second MPU9250 2016-04-24 10:57:57 -03:00
Lucas De Marchi 72b246e52c AP_HAL_Linux: fix use of 0-length array
0-length arrays are supported in C but forbidden in C++. GCC allows it
but clang is more strict:

../../libraries/AP_HAL_Linux/SPIDriver.cpp:75:35: fatal error: no matching constructor for initialization of 'Linux::SPIDeviceDriver [0]'
SPIDeviceDriver SPIDeviceManager::_device[0];
                                  ^
../../libraries/AP_HAL_Linux/SPIDriver.h:20:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided
class SPIDeviceDriver : public AP_HAL::SPIDeviceDriver {
      ^
../../libraries/AP_HAL_Linux/SPIDriver.h:20:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
../../libraries/AP_HAL_Linux/SPIDriver.h:25:5: note: candidate constructor not viable: requires 9 arguments, but 0 were provided
    SPIDeviceDriver(const char *name, uint16_t bus, uint16_t subdev, enum AP_HAL::SPIDeviceType type, uint8_t mode, uint8_t bitsPerWord, int16_t cs_pin, uint32_t lowspeed, uint32_t highspeed);
    ^
1 error generated.
2016-03-20 00:17:02 -03:00
raspilot 9d787e44cc AP_HAL_Linux: update spi table for raspilot 2016-03-18 21:51:37 -03:00
Staroselskii Georgii f93e790717 AP_HAL_Linux: make Ublox work on the higher frequency
The lower speed was only valid for very old Navio's. All new boards ship
with the GPSs that support higher frequencies.
2016-02-27 03:06:50 -03:00
Staroselskii Georgii 6680baf777 AP_HAL_Linux: use MPU9250 for Navio2 2016-02-27 03:06:50 -03:00
Lucas De Marchi 3060c3da3c AP_HAL_Linux: Add fake device to SPIDriver
This allows us to re-use SPIDevice from SPIDeviceDriver (the
to-become-SPIDeviceProperties) while the drivers are
converted.  We create a fake device by calling the temporary
SPIDeviceManager::get_device() method passing the descriptor. The
transfer and assert logic is still using the old code.

Now we can interoperate SPIDeviceDriver with the ones based in
SPIDevice since they are going to use the same semaphore and bus.
2016-02-16 19:49:09 -02:00
Lucas De Marchi 0d1bb7aa84 AP_HAL_Linux: export number of SPI devices
Save in the manager the number of devices so it can be used in other
places like the SPIDevice implementation. This is a temporary storage
while we migrate to SPIDevice.

While at it use protected rather than private.
2016-02-16 19:49:09 -02:00
Lucas De Marchi 2296139516 AP_HAL_Linux: remove unused constant 2016-02-01 14:18:51 -02:00
Lucas De Marchi 5bb2716081 AP_HAL_Linux: add name to SPI device table
A string name allows to more easily expand the table: the board is
responsible for the name and doesn't have to declare it as a enum or
define. It's also easier to add 2 sensors of the same type.
2016-02-01 14:18:50 -02:00
Lucas De Marchi 9d5fb97819 Global: rename enum SPIDevice to SPIDeviceType
Free the SPIDevice name so to have a consistent name for I2C/SPI device
classes.
2016-02-01 14:18:50 -02:00
Víctor Mayoral Vilches 1c49b086eb HAL_Linux: SPIDriver add PXFmini support 2016-01-05 15:35:55 -02:00
Aaron Wang Shi a712e9572f AP_HAL_Linux: instatiate SPI device for BH hat 2015-12-21 15:54:31 +11:00
Lucas De Marchi 2439826c19 AP_HAL_Linux: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Caio Marcelo de Oliveira Filho 7675913d5b AP_HAL_Linux: use millis/micros/panic functions 2015-11-20 12:31:04 +09:00
Víctor Mayoral Vilches 8ae8f47538 AP_HAL_Linux: SPIDriver, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Lucas De Marchi 959e061514 AP_HAL_Linux: add spi device for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi 2ac96b942c AP_HAL_Linux: remove prefix from AP_HAL_Linux classes
We have already a Linux namespace, so there's no need to prefix Linux on
all names.
2015-10-21 10:11:19 +11:00
mirkix 93941c3349 AP_HAL_Linux: Add support for using SPI devices of the same type. 2015-09-18 09:15:09 +10:00
raspilot 25cddbcbaa AP_HAL_Linux: added SPI support for raspilot 2015-09-14 14:22:16 +10:00
Víctor Mayoral Vilches 728921f7c5 AP_HAL_Linux: ERLEBOARD legacy support
This config referred to the legacy Erle-Board
https://erlerobotics.com/blog/product/erle-board/
The configuration is preserved to support the
existing boards.
2015-09-09 10:31:55 +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
Staroselskii Georgii 72820303d4 AP_HAL_Linux: set higher SPI speed for Navio
We can set a higher speed on newer Linux kernels since
52469b2a38.
The older ones will just floor the value.
2015-07-10 18:59:18 +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
Staroselskii Georgii 716fd56c62 AP_HAL_Linux: added support for dynamic speed configration in LinuxSPIUARTDriver 2015-04-14 10:45:49 +10:00
mirkix a6b018eab9 AP_HAL_Linux: BBBMINI use kernel CS now 2015-03-16 09:15:06 +11:00
Staroselskii Georgii 4034004194 AP_HAL_Linux: switch NavIO to kernel CS handling 2015-02-12 12:52:56 +11: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 d0e467aea0 AP_HAL_Linux: Bypass manual CS assertion for SPI_CS_KERNEL mode
Missed from initial patch series

Signed-off-by: John Williams <john@whelanwilliams.net>
2014-11-27 15:57:12 +11:00
Andrew Tridgell 22cb1c8525 HAL_Linux: tidy up SPI debugging a bit 2014-11-26 10:16:39 +11: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 ef420a2544 AP_HAL_Linux: changed SPI mode for MPU9250 2014-11-14 10:28:34 +11:00
Staroselskii Georgii bf860ee41f AP_HAL_Linux: Ublox SPI stub 2014-11-14 10:28:34 +11:00
Andrew Tridgell 8506e8b5fb HAL_Linux: fixed linux build 2014-10-30 17:47:18 +11:00
Andrew Tridgell c87b0adc29 HAL_Linux: the MS5611 seems to be a bit happier at higher speed
still getting some bogus data, but less
2014-08-19 10:08:17 +10: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 bcc8768358 HAL_Linux: fixed a build warning 2014-07-15 13:56:50 +10:00
Andrew Tridgell 224515f3eb HAL_Linux: fixed indexing of device array for SPI 2014-07-14 11:31:55 +10:00
Andrew Tridgell 3292055af2 HAL_Linux: fixed dataflash SPI 2014-07-14 11:07:41 +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 9f8f27090a HAL_Linux: MPU9250 is restricted to 1MHz for setup
(see datasheet)
2014-07-14 09:44:36 +10:00
Andrew Tridgell 549e08446a HAL_Linux: use BBB pin names in SPIDriver
easier to find the pins on the board
2014-07-14 09:44:36 +10:00
Andrew Tridgell 8e5915ef7d HAL_Linux: fixed some valgrind errors 2014-07-14 09:44:35 +10:00
Andrew Tridgell 130f831c1c HAL_Linux: use MODE_3 for MPU9250
this fixes the MS5611 (probably due to idle state?)
2014-07-14 09:44:35 +10:00