1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00
LibrePilot/flight/OpenPilot
stac f74c6ffdd5 i2c: rewrite i2c layer
The STM32 I2C block has a number of errata associated with it.
These errata are primarily related to timing sensitivities between
the peripheral and the interrupt handler.  In particular, the
correct generation of the stop bit relies on the I2C IRQ running
immediately and not being held off for any reason.

NOTE: The I2C interrupts must be the highest priority IRQs in the
      system to ensure correct operation.

I2C protocol is now implemented as a formal state machine.
See: stm32_i2c_fsm.{dot,jpg} for FSM description.

I2C init is now expressed by const initializers in pios_board.c
for both OP and AHRS boards.

I2C device drivers (ie. bmp085/hmc5843) now pass in const arrays
of an unlimited number of bus transfers to be done atomically.
The I2C adapter driver now handles all bus-level locking across the
list of transactions.  Generation of start/restart/stop conditions
are handled automatically over the list of transactions.

Timeouts have been removed from the API for now.  May be added
back later.

This driver has run error free on both the OP and AHRS boards for
up to 48hrs but it still sometimes fails earlier than that on the OP
board.  There is another possible set of improvements to the driver
that could employ the DMA engine for transfers of >= 2bytes.  This
change would reduce the timing sensitivities between the peripheral
and the driver but unfortunately, both the SPI and I2C interfaces
share the DMA1 engine.  That means only one of these two peripherals
can use the DMA engine and right now, SPI between OP and AHRS is
already using it.

Failures are currently fatal and will lock up the CPU.  This allows
useful information to be obtained in the failure cases.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1241 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-08 04:15:08 +00:00
..
Modules battery: fix doxygen header info 2010-08-08 04:14:56 +00:00
System i2c: rewrite i2c layer 2010-08-08 04:15:08 +00:00
Tests OP-22 Flight/PiOS: Spektrum reworked, input is mapped to old aux in receiver connector, works nicely with calibration plugin. Also bind works, just needs config flag to bind on powerup 2010-08-01 10:34:07 +00:00
UAVObjects Added UAVObjects: FlightSituationActual NavigationSettings NavigationDesired 2010-07-26 21:26:28 +00:00
UAVTalk Doxygen work: created "OpenPilot System" group for system libraries and core files. Changed a typo on the Osd Doxygen. Let me know if you're OK with this approach. 2010-07-28 07:28:21 +00:00
Makefile build: Turn modules back on 2010-08-08 04:14:53 +00:00
Makefile.posix moved new stabilization code into experimental subdirectory 2010-07-28 15:00:51 +00:00
Makefile.win32 PiOS for win32 2010-08-03 19:29:14 +00:00