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
This PR is preliminary ground work for FMUv5.
PX4 does not use the NuttX adc driver. But used the same format
for the data returned by the nuttx ADC driver.
There was a fixme:in src/platforms/px4_adc.h "this needs to be
a px4_adc_msg_s type" With this PR the need for
src/platforms/px4_adc.h goes away as the driver drv_adc.h now
describes the px4_adc_msg_t.
Filter for channel 4 was modifying channel 1
capture and overflow reads were using wrong paramaters
in macros and addressing junk in memory.
up_input_capture_get_filter was shifing results the wrong way.
This fixes the issue with initializing channels 5,6 without
channels 1-4.
The code assumed all timers actions were in order to be
initialized. This is not the case. This commit fixes that
bad assumption by not stopping the configuration on the
first action entry with a base == 0, but processing all
entries with non-zero base.
Since the Onshot<->PWM mode is changed based on rate. The
this signale the higher layers that the operation is invalid
test case:
fmu task mode_pwm2cap2
pwm oneshot -m 0xf -g 0 -d /dev/pwm_output0
should fail, because all the channels in the group are
not in the same mode.
1) Updated copyright
2) Defined BOARD overrideable BOARD_PWM_FREQ and BOARD_ONSHOT_FREQ
Not recogmended but allow experimentation
3) Solved the support for BOARD_PWM_DRIVE_ACTIVE_LOW using
the Polarity control bits as apposed to the negation of
the ARR.
4) Added a cache for getting a timers channels. This is static
and benifits from the qucik response.
5) Added a function to realocate all channes in a given timer
from one mode to another.
6) Removed the frequecy table in favor of the intended use of the
channel mode set. At it is the way to determine the mode of a
channel. Or in onshot's case a timers's complete set channels.
7) Added 2 lowlevel mode changing functions:
io_timer_set_oneshot_mode and io_timer_set_PWM_mode
that encapsalate the changes in mode to one place
in the code.
8) Added io_timer_trigger (the up_pwm_update) with low
latancy timer to time in updating.
9) io_timer_set_rate - use sets to enforce all or none
rules for switching PWM<->OneShot.
Onshot is entered using the very approriate rate of 0.
Only deltas will change the HW state.
1) Define IOTimerChanMode_OneShot
2) Added detailed commnent on .clock_freq and how it is used
3) Added single additional API point in support of Onshot mode
io_timer_trigger - That trigger all timer's channels in Oneshot
mode to fire the oneshots with updated values.
1) Validate timer paramater before using it.
2) Allow rate of 0 to enter Oneshot mode
At first blush this seamed like a hack, but at Mark
pointed out to me, Onshot PWM does not have a rate
So this is a realy a clever and beautiful simplification
on his part!
3) Exposes up_pwm_update that runs io_timer_trigger
Which trigger all timer's channels in Oneshot mode to
fire the oneshots with updated values.
change fmu to task
increase fmu_servo task priority to max and enable true oneshot
use lowest FMU priority which minimizes jitter
constrain oneshot updates to control group 0 events
Use ADC_SCALED_V5_SENSE as apposed to legasy ADC_5V_RAIL_SENSE to populate
voltage5V_v
Then Scale the DN based on an overridable ADC_V5_V_FULL_SCALE value
This prevents the meta value of 0 => not used from being passed to
px4_arch_configgpio. As this would map to PORTA|PIN0 and is not
the intended configuration.
This is the fixes https://github.com/PX4/Firmware/issues/5710
by adding 2 concepts.
1) Allowing a board to define BOARD_HAS_SHARED_PWM_TIMERS
in this case the io_timeris will be initalized as the
led_pwm_timers - there is an assumptionm that the
number of io_timers == the number of led_pwm timers
2) Allowing a board to define BOARD_LED_PWM_RATE
To set an alternate frequency
Future expansion will require:
1) The ability to have a config with both the I2C RGB LED and
PWM RGB LED drivers loaded.
2) The higher level driver to create multiple instances of the
/dev/rgbld, to support internal and external User facing
RGB LED as supported in FMUv5
This is a Interim fix to avoid using params before initialized.
The Long term fix will be:
1) Not play the startup tone on start but allow tones to be generated from other invocations (i.e error conditions)
2) Add a command to tone alam to have it read a parameter, after parameter initialization, in the init script. If that parameter is on then sound the startup tone and further tones will be enabled. If it is off all further tones will be disabled.
The new parameter will not be of the class circuit breaker (not named ) as is is not an absolute control of the tone alarm.
Update the comment, to explain how to achive a different perescale
value.
Added PX4_IO_TIMER_ALTERNATE_RATE one board agnostic ifdef
PX4_IO_TIMER_ALTERNATE_RATE that is non board specific.
N.B. I would like to eliminate PX4_IO_TIMER_ALTERNATE_RATE
as well, but I need crazyflie HW to validate that the startup
script can just set the rate on the PWM to 3921 fast enough to
not effect the motors.
It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
Working crazyflie firmware build
* Console on USART3
* Could not disable building PX4IO firmware, currently commented out
Don't build PX4IO firmware if the board doesn't ask for it
Added crazyflie motor driver
Fixed wrong register
CLK_SEL is in PWR_MGMT_1
Initial I2C/SPI MPU9250 device
* Tested with I2C
* Need to add error checking
* Intermittent crash on stop call
Working ak8963 mag driver
Functional lps25h driver. Work in progress.
Works well enough to probe and allow sensors task to start.
Added serial port test module
HACK! Get sensors module working
Set crazyflie PWM range
Extend baudrate for Crazyflie's NRF radio
Added dummy tone alarm to allow for init
Added autostart script for Crazyflie