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>
10 years ago
Andrew Tridgell
22cb1c8525
HAL_Linux: tidy up SPI debugging a bit
10 years ago
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>
10 years ago
Staroselskii Georgii
ef420a2544
AP_HAL_Linux: changed SPI mode for MPU9250
10 years ago
Staroselskii Georgii
bf860ee41f
AP_HAL_Linux: Ublox SPI stub
10 years ago
Andrew Tridgell
8506e8b5fb
HAL_Linux: fixed linux build
10 years ago
Andrew Tridgell
c87b0adc29
HAL_Linux: the MS5611 seems to be a bit happier at higher speed
...
still getting some bogus data, but less
11 years ago
Andrew Tridgell
a4ef512f10
SPIDriver: fixed handling of 0 based SPI bus numbers
11 years ago
Mikhail Avkhimenia
a09fbb4171
HAL_Linux: Add SPI configuration for Navio
...
This changes the SPI bus number to be zero based on Linux
11 years ago
Andrew Tridgell
03e8e5f2b9
HAL_Linux: setup for all 6 SPI devices for PXF cape
11 years ago
Andrew Tridgell
bcc8768358
HAL_Linux: fixed a build warning
11 years ago
Andrew Tridgell
224515f3eb
HAL_Linux: fixed indexing of device array for SPI
11 years ago
Andrew Tridgell
3292055af2
HAL_Linux: fixed dataflash SPI
11 years ago
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
11 years ago
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
11 years ago
Andrew Tridgell
9f8f27090a
HAL_Linux: MPU9250 is restricted to 1MHz for setup
...
(see datasheet)
11 years ago
Andrew Tridgell
549e08446a
HAL_Linux: use BBB pin names in SPIDriver
...
easier to find the pins on the board
11 years ago
Andrew Tridgell
8e5915ef7d
HAL_Linux: fixed some valgrind errors
11 years ago
Andrew Tridgell
130f831c1c
HAL_Linux: use MODE_3 for MPU9250
...
this fixes the MS5611 (probably due to idle state?)
11 years ago
Andrew Tridgell
fc8068adfe
HAL_Linux: use board subtypes
11 years ago
Andrew Tridgell
5b438471a7
HAL_Linux: added set_bus_speed() support to SPI driver
...
used by MPU6000 driver for setup registers
11 years ago
Andrew Tridgell
0b64d834c3
HAL_Linux: MS5611 and MPU6000 should be MODE3
...
this doesn't solve the MPU6000 problem, but is correct
11 years ago
Andrew Tridgell
1c89f54934
HAL_Linux: fixed SPI mode handling per-device
...
the mode must be set per-device, not per bus.
11 years ago
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
11 years ago
Víctor Mayoral Vilches
f11f0d9f2a
HAL_Linux: Fix FRAM code
11 years ago
Víctor Mayoral Vilches
b0742fbb5b
HAL_Linux: Add FRAM SPI support.
11 years ago
Víctor Mayoral Vilches
245618e298
HAL_Linux: Improve error handling SPIDriver
11 years ago
Víctor Mayoral Vilches
d330cbecb3
HAL_Linux: Make the CS variables more readable in SPIDriver
11 years ago
Víctor Mayoral Vilches
665bf4a247
HAL_Linux: BUS_SPEED selected individually in SPIDriver
11 years ago
Víctor Mayoral Vilches
651cb58ebc
HAL_Linux: Add CS capabilities to the SPI driver.
11 years ago
Víctor Mayoral Vilches
763c075497
HAL_Linux: spidev1.0 to SPI0 and spidev2.0 to SPI1
11 years ago
Víctor Mayoral Vilches
ea7dcc188b
AP_HAL_Linux: Correct SPIDriver devs
11 years ago
Víctor Mayoral Vilches
8af1b6faa7
AP_HAL_Linux: Add support for SPIDevice_LSM9DS0
...
The LSM9DS0 SPI device is connected to
SPI0, thereby SPIDriver class should return the
corresponding device.
11 years ago
Víctor Mayoral Vilches
3354fa9fc8
AP_HAL_Linux: Add support for SPIDevice_MS5611
11 years ago
Víctor Mayoral Vilches
27ebf790e2
AP_HAL_Linux: Add support for SPIDevice_MPU9250
...
The Invensense MPU9250 SPI device is connected to
SPI1, thereby SPIDriver class should return the
corresponding device.
11 years ago
Víctor Mayoral Vilches
815c2df2d0
AP_HAL_Linux: SPIDriver, add MPU6000 support
11 years ago
Andrew Tridgell
74ee70d463
HAL_Linux: updates for ERLE board type
11 years ago
Andrew Tridgell
d3fe625742
HAL_Linux: make the SPI driver much more efficient
...
use a single transaction for multiple bytes. This makes the APM1
Oilpan driver generate only 2 interrupts per sensor read
12 years ago
Andrew Tridgell
884af71ef6
HAL_Linux: added SPI support
12 years ago