Commit Graph

3553 Commits

Author SHA1 Message Date
Beat Küng a2bfcb94ef frsky_telemetry D protocol: refactor to use less memory & allocations
Also add the vehicle_gps_position & flight mode information
2017-08-08 14:47:01 +02:00
Beat Küng 9dea515eaa frsky_telemetry S.Port: refactor to use less memory & allocations 2017-08-08 14:47:01 +02:00
Beat Küng cf8b6a9de1 frsky_telemetry: use new module documentation 2017-08-08 14:47:01 +02:00
Beat Küng 4e5c6fc805 frsky_telemetry: fix heading for D protocol 2017-08-08 14:47:01 +02:00
David Sidrane ed74530da8 mpu9250:More cleanup 2017-08-05 19:26:20 +02:00
David Sidrane 5bb084408d bmi160_main:Make the internal interface conditional on PX4_SPIDEV_BMI
px4fmuv2 had PX4_SPIDEV_BMI defined, for the v3 cmake, but never
   provided a Chip select decoded by PX4_SPIDEV_BMI. PX4_SPIDEV_BMI
   has been removed from V2, but PX4_SPIDEV_EXT_BMI still remains
   and has a chip select assigned to it.
2017-08-05 19:26:20 +02:00
David Sidrane 43843b753d px4fmu-v2, px4fmu-v3:Restruture SPI Selects and DRDY
The removes the alias so it is clear what bus and port bit
    is associated with as CS or DRDY signal.

    This becomes important when varients of V2 a) use the CS on differnt
    busses or b) swap a RDY (in) for a CS (out). In both cases,
    a CS on once buss, can back feed and cause sensor reset to not be
    able to turn off the power if all the pins are not tunered
    off
2017-08-05 19:26:20 +02:00
David Sidrane d58a802eaa px4fmu-v2:Use versioning API to only change a GPIO for pixhawkmini
Pixhawk mini has reused the GPIO_SPI_CS_EXT1 signal that was associated
   with SPI4. We can not in good faith assert a CS on a bus wer are not resetting.
   So we must do this only on HW_VER_FMUV2MIN
2017-08-05 19:26:20 +02:00
David Sidrane 553c649252 px4fmu-v2:Init GPIO_VDD_3V3_SENSORS_EN off at reset
Insure a 0.0 voltage initial condition on VDD_3V3_SENSORS
  By starting the GPIO_VDD_3V3_SENSORS_EN, low and deferring
  the GPIO init of the slave selects and drdy signals until
  board_app_initialize. We get ~ 80 ms of power off time
  with 0.00 voltage applied to the sensors.
2017-08-05 19:26:20 +02:00
David Sidrane 60ce1bc5c5 px4fmu-v2:Add GPIO_VDD_USB_VALID and initalize it 2017-08-05 19:26:20 +02:00
David Sidrane 5fd8ef1055 px4fmu-v2:Insure the discharge of the pins PWM pins on rest.
On resets invoked from system (not boot) insure we establish a low
  output state (discharge the pins) on PWM pins before they become
  inputs.
2017-08-05 19:26:20 +02:00
David Sidrane afb01d015e px4fmu-v2:Use simple HW versioning API to differentiate V2 variant at runtime.
There are several boards that share the px4fmu-v2 build as px4fmu-v3 build.

   It was initially envisioned, that the build would be binary compatable and
   the RC script would probe different sensors and determine at runtime the
   HW type. Unfortunately, a failed sensor, can result in mis-detection
   of the HW and result in an improper start up and not detect the HW
   failure.

   All these boards's bootloader report board type as px4fmu-v2.
   This precludes and automated selection of the correct fw if it
   had been built, by a different build i.e. px4fmu-cube etc.

   We need a way to deal with the slight differences in HW that effect
   the operations of drivers and board level functions that are different
   from the FMUv2 pinout and bus utilization.

   1) FMUv3 AKA Cube 2.0 and Cube 2.1 Bothe I2C busses are external.
      This effected the mag on GPS2 not reporting Internal and
      having the wrong rotation applied.

   2) FMUv3 does not performa a SPI buss reset correctly.
      FMUv2 provides a SPI1 buss reset. But FMUv3 is on
      SPI4. To complicate matters the CS cross bus
      boundries.

   3) PixhawkMini reused a signal that was associated with SPI4
      as a SPI1 ready signal.

   Based on hardware differnce in the use of PB4 and PB12 this code
   detects: FMUv2,  the Cube, and PixhawkMini and provides the
   simple common API for retriving the type, version and revision.

   On FmuV5 this same API will be used.
2017-08-05 19:26:20 +02:00
David Sidrane dfdb61d2a7 board_common:Add support for simple hardware versioning
Define methods to get:
    1) The sub type of the hardware as a string.
    2) The version as an integer
    3) The revision as an integer
2017-08-05 19:26:20 +02:00
David Sidrane c8bd60bef8 Mpu9250:Allow internal reset to complete, when started from VDD of 0V
Per the data sheet: Start-up time for register read/write from power-up is
   Typically 11 ms and the Maximum is 100 ms.

   It seems the power up reset is only triggered at VDD < 150 mV. So the
   symptom reported: Failure is only happening after a long power down is
   consistent with VDD not dropping below 150 mV, therefore not generating
   a POR and being ready to be written with out delay.

  This fix adds a delay of 110 ms to ensure the reset has ended with some.
  margin.
2017-08-05 19:26:20 +02:00
Lorenz Meier d3aaee65c0 Iridium: Use new task header 2017-08-02 21:18:35 +02:00
Lorenz Meier 144a030676 IO: Use default scheduling priorities 2017-08-02 21:18:35 +02:00
Lorenz Meier a2b23bf23a FMU: Use default scheduling priorities 2017-08-02 21:18:35 +02:00
Lorenz Meier b07dde78e3 Move scheduling priorities into px4_tasks to simplify header usage 2017-08-02 21:18:35 +02:00
Lorenz Meier 49198af6c7 FMU driver: Use default actuator output scheduling order 2017-08-02 21:18:35 +02:00
José Roberto de Souza 7d46858ae4 aerofc: Use the additional I2C
This change plus the new FPGA RTL(version 0xC1 or higher) will make
use of the new I2C bus, this new bus will be shared between aerofc_adc
and ll40ls(if connected) and leaving the old bus just to IST8310.
2017-08-02 11:49:10 +02:00
José Roberto de Souza 66e77c49ae ll40ls: Refactor interface(PWM and I2C) selection and allow probe in more I2C buses 2017-08-02 11:49:10 +02:00
José Roberto de Souza fb3d60850e aerofc_adc: Add support to use others I2C besides PX4_I2C_BUS_EXPANSION 2017-08-02 11:49:10 +02:00
José Roberto de Souza ce180af4ca aerofc: Move GPS to UART7
The UART3 also have the I2C bus 2 functions so moving GPS to UART7 to
have one additional I2C.
To keep GPS working is also necessary update the FPGA RTL to version
0xC1 or higher.
2017-08-02 11:49:10 +02:00
Mark Charlebois 2ed2403d04 Improved comment language
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2017-08-01 22:32:43 +02:00
Mark Charlebois 049c769293 Converted cxx to cpp
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2017-08-01 22:32:43 +02:00
Mark Charlebois b19dc0650e Fixed format issues and missing micro-CDR in a config file
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2017-08-01 22:32:43 +02:00
Vicente Monge c85039e413 Fixing rebase conflicts 2017-08-01 22:32:43 +02:00
Lorenz Meier 1c0dd8ba49 Simulator: Add scaling API to adjust for slow simulators
The simulation engine had the ability to pause already and properly handled load spikes, however, it was not hardened against constant drift. This addition enables it to run at a constant slower-than-realtime rate successfully.
2017-08-01 19:50:35 +02:00
Lorenz Meier ef233d29f0 VMount: use correct doube interface 2017-08-01 12:46:59 +02:00
Lorenz Meier ae737d8df0 Camera trigger: use double per interface spec 2017-08-01 12:46:59 +02:00
Beat Küng b89deaf8e3 tap-v1/tap_pwr.c: make sure to invoke the button notification on registering the cb 2017-07-29 23:10:47 +02:00
José Roberto de Souza 0b9e32ca3e aerofc: Reboot board when force bootloader pin is set
This can help "unbrick" AeroFC when a bad firmware is loaded
and it keeps rebooting or it spinning in some loop.

No need to request to stay in booloader as it will stay
in bootloader because the pin is set.
2017-07-26 07:14:13 +02:00
davidaroyer d5cbbba341 ocpoc_adc: handle return from fscanf 2017-07-22 10:51:49 +02:00
Dennis Shtatnov ca82d36c3f Support platforms like CF2 without capture ioctl 2017-07-20 03:37:58 -10:00
Dennis Shtatnov 2e85a4363e MPU9250: Separate mpu and mag resets 2017-07-19 19:51:55 -10:00
Beat Küng 07b7a153f3 fmu: add ifdef for dsm_deinit() 2017-07-18 20:06:10 +02:00
Beat Küng 2193afd0a0 fix fmu: lower polling timeout to 5ms when running as task
With the previous value of 20ms, we dropped RC input when not armed. The
result was that some RC channels jumped randomly between min & max.
2017-07-18 20:06:10 +02:00
Beat Küng e6adfa6b6b fix fmu: call dsm_deinit() in destructor
This closes the fd and cleans up a static variable used in the dsm parser.
2017-07-18 20:06:10 +02:00
Beat Küng 1130bc129c fix fmu: make sure init() is called on the new task
This was only a problem when running as a task not on the work queue.
The problem was that init() opened the RC serial device, which was then
read in the main loop, which is a different context when run as a task.
2017-07-18 20:06:10 +02:00
David Sidrane fc38bc4144 px4fmu-v5:Added Muti Brick support definitions
BOARD_HAS_LTC44XX_VALIDS - 0 -> No LTC44xx IC, N is the number of
                              Power Bricks connected to the LTC44xx
                              For a LTC4417 this would be 2 as the
                              third prioriy is used for USB

   BOARD_HAS_USB_VALID     - If defied as 1 imples that infact
                             the USB has a priority connection
                             on the LTC44XX

   BOARD_HAS_NBAT_V       - the number of battery voltage sensing chennels
                            on the ADC

   BOARD_HAS_NBAT_I      - the number of battery current  sensing chennels
                            on the ADC

   A super simple (non FMUv5 compliant) board with no LTC44xx and just one battery
   that have no current sense:

    BOARD_HAS_LTC44XX_VALIDS = 0
    BOARD_HAS_USB_VALID      = 0
    BOARD_HAS_NBAT_V         = 1
    BOARD_HAS_NBAT_0         = 0

   A fully FMUv5 compliant design would use:

    BOARD_HAS_LTC44XX_VALIDS = 2
    BOARD_HAS_USB_VALID      = 1
    BOARD_HAS_NBAT_V         = 2
    BOARD_HAS_NBAT_0         = 2

   These setting properly condition the ADC channles and all the Power
   module valid sensing logic in the ADC module.
2017-07-17 21:02:50 -10:00
David Sidrane 53a04f3ba7 px4fmu-v5:board_config clean up
Removed unused headers and placed the __BEGIN_DECLS where it belonged
2017-07-17 21:02:50 -10:00
David Sidrane f13682223a Added FMUv5 System Power related system_power.msg fields
voltage3V3_v - the sensor 3.3V voltage rail
   v3v3_valid   - the value of voltage3V3_v  may be 0. This
                  field is a 1 when the HW provides voltage3V3_v

   brick_valid - is now a bit mask. A 1 in the postion inticate the
                 Power controler HW has a valid supply voltage
                 present (in V window) on that priority
                 (channel V1..Vn).
                 The mapping is formed by 1<<battery_status.msg.priority
                 or using the manifest constanst BRICKn_VALID_MASK

   usb_vaild - is now indicated from the Power controler HW or
               the usb_connected if Power controler is
               not present.

   brick_valid == 0 and usb_vaild = 1 implies the FMU is powered
   from USB only

   brick_valid != 0  and usb_vaild = 1 implies the FMU is powered
   from the higest priority brick, providing a 1 bit in brick_valid
   and from USB
2017-07-17 21:02:50 -10:00
David Sidrane 910948cd7e board_common:Define defaults for Power Bricks and Sensor rail volatage
FMUv4Pro and FMUv5 Spec added multi brick support
   FMUv5 added SCALED_VDD_3V3_SENSORS

   This change provides legacy (FMUv2) defaults for Power Bricks and
   Sensor rail volatage source.
2017-07-17 21:02:50 -10:00
David Sidrane 8e8510f398 Added Power Brick related battery_status.msg fields
system_source - This battery status is for the brick that is
                   supplying VDD_5V_IN
   priority      - Zero based, This battery status is for the brick
                   that is connected to the Power controller's
                   N-1 priority input. V1..VN. 0 would normally be
                   Brick1, 1 for Brick2 etc

  Battery now assigns connected from the api in the
  updateBatteryStatus, as well as system_source and priority
2017-07-17 21:02:50 -10:00
David Sidrane 579b55f2cb px4fmu-v5:There will be variants that will [not]have the PX4IO.
The PX4IO is an population option on some varients. To have
   1) FMU only control
   2) IO Only control
   3) FMU fall back control

   These pins need to come up as inputs, until the configuration
   is determined.
2017-07-17 21:02:50 -10:00
David Sidrane f7e3f34f48 px4fmu-v5:Insure the VBUS signal is low if USB is not connected.
Dispite what the ref manaul says. Some HW needs the added pull
   down to insure the pin reads low when not plugged in to USB.
2017-07-17 21:02:50 -10:00
David Sidrane 15f9f6c06f px4fmu-v5:formatting 2017-07-17 21:02:50 -10:00
David Sidrane ddddedf410 px4fmu-v5:Define Tone Alarm in terms of the FMUv5 Spec 2017-07-17 21:02:50 -10:00
David Sidrane 90fd7734bb px4fmu-v5:Define UI LEDs per the FMUv5 Spec 2017-07-17 21:02:50 -10:00
David Sidrane a254b0dca5 px4fmu-v5:Define the FMU_CAP[1:3] per FMUv5 Spec 2017-07-17 21:02:50 -10:00