3528 Commits

Author SHA1 Message Date
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
David Sidrane
14ce28b1f3 px4fmu-v5:GPIO Clean up per FMUv5 Spec.
Added comments to ADC defines with Pin numbers.
  Added the GPIO_HW_{REV:VER}_DRIVE signals
  Define the GPIO_nPOWER_IN_{A:C] and assign them to
  BRICK1, BRICK2 and USB Valid.
  Regroupped power signals and defined true logic Power Control macros
  in the arch agnostic form.
  Defined the same IOCTL defines for FMU GPIO IOCTL
  Use the power Control macros on board_app_initialize
2017-07-17 21:02:50 -10:00
David Sidrane
d33b945db6 px4fmu-v5:SPI chip selects per FMUv5 Spec 2017-07-17 21:02:50 -10:00
David Sidrane
8607b72805 px4fmu-v5:Removed unused LED alias defines. 2017-07-17 21:02:50 -10:00
David Sidrane
892ae1436c px4fmu-v4pro::Insure the discharge of the PWM pins on rest.
As done on fmuV4 on resets invoked from system (not boot) insure
  we establish a low output state (discharge the pins) on PWM pins
  before they become inputs as a result of the pending reset.

  We also delay the reset by 400 MS to insure the 3.1 Ms pulse is
  not too close to the last PWM pulse.
2017-07-17 21:02:50 -10:00
David Sidrane
b23e6fc87c px4fmu-v4pro:Define GPIO xxx_VALIDs and initalize them.
The LTC4417 provides a valid signals for brick1, brick 2 and USB
  This change  configures the GIOP and provides 1) a MACRO to read
  the pin and 2) the IOCTL defines to read it from the FMU.

  The macro's result is true logic: It is true when the signal is active.
  (Active low on the the LTC4417). The IOCTL read would be the actual
  pin state.
2017-07-17 21:02:50 -10:00
David Sidrane
258faeee03 px4fmu-v4:Define GPIO GPIO_VDD_USB_VALID and initalize it.
The V4 HW replaced the LTC4417 provided valid signal for USB.
  with an active high, version. This commit configures the GIOP
  and provides 1) a MACRO to read the pin and the IOCTL defines
  to read it from the FMU. The macro result true logic: true
  when the signal is high. The IOCTL read would be the actual
  pin state.
2017-07-17 21:02:50 -10:00
David Sidrane
f7cc78bffe px4fmu-v2:Define GPIO GPIO_VDD_USB_VALID and initalize it.
The LTC4417 provides a valid signal for USB. This change
   configures the GIOP and provides 1) True logic macro to
   read the pin and the IOCTL defines to read it from the FMU.
   The macro will return true when the signal is active (low
   on the LTC4417). The IOCTL will read be the actual pin state.
2017-07-17 21:02:50 -10:00
David Sidrane
4188c4d0d5 px4fmu-v5:Turn On SD card 2017-07-17 21:02:50 -10:00
David Sidrane
a09bc63747 px4fmu-v5:Use PX4_ERR in board init, spi init and sdio init 2017-07-17 21:02:50 -10:00
David Sidrane
229c5d482f px4fmu-v5:More GPIO_VDD_3V3V_SD_CARD_EN -> GPIO_VDD_3V3_SD_CARD_EN 2017-07-17 21:02:50 -10:00
David Sidrane
46daebfb6c px4fmu-v5:Removed a SPI 5 reeady signal from board_spi_reset
board_spi_reset is used to reset the internal SPI bus.
   therefore GPIO_SPI5_DRDY7_EXTERNAL1 should not have been
   minipulated, as it is on SPI5
2017-07-17 21:02:50 -10:00
David Sidrane
59d020fba3 px4fmu-v5:Added comment block to board_spi_reset 2017-07-17 21:02:50 -10:00
David Sidrane
85b6986079 px4fmu-v5:Fix board_peripheral_reset to use correct polarity
GPIO_nVDD_5V_PERIPH_EN is Active low. board_peripheral_reset
   need to tune it OFF then ON
2017-07-17 21:02:50 -10:00
David Sidrane
ebc8b47fad px4fmu-v5:Added board_on_reset api to reset PWM 2017-07-17 21:02:50 -10:00
David Sidrane
54bd0a9f2a px4fmu-v5:Using arch agnostic gpio init
Define the GPIO pin list use the board_gpio_init
2017-07-17 21:02:50 -10:00
David Sidrane
044b845c40 px4fmu-v5:Match GPIO_VDD_3V3_SD_CARD_EN and polarity to FMUv5 Pin Spec RC01
Removed extra V GPIO_VDD_3V3[V]_SD_CARD_EN and it is active High
2017-07-17 21:02:50 -10:00
David Sidrane
82dc6de19f px4fmu-v5:Define the BOARD_NUMBER_BRICKS for future enumeration
When BOARD_NUMBER_BRICKS exists it will enable multiple
   power source testing and reporting.
2017-07-17 21:02:50 -10:00
David Sidrane
b9f43068af px4fmu-v5:Define the existance of the UI PWM LED and it's polarity
Per https://docs.google.com/spreadsheets/d/1-n0__BYDedQrc_2NHqBenG1DNepAgnHpSGglke-QQwY/edit#gid=730959725
  Usage of the PWM UI led is optional and if used it's polaity may
  be set ot Active low or high.
2017-07-17 21:02:50 -10:00
David Sidrane
33cd8c7093 px4fmu-v5:Fixed comment 8 PWM 2017-07-17 21:02:50 -10:00
David Sidrane
e20d685f40 px4fmu-v5:Add Timer and Channel to comment for HEATER 2017-07-17 21:02:50 -10:00
David Sidrane
c1eac11823 px4fmu-v5:Match signals names to FMUv5 Pin Spec RC01 2017-07-17 21:02:50 -10:00
David Sidrane
5669434585 px4fmu-v5:Define ADC GPIO and Channels clearly
Moving forward we want all the board configs to drive the
   configuration. This is just cleanup to give a clear
   example of how ADC should be defined by a simple list,
   based on ADC pin number as related to the GPIO and
   channel number. Then the xxx_CHANNEL bit are
   used to form the ADC_CHANNELS (mask). The GPIO
   will are used to for a list for initalization.
2017-07-17 21:02:50 -10:00
David Sidrane
5ba02d740c px4fmu-v5:Group SPI signals by bus 2017-07-17 21:02:50 -10:00
David Sidrane
88c1521b5e px4fmu-v5:Status LED's are driven open drain
Allows Anaode of LEDs to be tied to V5 or V3.3
2017-07-17 21:02:50 -10:00
David Sidrane
68e5764dbc board common:Add arch agnostic gpio init 2017-07-17 21:02:50 -10:00