Andrew Tridgell
f5c8754d75
HAL_ChibiOS: use ARRAY_SIZE_SIMPLE
...
this allows for boards without a device type (eg. no SPI bus)
7 years ago
Andrew Tridgell
d1f93cd66c
HAL_Chibios: auto-generate I2C, SPI and UART device lists
...
this is less error prone and make a port faster as more information is
in hwdef.dat
7 years ago
Andrew Tridgell
c3435e45c5
HAL_ChibiOS: initial port to FMUv4
7 years ago
bugobliterator
5feef04f5f
HAL_ChibiOS: add support for CCM memory
...
this uses DMA bounce buffers for bus transfers, and falls back to CCM
ram in allocations if the type is unspecified
7 years ago
Andrew Tridgell
36227aa126
HAL_ChibiOS: implement bus speed and smbus for I2C
...
use the slowest speed of all devices on the bus
7 years ago
Andrew Tridgell
755eca31c2
HAL_Chibios: don't unregister shared DMA
...
the shared DMA handle is a property of the bus, not the device, so
should not be unregistered when the device is removed
7 years ago
Andrew Tridgell
9812fc9574
HAL_Chibios: prevent creation of i2c devices on invalid bus
7 years ago
Andrew Tridgell
8b6bab7b17
HAL_Chibios: added ChibiOS HAL
...
this is based on initial work by Sid, reset here for easier merging
7 years ago
Andrew Tridgell
3402d07651
HAL_PX4: fixed a race condition on i2c init
...
we could call init on two devices with the same name, which caused
init_ok to be false. This could cause the SMBus battery to fail to
initialise
Thanks to Michael duBreuil for finding this!
7 years ago
José Roberto de Souza
9ee007f924
AP_HAL_PX4: Map PX4_I2C_BUS_EXPANSION1
8 years ago
Andrew Tridgell
3415dfb46c
HAL_PX4: implement split transfers for I2C
8 years ago
Lucas De Marchi
91dabbe418
AP_HAL_PX4: implement method to ajust periodic callback
...
Just setting up the periodic callback sampling time on initialization
may not work well for sensors that need to request for a sample with a
bus transaction, sleep and then read the new data. That's because the
function will be kept calling at a periodic rate, while the time in
which we can read the value is not really that sampling time, but rather
the time in which sensor was last read + the time spent in the function
before sending a new sample request.
Instead of creating a new type of thread to handle this case, just
implement the minimal and easy case of updating the period for this
callback, that can only be called from inside the callback function.
8 years ago
Andrew Tridgell
e2192d5b4d
HAL_PX4: report user bus number not system bus number
8 years ago
Andrew Tridgell
f039a37971
HAL_PX4: set names on all bus threads
8 years ago
Andrew Tridgell
f04b186879
HAL_PX4: fixed bug in instantiation of I2C bus threads
...
we ended up with a thread per device instead of a thread per bus!
8 years ago
Andrew Tridgell
252f90ba36
HAL_PX4: drop I2C speed to 100kHz
...
reduce I2C errors on long cables for all sensors
8 years ago
Andrew Tridgell
41018feb3a
HAL_PX4: split I2C transfers
...
this avoids SCL low with a stop condition, which doesn't work with
some devices
8 years ago
Andrew Tridgell
01fadb6e90
HAL_PX4: added per-device perf counter for I2C devices
8 years ago
Andrew Tridgell
922d5a74f7
HAL_PX4: print msg when I2C device is closed
8 years ago
Andrew Tridgell
16489d2a13
HAL_PX4: implement device IDs for I2C and SPI
8 years ago
Andrew Tridgell
1bb450c722
HAL_PX4: moved to common DeviceBus class for thread management in I2C and SPI
8 years ago
Andrew Tridgell
88df9c7029
HAL_PX4: added thread-per-bus implementation for I2C
8 years ago
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.
8 years ago
khancyr
c4b009f4b5
AP_HAL_PX4 : remove unused variable
9 years ago
Andrew Tridgell
1b8da3bce2
HAL_PX4: implement I2CDevice driver for PX4
9 years ago
Andrew Tridgell
8a7627474f
Revert "AP_HAL_PX4: use new I2CDevice interface"
...
This reverts commit f767918e0e
.
These commits broke startup on PX4
9 years ago
Andrew Tridgell
8c06e6cddc
Revert "AP_HAL_PX4: embed PX4_I2C object into I2CDevice"
...
This reverts commit 54fd3702c3
.
These commits broke startup on PX4
9 years ago
Lucas De Marchi
54fd3702c3
AP_HAL_PX4: embed PX4_I2C object into I2CDevice
...
Otherwise we would destroy PX4_I2C object after returning from
I2CDeviceManager::get_device(). Since this implementation is very
simple, just make PX4_I2C as an internal class and embed it into the
I2CDevice object.
9 years ago
Luiz Ywata
f767918e0e
AP_HAL_PX4: use new I2CDevice interface
9 years ago