Andrew Tridgell
adf7fefc2e
HAL_ChibiOS: detect stuck I2C bus and clear with SCL
...
This detects the I2C bus becoming stuck with SDA low after a timeout
and clears the bus by toggling SCL. Many thanks to @jhw84 for the
suggestion
6 years ago
Andrew Tridgell
d3af854949
HAL_ChibiOS: fixed bootloader build
7 years ago
Lucas De Marchi
668c941717
Global: use new version of ARRAY_SIZE
7 years ago
Siddharth Purohit
395c48933c
HAL_ChibiOS: move tto using updated time conversion API
7 years ago
Andrew Tridgell
13f96bcb00
HAL_ChibiOS: fixed an i2c dma callback bug
...
many thanks to Kelly-Foster for chasing me on this one!
7 years ago
Andrew Tridgell
73cfd40e7f
HAL_ChibiOS: reduce latency of DMA sharing
...
if we are sharing a DMA channel between i2c and SPI then this saves
latency on SPI by giving up the DMA channel between retries
7 years ago
Andrew Tridgell
59aab9987e
HAL_ChibiOS: account for I2C base in compass masks
7 years ago
Andrew Tridgell
476bddd9a3
HAL_ChibiOS: use HAL_I2C_INTERNAL_MASK
7 years ago
Andrew Tridgell
4f9bd50038
HAL_ChibiOS: implement I2C bus masks
7 years ago
Andrew Tridgell
e068106669
HAL_ChibiOS: support I2C devices on STM32F7 without DMA
...
this allows us to support I2C4 on fmuv5
7 years ago
Andrew Tridgell
a945c97ec6
HAL_ChibiOS: fixed 3-way DMA sharing bug
...
when we have 3 way contention across two DMA streams we could get the
dma_deallocate function called in an object from two places at
once. This adds a mutex that prevents that scenario
7 years ago
Andrew Tridgell
2493cdbcb6
HAL_ChibiOS: switch to new bouncebuffer system
...
this removes the dma_flush and dma_invalidate methods and uses a
common bouncebuffer system for all CPU types. This enables microSD
support on STM32F7
7 years ago
Andrew Tridgell
fef1b0ffc6
HAL_ChibiOS: fixed I2C flush/invalidate calls
7 years ago
Andrew Tridgell
4d4ea894e8
HAL_ChibiOS: disable i2c device debug code
7 years ago
Andrew Tridgell
edb831653f
HAL_ChibiOS: added dma_flush and dma_invalidate operations
...
these are needed to manage the data cache on the STM32F7
7 years ago
mirkix
c2eee2db23
AP_HAL_ChibiOS: add STM32F7 I2C support
7 years ago
Andrew Tridgell
bc32276966
HAL_ChibiOS: support DShot output
...
use DMAR burst DMA to minimise number of DMA channels needed
thanks to betaflight for the great reference implementation!
7 years ago
Andrew Tridgell
306d35655e
HAL_ChibiOS: allow for bare board builds
...
this allows for a build with no UARTs, no SPI, no I2C, no PWM. Great
for initial board bringup with just USB
7 years ago
Andrew Tridgell
5f353b5c85
HAL_ChibiOS: fixed build of I2C without I2C1 defined
7 years ago
Andrew Tridgell
9301e4888a
HAL_ChibiOS: make not having bus lock a soft error
...
this is nicer for driver developers
7 years ago
Andrew Tridgell
8eff43a352
HAL_ChibiOS: fixed printf arguments
7 years ago
Siddharth Purohit
40142e5aef
ChibiOS: implement way to clear i2c bus by toggling clock line
7 years ago
Andrew Tridgell
47ce37f463
HAL_ChibiOS: report I2C clock downgrades
7 years ago
Andrew Tridgell
f1ce321a2f
HAL_ChibiOS: added checking of bus owner
...
this ensures all bus transfers are only done by the thread that owns
the semaphore
7 years ago
Andrew Tridgell
23e1b2e271
HAL_ChibiOS: added paranoid state checking on I2C
...
this is here just while debugging an issue with Mark
7 years ago
Andrew Tridgell
87389e0fdc
HAL_ChibiOS: fixed double DMA allocation on i2c
7 years ago
Andrew Tridgell
63671b06a8
HAL_ChibiOS: added HAL_I2C_MAX_CLOCK define
7 years ago
Andrew Tridgell
88f11f5a50
HAL_ChibiOS: added HAL_I2C_BUS_BASE
...
this allows fmuv4 to start at bus 1
7 years ago
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