1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
LibrePilot/flight/PiOS/inc
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
..
FreeRTOSConfig.h More doxygen updates 2010-07-16 05:31:11 +00:00
pios_adc.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_bmp085.h i2c: rewrite i2c layer 2010-08-08 04:15:08 +00:00
pios_com_priv.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_com.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_debug.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_delay.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_exti.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_gpio.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_hmc5843.h i2c: rewrite i2c layer 2010-08-08 04:15:08 +00:00
pios_i2c_priv.h i2c: rewrite i2c layer 2010-08-08 04:15:08 +00:00
pios_i2c.h i2c: rewrite i2c layer 2010-08-08 04:15:08 +00:00
pios_irq.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_led.h Added extra LED's .. now up to 4 LED's .. (PipBee has 4 controllable LED's) 2010-08-04 17:32:42 +00:00
pios_opahrs_proto.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_opahrs.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_ppm.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_pwm.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_sdcard.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_servo.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_spektrum.h 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
pios_spi_priv.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_spi.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_stm32.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_sys.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_usart_priv.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_usart.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
pios_usb_hid_desc.h Got better HID report design with valid data length embedded in report 2010-07-27 17:41:56 +00:00
pios_usb_hid_istr.h Further tweaks to the HID update 2010-07-27 05:28:04 +00:00
pios_usb_hid_prop.h Deleting old USB code that I meant to delete a while ago. Also changed names of some functions to OP. Finally fixed the USB taking over PIOS telemetry. Detects the USB cable and that the configuration has been taken by the USB bus. 2010-08-05 23:43:52 +00:00
pios_usb_hid_pwr.h Further tweaks to the HID update 2010-07-27 05:28:04 +00:00
pios_usb_hid.h Updated HID code to do packet processing in OS indepdent layer. Should now work on all platforms. Please test and get back to me. Maximum object size of 62 bytes currently. 2010-07-28 18:55:04 +00:00
pios_usb.h More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules 2010-07-16 19:53:35 +00:00
stm32f10x_conf.h Added debugging port buffer handling. 2010-03-13 15:37:00 +00:00
usb_conf.h Got better HID report design with valid data length embedded in report 2010-07-27 17:41:56 +00:00