Compare commits

...

82 Commits

Author SHA1 Message Date
Daniel Agar 3fff512ec0 new standalone drivers/system_power (split out of adc)
- system_power portion of drivers/adc split into a new standalone module (drivers/system_power)
 - additional availability flags added to system_power.msg so we know what boards even support (previously certain flags were faked if not available)
 - drivers/system_power scheduled at minimum rate by default, but now also scheduled immediately on any relevant GPIO events
 - now instead of running at 100 Hz with heavily reduced logging we can run at a minimal rate, log at full rate, and catch relevant changes immediately
2021-01-16 14:20:54 -05:00
Silvan Fuhrer cee4016665 Preflight checks: Airspeed checks update
-check for valid airspeed_validated (declared valid plus updated less than 1s ago)
-added param (COM_ARM_ARSP_EN) to enable/disable check for max airspeed for arming set max
airspeed limit to half of stall airspeed

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-16 10:26:55 -05:00
Can Berk Durmus ba9611621d Retune Typhoon H480 PID 2021-01-16 09:32:09 +01:00
David Sidrane 1c0ed74d6a platforms/nuttx/NuttX/nuttx net backports 2021-01-15 11:44:21 -08:00
Beat Küng ade3871bee adc: add support for multiple sensor voltage channels 2021-01-15 10:57:20 -05:00
Beat Küng e2337a34eb system_power: add comp_5v_valid and can1_gps1_5v_valid
And fill it in from the v5x GPIO expander.
2021-01-15 10:57:20 -05:00
Beat Küng 704a82aaa6 gpio: extend support for /dev/gp* GPIO's
Note that there's a small CLI interface change.
2021-01-15 10:57:20 -05:00
Beat Küng 88fe047556 px4/v5x: enable mcp23009 GPIO driver 2021-01-15 10:57:20 -05:00
Beat Küng 3e4b8763a5 nuttx: add mcp23009 gpio driver 2021-01-15 10:57:20 -05:00
Beat Küng e1983381e7 rcS: add SYS_PARAM_VER to param reset_all exception list
Avoids an extra reboot when resetting the airframe
2021-01-15 10:57:20 -05:00
Matej Frančeškin ba6a8080ea mavlink: don't respond to MAV_CMD_REQUEST_MESSAGE if component doesn't match
PX4 is responding with NACK to MAV_CMD_REQUEST_MESSAGE from a GCS to
payload-manager which confuses a GCS.
PX4 shouldn't respond to commands that are not broadcasted or specificaly
addressed to it.
2021-01-15 10:57:20 -05:00
Beat Küng 26e8c231b0 v5x,v6x: move mtd_caldata after mtd_id partition
to avoid losing factory calibration params on existing setups
2021-01-15 10:57:20 -05:00
Lorenz Meier a282f3df8d CLI test: Disable by default on NuttX
First target is to enable this for POSIX tests and then later to roll them out to NuttX.
2021-01-15 10:57:20 -05:00
Lorenz Meier 03e9e10847 Add CLI tests for basic soak testing
This is in no way a complete test suite but is intended as a starting point to get minimal
test coverage for CLI handling tests in. This is necessary to QA the CLI handling
(e.g. removal of commands) and to ensure that we are exercising these code paths in
stack check and alike tests.
2021-01-15 10:57:20 -05:00
Julian Oes 5ae5c03c66 mavlink: handle param4/5 from mission_item_int
It turns out that we did not properly handle param4 and param5 if they
are transferred using mission_item_int if the frame is
MAV_FRAME_MISSION.
2021-01-15 10:57:20 -05:00
Beat Küng 12ebbd995d bmp388: wait a bit longer to schedule first cycle after reset 2021-01-15 10:57:20 -05:00
Beat Küng 529c3112ac bmp388: quiet if startup fails (no sensor on bus) 2021-01-15 10:57:20 -05:00
David Sidrane 1e7dfe227a stm32_common:board_hw_rev_ver Use Analog resistor detection
When the VER_DRIVE and REV_DRIVE are the same GPIO
   we need to use Analog detection.
2021-01-15 10:57:20 -05:00
Jakub Kákona b87dd317d4 airframes: add new airframe for ThunderFly TF-G2 autogyro (#16551)
Co-authored-by: Roman Dvorak <romandvorak@mlab.cz>
2021-01-15 13:54:17 +01:00
Thomas df41c99b61 make failsafe handling consistent over all VTOL types 2021-01-15 09:19:07 +03:00
Thomas 38e46ff341 Rename VtolAttitudeControl::abort_front_transition(const char *reason) to VtolAttitudeControl::quadchute(const char *reason) 2021-01-15 09:19:07 +03:00
Thomas Stauber 40fbfdc054 Undo make format change
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2021-01-15 09:19:07 +03:00
Thomas 83ddb77a5f delete excess empty lines 2021-01-15 09:19:07 +03:00
Thomas b90fafd5cd Fix quadchute logic so that it also works during back transition 2021-01-15 09:19:07 +03:00
Daniel Agar 420ceb76fc cmake: NuttX generated vscode launch.json requires DEBUG_DEVICE found 2021-01-14 10:32:26 -05:00
SalimTerryLi 1ee98417f8 scumaker pilotpi updates
* replace default mag with qmc5883l
* fix rotation and quiet startup
* fixedwing script & Multi-EKF cfg
* set default params only when initial startup
2021-01-14 09:16:13 -05:00
Daniel Agar 52b07a932a github actions build and store cannode uavcan firmware 2021-01-14 08:52:38 -05:00
RomanBapst 96dfa7fc71 ROMFS: set cruise throttle correctly for all gazebo vtol configs
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-14 09:58:37 +03:00
Silvan Fuhrer 0633c3956f ROMFS: improve tuning of tailsitter VTOL SITL
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-14 09:58:37 +03:00
Silvan Fuhrer 6104fe8932 ROMFS: improve tuning of tiltrotor VTOL SITL
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-14 09:58:37 +03:00
Silvan Fuhrer 2ce310925c ROMFS: improve tuning of standard VTOL SITL
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-14 09:58:37 +03:00
Daniel Agar e96571b45d uavcannode: GPS working on cuav_can-gps-v1
- use sensor_gps directly from sensor rather than vehicle_gps_position (aggregated value)
2021-01-13 22:06:46 -05:00
Daniel Agar d8e8e23947 vscode: add cuav_can-gps-v1_canbootloader variant 2021-01-13 22:06:46 -05:00
Daniel Agar 58909b208d boards: cuav can-gps-v1 add safety button and LED 2021-01-13 22:06:46 -05:00
Daniel Agar a894ca30e8 cmake: add STM32F412CE debug helper 2021-01-13 22:06:46 -05:00
David Sidrane 529841ba7c make_can_boot_descriptor:Get padding math correct 2021-01-13 22:06:46 -05:00
David Sidrane 1ac70cc72f can-gps-v1:Correct Memory size used by app and bootloader size 2021-01-13 22:06:46 -05:00
David Sidrane d04216aa48 Nuttx with stmf412 fixes 2021-01-13 22:06:46 -05:00
David Sidrane 618bd5978a can-gps-v1:canbootloader SAFETY is GETNODEINFO_JUMPER 2021-01-13 22:06:46 -05:00
David Sidrane 2deef30d12 canbootloader:Add 48Mhz CAN Clock Settings 2021-01-13 22:06:46 -05:00
David Sidrane 177109a1af can-gps-v1:LED Trimming 2021-01-13 22:06:46 -05:00
David Sidrane 54abd997de canbootloader:Update to use NuttX 2021-01-13 22:06:46 -05:00
David Sidrane 271f87f8d2 canbootloader:Fixed Warning 2021-01-13 22:06:46 -05:00
David Sidrane 238c28d458 SK6812 Led driver 2021-01-13 22:06:46 -05:00
David Sidrane 85bd04f0c7 can-gps-v1:canbootloader Fixed 2021-01-13 22:06:46 -05:00
David Sidrane 3e08fd6682 can-gps-v1: Removed GPIO_CAN_CTRL 2021-01-13 22:06:46 -05:00
David Sidrane c2c92cb2c8 can-gps-v1: Added LED pin 2021-01-13 22:06:46 -05:00
David Sidrane cdae8bf168 can-gps-v1:Fixed Clock 2021-01-13 22:06:46 -05:00
Daniel Agar a0d8d5ac74 sensors/vehicle_gps_position: untangle and remove unnecessary state 2021-01-13 20:17:49 -05:00
Daniel Agar bc8ec5d1f5 uavcannode: support optical_flow 2021-01-13 19:35:28 -05:00
RomanBapst 47364ce8d6 updated tuning for gazebo plane airframe config
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst f05599caff tecs: use speed derivative provided by local position
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer b230bbfe88 ROMFS: remove outdated TECS parameter from configs
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
RomanBapst e546584555 tecs: moved trivial getter methods to header file
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Roman Bapst 701c105ab6 Update src/lib/tecs/TECS.cpp
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst fa559aef43 TECS: stop learing integrator if airspeed is not available, but don't zero it
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst d4d1c0fe01 TECS: some cosmetics
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst 97cc1e25dd TECS: hande pitch and throttle integrator saturation consistently
- don't decay integrator during saturation but prevent it from being learned
into the direction which causes more actuator saturation

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst 77627a08ca TECS: don't allow speed height weights to be larger than one
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer dca89763b3 TECS: apply FW_LND_THRTC_SC to altitude error time constant
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer 3d3ff75495 TECS: update some params to latest results from flight testing
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer 3102b9f071 TECS: remove throttle integral limits
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
RomanBapst 987c320825 TECS: removed unused parameter
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst 5c4c2c240c tecs: dot not clip throttle integrator during saturation but only allow
it to propagate into a direction which does not saturate

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer 2ca4269464 TECS: separate integral gains for throttle and pitch loops
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer 72dfb2078a TECS: adapt params to new control structure
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
RomanBapst 01f891618b TECS: move to new control loop architecture
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst 447e14906c TECS: log more TECS states to enable better analysis
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst 8823f5e1ec TECS: added method to get SKE weighting
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst d0e8b882a2 TECS: added alpha filter classes to energy rate and tas derivative
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
xdwgood cabb50a67b 13001_caipirinha_vtol:Ensure that the max/min pwm changes take effect 2021-01-13 11:32:01 +01:00
Julian Kent be0f5a7fe4 Fix implicit float->double conversions in tests 2021-01-13 10:26:10 +01:00
Julian Kent 2d6758a39d Cleanup of dataman mocks and check interval definition 2021-01-13 10:26:10 +01:00
Julian Kent a97a4d8bb8 Fix enum and param update 2021-01-13 10:26:10 +01:00
Julian Kent c745c8bb45 Small navigator refactor/cleanup 2021-01-13 10:26:10 +01:00
Julian Kent 04d859e36e Fix test failure from parameter autosave starting WQ 2021-01-13 10:26:10 +01:00
RomanBapst f97dcde4e2 GeofenceBreachAvoidanceTest: added tests for max dist to home
Signed-off-by: Julian Kent <julian@auterion.com>
2021-01-13 10:26:10 +01:00
RomanBapst 3fa15cec91 GeofenceBreachAvoidance: improve behavior when using max dist to home option
- ensure that the vehicle is loitering with sufficient clearance to the boundary

Signed-off-by: Julian Kent <julian@auterion.com>
2021-01-13 10:26:10 +01:00
Julian Kent a5dfa0c803 Add helper function for decel distances
Co-authored-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 10:26:10 +01:00
RomanBapst 0ac597fba8 Use new GeofenceBreachAvoidance from Navigator
Signed-off-by: Julian Kent <julian@auterion.com>
2021-01-13 10:26:10 +01:00
RomanBapst e536868104 Add GeofenceBreachAvoidance class
Signed-off-by: Julian Kent <julian@auterion.com>
2021-01-13 10:26:10 +01:00
Julian Kent 8622c21496 Move VelocitySmoothing to new motion_planning library
Co-authored-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 10:26:10 +01:00
229 changed files with 4108 additions and 1757 deletions
@@ -0,0 +1,59 @@
name: NuttX UAVCAN firmware
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2020-11-18
strategy:
matrix:
config: [
cuav_can-gps-v1_default,
#nxp_ucans32k146_default,
px4_fmu-v4_cannode
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 400M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v2
with:
name: px4_cannode_${{matrix.config}}
path: build/${{matrix.config}}/*.uavcan.bin
+5
View File
@@ -66,6 +66,11 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: cuav_can-gps-v1_default
cuav_can-gps-v1_canbootloader:
short: cuav_can-gps-v1_canbootloader
buildType: MinSizeRel
settings:
CONFIG: cuav_can-gps-v1_canbootloader
cuav_nora_default:
short: cuav_nora
buildType: MinSizeRel
@@ -16,20 +16,31 @@ then
param set FW_LND_ANG 8
param set FW_THR_LND_MAX 0
param set FW_L1_PERIOD 15
param set FW_P_TC 0.5
param set FW_PR_FF 0.40
param set FW_PR_I 0.05
param set FW_PR_P 0.05
param set FW_R_TC 0.7
param set FW_RR_FF 0.20
param set FW_RR_I 0.02
param set FW_RR_P 0.22
param set FW_L1_PERIOD 12
param set FW_MAN_P_MAX 30
param set FW_PR_I 0.4
param set FW_PR_P 0.9
param set FW_PR_FF 0.2
param set FW_PSP_OFF 2
param set FW_P_LIM_MAX 32
param set FW_P_LIM_MIN -15
param set FW_RR_FF 0.1
param set FW_RR_P 0.3
param set FW_THR_MAX 0.6
param set FW_THR_MIN 0.05
param set FW_THR_CRUISE 0.25
param set FW_T_ALT_TC 2
param set FW_T_CLMB_MAX 8
param set FW_T_HRATE_FF 0.5
param set FW_T_SINK_MAX 2.7
param set FW_T_SINK_MIN 2.2
param set FW_T_TAS_TC 2
param set FW_W_EN 1
param set MIS_LTRMIN_ALT 30
@@ -9,40 +9,46 @@
if [ $AUTOCNF = yes ]
then
param set FW_AIRSPD_MAX 25
param set FW_AIRSPD_MIN 14
param set FW_AIRSPD_TRIM 16
param set FW_L1_PERIOD 12
param set FW_MAN_P_MAX 30
param set FW_PR_FF 0.2
param set FW_PR_I 0.4
param set FW_PR_P 0.9
param set FW_PSP_OFF 2
param set FW_P_LIM_MAX 32
param set FW_P_LIM_MIN -15
param set FW_RR_FF 0.1
param set FW_RR_P 0.01
param set FW_RR_P 0.3
param set FW_THR_CRUISE 0.25
param set FW_THR_MAX 0.6
param set FW_THR_MIN 0.05
param set FW_T_ALT_TC 2
param set FW_T_CLMB_MAX 8
param set FW_T_HRATE_FF 0.5
param set FW_T_SINK_MAX 2.7
param set FW_T_SINK_MIN 2.2
param set FW_T_TAS_TC 2
param set MC_ROLLRATE_P 0.3
param set MC_YAW_P 1.6
param set MIS_LTRMIN_ALT 10
param set MIS_TAKEOFF_ALT 10
param set MIS_YAW_TMT 10
param set MPC_ACC_HOR_MAX 2
param set MPC_ACC_HOR_MAX 2
param set MPC_THR_HOVER 0.58
param set MPC_TKO_SPEED 1
param set MPC_XY_P 0.8
param set MPC_XY_VEL_P_ACC 3
param set MPC_XY_VEL_I_ACC 4
param set MPC_XY_VEL_D_ACC 0.1
param set MPC_Z_VEL_MAX_DN 1.5
param set NAV_ACC_RAD 5
param set NAV_LOITER_RAD 80
param set VT_F_TRANS_DUR 5
param set VT_FWD_THRUST_EN 4
param set VT_F_TRANS_THR 0.75
param set VT_ARSP_TRANS 16
param set VT_MOT_ID 1234
param set VT_FW_MOT_OFFID 1234
param set VT_TYPE 2
param set VT_B_TRANS_DUR 8
param set VT_TYPE 2
fi
@@ -9,23 +9,31 @@
if [ $AUTOCNF = yes ]
then
param set FW_AIRSPD_MAX 25
param set FW_AIRSPD_MIN 14
param set FW_AIRSPD_TRIM 16
param set FW_L1_PERIOD 12
param set FW_MAN_P_MAX 30
param set FW_PR_I 0.2
param set FW_PR_P 0.3
param set FW_PSP_OFF 2
param set FW_P_LIM_MAX 32
param set FW_P_LIM_MIN -15
param set FW_RR_P 0.3
param set FW_THR_CRUISE 0.33
param set FW_THR_MAX 0.6
param set FW_THR_MIN 0.05
param set FW_T_ALT_TC 2
param set FW_T_CLMB_MAX 8
param set FW_T_HRATE_FF 0.5
param set FW_T_SINK_MAX 2.7
param set FW_T_SINK_MIN 2.2
param set FW_T_TAS_TC 2
param set MC_ROLLRATE_P 0.3
param set MIS_YAW_TMT 10
param set MPC_ACC_HOR_MAX 2
param set MPC_ACC_HOR_MAX 2
param set MPC_THR_MIN 0.3
param set MPC_XY_P 0.15
param set MPC_XY_P 0.8
param set MPC_XY_VEL_P_ACC 3
param set MPC_XY_VEL_I_ACC 4
param set MPC_XY_VEL_D_ACC 0.1
param set MPC_XY_VEL_P_ACC 1
param set MPC_Z_VEL_MAX_DN 1.5
param set MPC_Z_VEL_P_ACC 16
param set NAV_ACC_RAD 5
param set NAV_LOITER_RAD 80
@@ -14,9 +14,20 @@ then
param set FW_PR_FF 0.2
param set FW_PR_I 0.4
param set FW_PR_P 0.9
param set FW_PSP_OFF 3
param set FW_PSP_OFF 2
param set FW_P_LIM_MAX 32
param set FW_P_LIM_MIN -15
param set FW_RR_FF 0.1
param set FW_RR_P 0.3
param set FW_THR_CRUISE 0.38
param set FW_THR_MAX 0.6
param set FW_THR_MIN 0.05
param set FW_T_ALT_TC 2
param set FW_T_CLMB_MAX 8
param set FW_T_HRATE_FF 0.5
param set FW_T_SINK_MAX 2.7
param set FW_T_SINK_MIN 2.2
param set FW_T_TAS_TC 2
param set MC_YAW_P 1.6
@@ -28,10 +39,10 @@ then
param set MPC_XY_VEL_I_ACC 4
param set MPC_XY_VEL_D_ACC 0.1
param set NAV_LOITER_RAD 100
param set NAV_ACC_RAD 5
param set NAV_LOITER_RAD 80
param set VT_B_TRANS_DUR 8
param set VT_ELEV_MC_LOCK 0
param set VT_FWD_THRUST_EN 4
param set VT_MOT_ID 1234
param set VT_TILT_TRANS 0.6
@@ -9,12 +9,14 @@
if [ $AUTOCNF = yes ]
then
param set MC_PITCHRATE_P 0.1
param set MC_PITCHRATE_I 0.05
param set MC_PITCH_P 6.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_I 0.1
param set MC_ROLL_P 6.0
param set MC_PITCHRATE_P 0.1000
param set MC_PITCHRATE_I 0.0400
param set MC_PITCHRATE_D 0.0010
param set MC_PITCH_P 9.0
param set MC_ROLLRATE_P 0.1000
param set MC_ROLLRATE_I 0.0400
param set MC_ROLLRATE_D 0.0010
param set MC_ROLL_P 9.0
param set MPC_XY_VEL_I_ACC 4
param set MPC_XY_VEL_P_ACC 3
@@ -51,4 +51,4 @@ set MAV_TYPE 19
set MIXER vtol_tailsitter_duo
set PWM_OUT 1234
set PWM_OUT 123456
@@ -54,7 +54,6 @@ then
param set FW_T_SINK_MAX 3
param set FW_T_SINK_MIN 1
param set FW_T_VERT_ACC 6
param set FW_T_HRATE_P 0.1
param set FW_THR_CRUISE 0.70
param set FW_THR_SLEW_MAX 1
param set FW_MAN_P_MAX 30
@@ -49,8 +49,6 @@ then
param set FW_T_HRATE_FF 0
param set FW_T_SINK_MAX 15
param set FW_T_SINK_MIN 3
param set FW_T_THRO_CONST 6
param set FW_T_TIME_CONST 6
param set FW_YR_I 0.1
param set FW_YR_P 0.15
@@ -0,0 +1,49 @@
#!/bin/sh
#
# @name ThunderFly TF-G2
#
# @type Autogyro
# @class Autogyro
#
# @output MAIN2 rotor_head_L
# @output MAIN3 rotor_head_R
# @output MAIN4 rudder
# @output MAIN5 throttle
#
#
# @url https://github.com/ThunderFly-aerospace/TF-G2/
# @maintainer ThunderFly s.r.o., Roman Dvorak <dvorakroman@thunderfly.cz>
#
# @board px4_fmu-v2 exclude
# @board intel_aerofc-v1 exclude
# @board bitcraze_crazyflie exclude
#
. ${R}etc/init.d/rc.fw_defaults
if [ $AUTOCNF = yes ]
then
param set BAT_CAPACITY 3300
param set BAT_N_CELLS 3
param set PWM_AUX_RATE 50
param set PWM_RATE 50
param set SENS_BOARD_ROT 4
param set FW_AIRSPD_MAX 20
param set FW_AIRSPD_MIN 7
param set FW_AIRSPD_TRIM 13
param set FW_THR_CRUISE 0.8
param set FW_MAN_P_MAX 25
param set FW_MAN_R_MAX 25
param set FW_PR_I 0.02
param set FW_R_LIM 40
param set FW_P_LIM_MAX 25
param set FW_P_LIM_MIN -5
param set FW_P_RMAX_NEG 20
fi
set MIXER TF-G2
set MIXER_AUX pass
@@ -146,7 +146,9 @@ px4_add_romfs_files(
16001_helicopter
# [17000, 17999] Autogyro
17002_TF-AutoG2
17003_TF-G2
24001_dodeca_cox
+2 -2
View File
@@ -183,8 +183,8 @@ else
then
if param compare SYS_AUTOCONFIG 1
then
# Wipe out params except RC*, flight modes, total flight time, accel cal, gyro cal, next flight UUID
param reset_all SYS_AUTOSTART SYS_AUTOCONFIG RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO* COM_FLIGHT_UUID
# Wipe out params except RC*, flight modes, total flight time, calibration parameters, next flight UUID
param reset_all SYS_AUTO* RC* COM_FLTMODE* LND_FLIGHT* TC_* CAL_ACC* CAL_GYRO* COM_FLIGHT* SYS_PARAM_VER
fi
set AUTOCNF yes
+39
View File
@@ -0,0 +1,39 @@
TF-G2 autogyro mixer
==================================================
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
CH1: empty - fixing cuav nano jittering of 1st output.
Z:
CH2, 3: rotor-head mixer
-------------
Two scalers total (output, roll).
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 -10000 -10000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 -10000 -10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
CH4: Rudder mixer
------------
Two scalers total (output, yaw).
M: 1
S: 0 2 10000 10000 0 -10000 10000
CH5: Motor speed mixer
-----------------
Two scalers total (output, thrust).
M: 1
S: 0 3 0 20000 -10000 -10000 10000
+2 -3
View File
@@ -12,9 +12,8 @@ if bst start -X
then
fi
if board_adc start
then
fi
board_adc start
system_power start
if sdp3x_airspeed start -X
then
+1 -1
View File
@@ -182,7 +182,7 @@ class FirmwareImage(object):
self._contents.seek(0, os.SEEK_END)
self._length = self._contents.tell()
if self._padding:
fill = self._length % self._padding
fill = self._padding - (self._length % self._padding)
if fill:
self._length += fill
self._padding = fill
+1
View File
@@ -45,6 +45,7 @@ px4_add_board(
pwm_out
rc_input
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal I2C bus
hmc5883 -T -I -R 12 start
+4 -43
View File
@@ -72,39 +72,24 @@
#define ADC_RC_RSSI_CHANNEL 11
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
/* Power supply control and monitoring GPIOs */
// #define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8)
// #define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
// #define GPIO_VDD_SERVO_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7)
// #define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3)
// #define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10)
// #define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15)
/* Tone alarm output */
#define TONE_ALARM_TIMER 14 /* timer 14 */
#define TONE_ALARM_CHANNEL 1 /* channel 1 */
#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF9|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
/* AUX PWMs
*/
/* AUX PWMs */
#define DIRECT_PWM_OUTPUT_CHANNELS 8
#define DIRECT_INPUT_TIMER_CHANNELS 8
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS */
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
/* High-resolution timer */
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel */
@@ -143,46 +128,24 @@
#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX)
#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true))
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120
/* This board provides the board_on_reset interface */
#define BOARD_HAS_ON_RESET 1
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the PX4FMU board.
* Called to configure SPI chip select GPIO pins for the board.
*
****************************************************************************************************/
@@ -190,10 +153,8 @@ extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
#define board_peripheral_reset(ms)
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */
+2 -30
View File
@@ -49,11 +49,6 @@
#include <stm32_gpio.h>
/* Configuration ************************************************************************************/
#define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC
#define BOARD_HAS_NBAT_I 0 // No Ibat ADC
/*
* ADC channels
*
@@ -88,18 +83,14 @@
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL))
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.133333333f)
#define BOARD_BATTERY1_A_PER_V (36.367515152f)
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 9
#define DIRECT_INPUT_TIMER_CHANNELS 9
@@ -110,7 +101,6 @@
#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 3 */
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
/* Power switch controls ******************************************************/
@@ -118,27 +108,9 @@
#define SDIO_SLOTNO 0 /* Only one slot */
#define SDIO_MINOR 0
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && !defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* AV-X_V1 never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define ADC_BATTERY_VOLTAGE_CHANNEL 0
#define ADC_BATTERY_CURRENT_CHANNEL 1 // TODO: review
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC))
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* This board provides a DMA pool and APIs */
+1 -10
View File
@@ -109,13 +109,6 @@
*/
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
/*
* ADC channels
*
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver
*/
#define ADC_CHANNELS 0
/* Tone alarm output : These are only applicable when the buzzer deck is attached */
#define TONE_ALARM_TIMER 5 /* timer 5 */
#define TONE_ALARM_CHANNEL 3 /* channel 3 */
@@ -123,9 +116,7 @@
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF2|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
#define GPIO_TONE_ALARM_NEG (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN3)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 4
/* This board overrides the defaults by providing
+6 -26
View File
@@ -27,45 +27,25 @@ px4_add_board(
ARCHITECTURE cortex-m4
ROMFSROOT cannode
UAVCAN_INTERFACES 1
SERIAL_PORTS
GPS1:/dev/ttyS1
DRIVERS
#adc
barometer/ms5611
bootloaders
gps
magnetometer/rm3100
#safety_button
#tone_alarm
safety_button
tone_alarm
uavcannode
MODULES
#ekf2
#load_mon
#sensors
#temperature_compensation
load_mon
SYSTEMCMDS
#bl_update
#dmesg
#dumpfile
#esc_calib
#hardfault_log
#i2cdetect
#led_control
#mft
#mixer
#motor_ramp
#motor_test
#mtd
#nshterm
i2cdetect
led_control
param
perf
reboot
#reflect
#sd_bench
#shutdown
top
topic_listener
#tune_control
tune_control
ver
work_queue
)
+1 -1
View File
@@ -3,7 +3,7 @@
# board sensors init
#------------------------------------------------------------------------------
#board_adc start
gps start -d /dev/ttyS1 -g 38400 -p ubx
# Internal SPI
ms5611 -s start
@@ -58,8 +58,8 @@
* LSE - not installed
*/
#define STM32_BOARD_USEHSE 1
#define STM32_BOARD_XTAL 8000000
#define STM32_BOARD_USEHSE 1
#define STM32_BOARD_XTAL 16000000
#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
#define STM32_HSI_FREQUENCY 16000000ul
@@ -128,40 +128,22 @@
/* Alternate function pin selections ************************************************/
/*
* UARTs.
*/
/* UARTs */
#define GPIO_USART1_RX GPIO_USART1_RX_2
#define GPIO_USART1_TX GPIO_USART1_TX_2
#define GPIO_USART2_RX GPIO_USART2_RX_1
#define GPIO_USART2_TX GPIO_USART2_TX_1
/*
* CAN
*
* CAN1 is routed to the onboard transceiver.
*/
/* CAN */
#define GPIO_CAN1_RX GPIO_CAN1_RX_2
#define GPIO_CAN1_TX GPIO_CAN1_TX_2
/*
* I2C
*
* The optional _GPIO configurations allow the I2C driver to manually
* reset the bus to clear stuck slaves. They match the pin configuration,
* but are normally-high GPIOs.
*/
/* I2C */
#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2
#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2
#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8)
#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
/*
* SPI
*
* There are sensors on SPI1, and SPI2 is connected to the FRAM.
*/
/* SPI */
#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz)
#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz)
#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz)
@@ -71,13 +71,15 @@ SECTIONS
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
. = ALIGN(32);
/*
This signature provides the bootloader with a way to delay booting
*/
_bootdelay_signature = ABSOLUTE(.);
FILL(0xffecc2925d7d05c5)
. += 8;
. = ALIGN(8);
/*
* This section positions the app_descriptor_t used
* by the make_can_boot_descriptor.py tool to set
* the application image's descriptor so that the
* uavcan bootloader has the ability to validate the
* image crc, size etc
*/
KEEP(*(.app_descriptor))
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
@@ -32,6 +32,7 @@
############################################################################
if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader")
add_library(drivers_board
boot_config.h
boot.c
+4 -3
View File
@@ -48,16 +48,17 @@
#include <stdint.h>
/* BUTTON *************************************************************************** */
#define BUTTON_BOOT0n (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3|GPIO_EXTI)
#define IRQBUTTON BUTTON_BOOT0_BIT
#define BUTTON_SAFETY /* PB3 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN3|GPIO_EXTI)
#define GPIO_RGB_S /* PB0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0)
/* CAN Silence
*
* Silent mode control \ ESC Mux select
*/
#define GPIO_CAN1_SILENT_S0 /* PB5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN5)
#define GPIO_CAN_CTRL /* PB5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_PORTB|GPIO_PIN5|GPIO_OUTPUT_CLEAR)
#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1)
#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN3)
/* Tone alarm output. */
#define TONE_ALARM_TIMER 2 /* timer 2 */
+19 -19
View File
@@ -65,7 +65,7 @@ __EXPORT void stm32_boardinitialize(void)
putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR);
stm32_configgpio(GPIO_CAN1_RX);
stm32_configgpio(GPIO_CAN1_TX);
stm32_configgpio(GPIO_CAN_CTRL);
stm32_configgpio(GPIO_CAN1_SILENT_S0);
putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
@@ -155,33 +155,33 @@ size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version)
#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)}
typedef begin_packed_struct struct led_t {
uint16_t red : 5;
uint16_t green : 6;
uint16_t blue : 5;
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t hz;
} end_packed_struct led_t;
static const led_t i2l[] = {
led(0, off, 0, 0, 0, 0),
led(1, reset, 10, 63, 31, 255),
led(2, autobaud_start, 0, 63, 0, 1),
led(3, autobaud_end, 0, 63, 0, 2),
led(4, allocation_start, 0, 0, 31, 2),
led(5, allocation_end, 0, 63, 31, 3),
led(6, fw_update_start, 15, 63, 31, 3),
led(7, fw_update_erase_fail, 15, 63, 15, 3),
led(8, fw_update_invalid_response, 31, 0, 0, 1),
led(9, fw_update_timeout, 31, 0, 0, 2),
led(a, fw_update_invalid_crc, 31, 0, 0, 4),
led(b, jump_to_app, 0, 63, 0, 10),
led(0, off, 0, 0, 0, 0),
led(1, reset, 128, 128, 128, 30),
led(2, autobaud_start, 0, 128, 0, 1),
led(3, autobaud_end, 0, 128, 0, 2),
led(4, allocation_start, 0, 0, 64, 2),
led(5, allocation_end, 0, 128, 64, 3),
led(6, fw_update_start, 32, 128, 64, 3),
led(7, fw_update_erase_fail, 32, 128, 32, 3),
led(8, fw_update_invalid_response, 64, 0, 0, 1),
led(9, fw_update_timeout, 64, 0, 0, 2),
led(a, fw_update_invalid_crc, 64, 0, 0, 4),
led(b, jump_to_app, 0, 128, 0, 10),
};
void board_indicate(uiindication_t indication)
{
rgb_led(i2l[indication].red << 3,
i2l[indication].green << 2,
i2l[indication].blue << 3,
rgb_led(i2l[indication].red,
i2l[indication].green,
i2l[indication].blue,
i2l[indication].hz);
}
+2 -6
View File
@@ -101,7 +101,7 @@
#define OPT_RESTART_TIMEOUT_MS 20000
/* Reserved for the Booloader */
#define OPT_BOOTLOADER_SIZE_IN_K (1024*8)
#define OPT_BOOTLOADER_SIZE_IN_K (1024*64)
/* Reserved for the application out of the total
* system flash minus the BOOTLOADER_SIZE_IN_K
@@ -132,9 +132,5 @@
/* Bootloader Option*****************************************************************
*
* GPIO Function MPU Board
* Pin # Name
* -- ----- -------------------------------- ----------------------------
* * PC[09] PC9/TIM3_CH4 40 BOOT0
*/
#define GPIO_GETNODEINFO_JUMPER (BUTTON_BOOT0n&~(GPIO_EXTI))
#define GPIO_GETNODEINFO_JUMPER (BUTTON_SAFETY & ~GPIO_EXTI)
+3
View File
@@ -90,6 +90,9 @@ stm32_boardinitialize(void)
stm32_configgpio(GPIO_CAN1_SILENT_S0);
stm32_configgpio(GPIO_LED_SAFETY);
stm32_configgpio(GPIO_BTN_SAFETY);
// Configure SPI all interfaces GPIO & enable power.
stm32_spiinitialize();
}
+89 -23
View File
@@ -39,17 +39,83 @@
#include <arch/board/board.h>
#include <hardware/stm32_tim.h>
#include <dwt.h>
#include <nvic.h>
#include "led.h"
#define TMR_BASE STM32_TIM3_BASE
#define TMR_FREQUENCY STM32_APB1_TIM3_CLKIN
#define TMR_BASE STM32_TIM1_BASE
#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN
#define TMR_REG(o) (TMR_BASE+(o))
#define LED_COUNT 8 // Eight LEDs in ring
typedef union {
uint8_t grb[3];
uint32_t l;
} led_data_t;
static uint8_t off[] = {0, 0, 0};
#define REG(_addr) (*(volatile uint32_t *)(_addr))
#define rDEMCR REG(NVIC_DEMCR)
#define rDWT_CTRL REG(DWT_CTRL)
#define rDWT_CNT REG(DWT_CYCCNT)
#define PORT_B REG(STM32_GPIOB_ODR)
#define D0 REG(STM32_GPIOB_ODR) &= ~1;
#define D1 REG(STM32_GPIOB_ODR) |= 1;
#define DWT_DEADLINE(t) rDWT_CNT + (t)
#define DWT_WAIT(v, D) while((rDWT_CNT - (v)) < (D));
#define T0H (STM32_SYSCLK_FREQUENCY/3333333)
#define T1H (STM32_SYSCLK_FREQUENCY/1666666)
#define TW (STM32_SYSCLK_FREQUENCY/800000)
static void setled(uint8_t *p, int count)
{
rDEMCR |= NVIC_DEMCR_TRCENA;
rDWT_CTRL |= DWT_CTRL_CYCCNTENA_MASK;
while (count--) {
uint8_t l = *p++;
uint32_t deadline = DWT_DEADLINE(TW);
for (uint32_t mask = (1 << 7); mask != 0; mask >>= 1) {
DWT_WAIT(deadline, TW);
deadline = rDWT_CNT;
D1;
if (l & mask) {
DWT_WAIT(deadline, T1H);
} else {
DWT_WAIT(deadline, T0H);
}
D0;
}
DWT_WAIT(deadline, TW);
}
}
static led_data_t led_data = {0};
static int timerInterrupt(int irq, void *context, void *arg)
{
putreg16(~getreg16(TMR_REG(STM32_GTIM_SR_OFFSET)), TMR_REG(STM32_GTIM_SR_OFFSET));
static int d2 = 1;
setled((d2++ & 1) ? led_data.grb : off, sizeof(led_data.grb));
return 0;
}
void rgb_led(int r, int g, int b, int freqs)
{
long fosc = TMR_FREQUENCY;
long prescale = 2048;
long prescale = 1536;
long p1s = fosc / prescale;
long p0p5s = p1s / 2;
uint16_t val;
@@ -58,8 +124,15 @@ void rgb_led(int r, int g, int b, int freqs)
if (!once) {
once = 1;
/* Enabel Clock to Block */
modifyreg32(STM32_RCC_APB1ENR, 0, RCC_APB1ENR_TIM3EN);
stm32_configgpio(GPIO_RGB_S);
for (int i = 0; i < LED_COUNT; i++) {
setled(off, sizeof(off));
}
/* Enable Clock to Block */
modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN);
/* Reload */
val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET));
@@ -72,28 +145,21 @@ void rgb_led(int r, int g, int b, int freqs)
/* Enable STM32_TIM_SETMODE*/
putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET));
putreg32(p0p5s + 1, TMR_REG(STM32_BTIM_ARR_OFFSET));
putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE |
(ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET));
putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET));
putreg16(ATIM_CCER_CC3E | ATIM_CCER_CC3P |
ATIM_CCER_CC2E | ATIM_CCER_CC2P |
ATIM_CCER_CC1E | ATIM_CCER_CC1P, TMR_REG(STM32_GTIM_CCER_OFFSET));
// TODO: verify
stm32_configgpio(GPIO_TIM3_CH1OUT_1);
stm32_configgpio(GPIO_TIM3_CH2OUT_1);
stm32_configgpio(GPIO_TIM3_CH3OUT_1);
irq_attach(STM32_IRQ_TIM1CC, timerInterrupt, NULL);
up_enable_irq(STM32_IRQ_TIM1CC);
putreg16(GTIM_DIER_CC1IE, TMR_REG(STM32_GTIM_DIER_OFFSET));
}
long p = freqs == 0 ? p1s : p1s / freqs;
putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET));
p = freqs == 0 ? p1s + 1 : p0p5s / freqs;
putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET));
putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET));
putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET));
long p = freqs == 0 ? p1s + 1 : p0p5s / freqs;
putreg32(p + 1, TMR_REG(STM32_BTIM_ARR_OFFSET));
putreg32(p, TMR_REG(STM32_GTIM_CCR1_OFFSET));
led_data.grb[0] = g;
led_data.grb[1] = r;
led_data.grb[2] = b;
setled(led_data.grb, sizeof(led_data.grb));
val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET));
+1
View File
@@ -50,6 +50,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -3,6 +3,7 @@
# board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI1 (internal)
rm3100 -s start
-2
View File
@@ -110,8 +110,6 @@
#define DIRECT_PWM_OUTPUT_CHANNELS 8
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nPOWER_IN_ADC /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1)
#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2)
#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0)
+1
View File
@@ -53,6 +53,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -3,6 +3,7 @@
# CUAV X7Pro specific board sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI1 (internal)
#adis16470 -s start
+1 -6
View File
@@ -110,8 +110,6 @@
#define DIRECT_PWM_OUTPUT_CHANNELS 8
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nPOWER_IN_ADC /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1)
#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2)
#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0)
@@ -179,10 +177,7 @@
#define GPIO_LED_SAFETY FMU_LED_AMBER
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
@@ -52,6 +52,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -52,6 +52,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI4
ms5611 -s -b 4 start
@@ -97,7 +97,6 @@
#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID
#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID
#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID
@@ -124,10 +123,7 @@
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
@@ -51,6 +51,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -51,6 +51,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI4
ms5611 -s -b 4 start
@@ -97,7 +97,6 @@
#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID
#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID
#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID
@@ -124,10 +123,7 @@
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
+1
View File
@@ -30,6 +30,7 @@ px4_add_board(
magnetometer/lsm9ds1_mag
pwm_out_sim
rc_input
system_power
#telemetry # all available telemetry drivers
MODULES
airspeed_selector
-2
View File
@@ -47,11 +47,9 @@
#define BOARD_MAX_LEDS 1 // Number of external LED's this board has
// I2C
#define PX4_NUMBER_I2C_BUSES 1
// ADC channels:
// A0 - board voltage (shows 5V)
// A1 - servo rail voltage
+1
View File
@@ -51,6 +51,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -3,6 +3,7 @@
# Holybro Durandal V1 specific board sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20689
icm20689 -R 2 -s start
+1 -16
View File
@@ -70,11 +70,6 @@
/* Configuration ************************************************************************************/
# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks
# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid
# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC
# define BOARD_HAS_NBAT_I 2 // No Ibat ADC
/* Holybro Durandal V1 GPIOs ************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
@@ -95,11 +90,9 @@
*/
/* ADC defines to be used in sensors.cpp to read from a particular channel */
#define ADC1_CH(n) (n)
/* Define GPIO pins used as ADC N.B. Channel numbers must match below */
#define PX4_ADC_GPIO \
/* PA0 */ GPIO_ADC1_INP16, \
/* PA1 */ GPIO_ADC1_INP17, \
@@ -213,7 +206,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@@ -314,17 +306,10 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
/* Board never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
+4 -29
View File
@@ -49,12 +49,6 @@
#include <stm32_gpio.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* GPIOs ***********************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
#define GPIO_nLED_BLUE /* PA2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN2)
@@ -64,7 +58,6 @@
#define FLASH_BASED_PARAMS
/*
* ADC channels
*
@@ -92,13 +85,11 @@
(1 << ADC_BATTERY_CURRENT_CHANNEL) | \
(1 << ADC_RSSI_IN_CHANNEL))
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V. */
#define BOARD_BATTERY1_V_DIV (10.9f)
#define BOARD_BATTERY1_A_PER_V (17.f)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 6
#define DIRECT_INPUT_TIMER_CHANNELS 6
@@ -106,10 +97,7 @@
#define GPIO_TONE_ALARM_IDLE /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN15)
#define GPIO_TONE_ALARM_GPIO /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN15)
/* USB OTG FS
*
* PA8 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS PA8 OTG_FS_VBUS VBUS sensing */
#define GPIO_OTGFS_VBUS /* PA8 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN8)
/* High-resolution timer */
@@ -117,8 +105,7 @@
#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
#define RC_SERIAL_PORT "/dev/ttyS4"
#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5)
@@ -142,20 +129,8 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
+1
View File
@@ -55,6 +55,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20602
icm20602 -s -R 2 start
+5 -83
View File
@@ -68,26 +68,8 @@
#define PX4IO_SERIAL_CLOCK STM32_PCLK1_FREQUENCY
#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */
/* Configuration ************************************************************************************/
#define BOARD_HAS_LTC4417
#if defined(BOARD_HAS_LTC4417)
# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks
# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid
# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC
# define BOARD_HAS_NBAT_I 2 // No Ibat ADC
#else
# define BOARD_HAS_LTC44XX_VALIDS 0 // No LTC or N Bricks
# define BOARD_HAS_USB_VALID 0 // LTC Has No USB valid
# define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC
# define BOARD_HAS_NBAT_I 0 // No Ibat ADC
#endif
/* PX4FMU GPIOs ***********************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
#define GPIO_nLED_RED /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1)
#define GPIO_nLED_GREEN /* PC6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6)
#define GPIO_nLED_BLUE /* PC7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7)
@@ -137,7 +119,6 @@
#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13)
#define ADC1_SPARE_1_CHANNEL /* PC4 */ ADC1_CH(14)
#if BOARD_HAS_NBAT_V == 2 && BOARD_HAS_NBAT_I == 2
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY1_CURRENT_CHANNEL) | \
@@ -150,41 +131,15 @@
(1 << ADC_HW_VER_SENSE_CHANNEL) | \
(1 << ADC_HW_REV_SENSE_CHANNEL) | \
(1 << ADC1_SPARE_1_CHANNEL))
#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 1
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY1_CURRENT_CHANNEL) | \
(1 << ADC1_SPARE_2_CHANNEL) | \
(1 << ADC_RSSI_IN_CHANNEL) | \
(1 << ADC_SCALED_V5_CHANNEL) | \
(1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \
(1 << ADC_HW_VER_SENSE_CHANNEL) | \
(1 << ADC_HW_REV_SENSE_CHANNEL) | \
(1 << ADC1_SPARE_1_CHANNEL))
#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 0
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
(1 << ADC1_SPARE_2_CHANNEL) | \
(1 << ADC_RSSI_IN_CHANNEL) | \
(1 << ADC_SCALED_V5_CHANNEL) | \
(1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \
(1 << ADC_HW_VER_SENSE_CHANNEL) | \
(1 << ADC_HW_REV_SENSE_CHANNEL) | \
(1 << ADC1_SPARE_1_CHANNEL))
#endif
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (18.1f) /* measured with the provided PM board */
#define BOARD_BATTERY1_A_PER_V (36.367515152f)
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
/* HW Version and Revision drive signals Default to 1 to detect */
#define BOARD_HAS_HW_VERSIONING
#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14)
@@ -256,7 +211,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@@ -380,43 +334,11 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#if BOARD_HAS_USB_VALID == 1
# define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#else
# define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#endif
/* FMUv5 never powers odd the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0
# define BOARD_ADC_BRICK1_VALID (1)
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 1
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 2
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
#elif BOARD_HAS_LTC44XX_VALIDS == 3
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID))
#elif BOARD_HAS_LTC44XX_VALIDS == 4
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID))
# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID))
#else
# error Unsupported BOARD_HAS_LTC44XX_VALIDS value
#endif
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC))
@@ -123,7 +123,7 @@ void AEROFC_ADC::RunImpl()
adc_report.raw_data[i] = (buffer[i * 2] | (buffer[i * 2 + 1] << 8));
}
for (; i < PX4_MAX_ADC_CHANNELS; ++i) { // set unused channel id to -1
for (; i < adc_report_s::MAX_ADC_CHANNELS; ++i) { // set unused channel id to -1
adc_report.channel_id[i] = -1;
}
+5 -56
View File
@@ -42,20 +42,10 @@
#pragma once
/****************************************************************************************************
* Included Files
****************************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* Configuration ************************************************************************************/
/* PX4FMU GPIOs ***********************************************************************************/
/* LEDs */
#define GPIO_LED0 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN9)
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN10)
@@ -89,34 +79,23 @@
#define ADC_BATTERY_VOLTAGE_CHANNEL 1
#define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1))
/*
* Define Battery 1 Voltage Divider, using default for A/V
*/
/* Define Battery 1 Voltage Divider, using default for A/V */
#define BOARD_BATTERY1_V_DIV (9.0f)
#define DIRECT_PWM_OUTPUT_CHANNELS 1
#define BOARD_HAS_PWM 0
/*
* USB OTG FS
*/
/*
* RC Serial port
*/
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS2" /* No HW invert support */
/*
* High-resolution timer
*/
/* High-resolution timer */
#define HRT_TIMER 3 /* use timer3 for the HRT */
#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel */
#define FLASH_BASED_PARAMS
#define FLASH_BASED_DATAMAN
/*
* ESCs do not respond
*/
/* ESCs do not respond */
#define BOARD_TAP_ESC_MODE 1
#define MEMORY_CONSTRAINED_SYSTEM
@@ -125,42 +104,12 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the PX4FMU board.
*
****************************************************************************************************/
extern void stm32_spiinitialize(void);
#define board_peripheral_reset(ms)
/************************************************************************************
* Name: board_sdio_initialize
*
* Description:
* Called to configure SDIO.
*
************************************************************************************/
extern int board_sdio_initialize(void);
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */
+1
View File
@@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Start Digital power monitors
voxlpm -X -b 3 -k -T VBATT start
-12
View File
@@ -223,18 +223,6 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
/* ModalAI FC-v1 never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* This board provides a DMA pool and APIs */
+1
View File
@@ -49,6 +49,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal ICM-20602
icm20602 -s -b 1 -R 8 start
+1 -7
View File
@@ -113,7 +113,6 @@
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define BOARD_NUMBER_BRICKS 1
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4)
@@ -168,13 +167,8 @@
#define SDIO_SLOTNO 0 /* Only one slot */
#define SDIO_MINOR 0
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
+1
View File
@@ -49,6 +49,7 @@ px4_add_board(
rc_input
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
@@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal ICM-20602
icm20602 -s -b 1 -R 8 start
@@ -90,7 +90,6 @@
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define BOARD_NUMBER_BRICKS 1
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4)
@@ -142,8 +141,6 @@
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
+1
View File
@@ -49,6 +49,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI1
ms5611 -s -b 1 start
+1 -6
View File
@@ -108,15 +108,10 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC
* system_power interface, and therefore provides the true logic
* GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
+1
View File
@@ -46,6 +46,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20608-G
icm20608g -s -R 8 start
+1 -6
View File
@@ -119,15 +119,10 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC
* system_power interface, and therefore provides the true logic
* GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
+1
View File
@@ -46,6 +46,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal Mag I2C bus roll 180, yaw 90
bmm150 -I -R 10 start
+1
View File
@@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET
-15
View File
@@ -275,11 +275,6 @@ __END_DECLS
#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0)
#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10)
/* Power supply control and monitoring GPIOs */
// None
#define GPIO_PERIPH_3V3_EN 0
/* Tone alarm output PTA11 - TMP 2_CH1 is On +P12-4, -P12-5
* It is driving a NPN
@@ -318,17 +313,7 @@ __END_DECLS
#define SPEKTRUM_POWER(on_true) VDD_3V3_SPEKTRUM_POWER_EN((on_true))
/*
* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID))
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
+1
View File
@@ -46,6 +46,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET
@@ -11,4 +11,3 @@ fi
rgbled_pwm start
safety_button start
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal Mag I2C bus roll 180, yaw 90
bmm150 -I -R 10 start
+1
View File
@@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET
+1
View File
@@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET
+4 -46
View File
@@ -39,9 +39,6 @@
#pragma once
/****************************************************************************************************
* Included Files
****************************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
@@ -55,7 +52,6 @@ __BEGIN_DECLS
__END_DECLS
/* FMUK66 GPIOs ***********************************************************************************/
/* LEDs */
/* An RGB LED is connected through GPIO as shown below:
* TBD (no makring on schematic)
@@ -96,9 +92,7 @@ __END_DECLS
#define HRT_TIMER 1 /* TPM1 timer for the HRT */
#define HRT_TIMER_CHANNEL 0 /* Use capture/compare channel 0 */
/* PPM IN
*/
/* PPM IN */
#define HRT_PPM_CHANNEL 1 /* Use TPM1 capture/compare channel 1 */
#define GPIO_PPM_IN PIN_TPM1_CH1_1 /* PTC3 USART1 RX and PTA9 and PIN_TPM1_CH1 AKA FrSky_IN_RC_IN */
@@ -123,7 +117,6 @@ __END_DECLS
* as an input Therefore we drive are UARTx_RX (normaly an input) as an
* output
*/
#define GPIO_PPM_IN_AS_OUT (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN3)
#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT)
@@ -131,7 +124,6 @@ __END_DECLS
#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true))
/* RC input */
#define RC_SERIAL_PORT "/dev/ttyS2" /* UART1 */
#define GPIO_RSSI_IN PIN_ADC1_SE13
@@ -140,7 +132,6 @@ __END_DECLS
* Uninitialized to Reset Disabled and Inhibited
* All pins driven low to not back feed when power is off
*/
#define nGPIO_ETHERNET_P_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN3)
#define GPIO_ENET_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28)
#define GPIO_ENET_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29)
@@ -200,7 +191,6 @@ __END_DECLS
#define GPIO_A_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN25)
/* Sensor interrupts */
#define GPIO_EXTI_GYRO_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN7)
#define GPIO_EXTI_GYRO_INT2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN6)
#define GPIO_EXTI_ACCEL_MAG_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN9)
@@ -218,12 +208,10 @@ __END_DECLS
* Only ADC1 is used
* Bits 31:0 are ADC1 channels 31:0
*/
#define ADC1_CH(c) (((c) & 0x1f)) /* Define ADC number Channel number */
#define ADC1_GPIO(n) PIN_ADC1_SE##n
/* ADC defines to be used in sensors.cpp to read from a particular channel */
#define ADC_USB_VBUS_VALID ADC1_CH(0) /* USB_VBUS_VALID 29 - ADC1_DP0 */
#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(10) /* BAT_VSENS 85 PTB4 ADC1_SE10 */
#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(11) /* BAT_ISENS 86 PTB5 ADC1_SE11 */
@@ -234,7 +222,6 @@ __END_DECLS
#define ADC_AD3 ADC1_CH(23) /* AD3 39 - ADC1_SE23 */
/* Mask use to initialize the ADC driver */
#define ADC_CHANNELS ((1 << ADC_USB_VBUS_VALID) | \
(1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY_CURRENT_CHANNEL) | \
@@ -253,15 +240,9 @@ __END_DECLS
/* PTB6 ADC1_SE12 */ ADC1_GPIO(12), \
/* PTB7 ADC1_SE13 */ ADC1_GPIO(13)
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
/* User GPIOs
*
*/
/* Define Battery 1 Voltage Divider and A per V. */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
/* Timer I/O PWM and capture
*
@@ -279,11 +260,6 @@ __END_DECLS
#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0)
#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10)
/* Power supply control and monitoring GPIOs */
// None
#define GPIO_PERIPH_3V3_EN 0
/* Tone alarm output PTA11 - TMP 2_CH1 is On +P12-4, -P12-5
* It is driving a NPN
@@ -322,17 +298,7 @@ __END_DECLS
#define SPEKTRUM_POWER(on_true) VDD_3V3_SPEKTRUM_POWER_EN((on_true))
/*
* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID))
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
@@ -421,18 +387,10 @@ __END_DECLS
#define BOARD_NUM_IO_TIMERS 3
/************************************************************************************
* Public data
************************************************************************************/
__BEGIN_DECLS
#ifndef __ASSEMBLY__
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: fmuk66_spidev_initialize
*
+1
View File
@@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
#system_power # REVIEW
tap_esc
telemetry # all available telemetry drivers
tone_alarm
@@ -16,6 +16,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20602
icm20602 -R 2 -s start
@@ -265,7 +265,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define OC_INPUT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_HIZ)
@@ -372,18 +371,10 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_USB_CONNECTED (board_read_VBUS_state() == 0)
/* FMUv5 never powers odd the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
+5 -40
View File
@@ -47,12 +47,6 @@
#include <nuttx/compiler.h>
#include <stdint.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* Configuration ************************************************************************************/
/* omnibusf4sd GPIOs ***********************************************************************************/
/* LEDs */
// power - green
// LED1 - PB5 - blue
@@ -63,9 +57,8 @@
#define FLASH_BASED_PARAMS
/*
* ADC channels
*
/**
* ADC channels:
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver
*/
#define ADC_CHANNELS (1 << 0) | (1 << 11) | (1 << 12)
@@ -74,8 +67,7 @@
#define ADC_BATTERY_CURRENT_CHANNEL 11
#define ADC_RC_RSSI_CHANNEL 0
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (11.12f)
#define BOARD_BATTERY1_A_PER_V (31.f)
@@ -108,16 +100,10 @@
//#define GPIO_GPIO4_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM5_CH2OUT)
//#define GPIO_GPIO5_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM1_CH1OUT)
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS PA9 OTG_FS_VBUS VBUS sensing */
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN5)
/* PWM
*
* Alternatively CH3/CH4 could be assigned to UART6_TX/RX
*/
/* PWM Alternatively CH3/CH4 could be assigned to UART6_TX/RX */
#define DIRECT_PWM_OUTPUT_CHANNELS 4
#define DIRECT_INPUT_TIMER_CHANNELS 4
@@ -160,20 +146,8 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
@@ -184,15 +158,6 @@ __BEGIN_DECLS
extern void stm32_spiinitialize(void);
/****************************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to configure USB IO.
*
****************************************************************************************************/
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
+1
View File
@@ -61,6 +61,7 @@ px4_add_board(
pwm_out
px4io
#roboclaw
system_power
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm
+1
View File
@@ -7,6 +7,7 @@ rgbled start -I
rgbled_ncp5623c start -I
board_adc start
system_power start
# Internal I2C bus
hmc5883 -T -I -R 4 start
+2 -7
View File
@@ -108,9 +108,7 @@
#define ADC_5V_RAIL_SENSE 4
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
@@ -148,10 +146,7 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (!px4_arch_gpioread(GPIO_VDD_SERVO_VALID))
+1
View File
@@ -56,6 +56,7 @@ px4_add_board(
pwm_out
px4io
#roboclaw
system_power
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm
+1
View File
@@ -57,6 +57,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -7,6 +7,7 @@ rgbled start -I
rgbled_ncp5623c start -I
board_adc start
system_power start
# Internal I2C bus
hmc5883 -T -I -R 4 start
+1
View File
@@ -55,6 +55,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+2 -7
View File
@@ -108,9 +108,7 @@
#define ADC_5V_RAIL_SENSE 4
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
@@ -148,10 +146,7 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (!px4_arch_gpioread(GPIO_VDD_SERVO_VALID))
+1
View File
@@ -51,6 +51,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -53,6 +53,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# We know there are sketchy boards out there
# as chinese companies produce Pixracers without
+1
View File
@@ -49,6 +49,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+3 -42
View File
@@ -39,20 +39,10 @@
#pragma once
/****************************************************************************************************
* Included Files
****************************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* Configuration ************************************************************************************/
/* PX4FMU GPIOs ***********************************************************************************/
/* LEDs */
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11)
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1)
@@ -98,18 +88,11 @@
#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
/**
* PWM:
*
* Six PWM outputs are configured.
*/
/* PWM: Six PWM outputs are configured */
#define DIRECT_PWM_OUTPUT_CHANNELS 6
#define DIRECT_INPUT_TIMER_CHANNELS 6
/**
* USB OTG FS:
* PA9 OTG_FS_VBUS VBUS sensing.
*/
/* USB OTG FS: PA9 OTG_FS_VBUS VBUS sensing. */
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
/* High-resolution timer */
@@ -120,7 +103,6 @@
#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0)
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2. */
@@ -149,7 +131,6 @@
#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6)
/* Power switch controls */
#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (!_on_true))
/**
@@ -166,17 +147,9 @@
#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */
#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true))
/**
* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_USB_VALID (px4_arch_gpioread(GPIO_VDD_USB_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
@@ -189,25 +162,13 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the PX4FMU board.
* Called to configure SPI chip select GPIO pins for the board.
*
****************************************************************************************************/
+1
View File
@@ -49,6 +49,7 @@ px4_add_board(
rc_input
#roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm
+1
View File
@@ -50,6 +50,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

Some files were not shown because too many files have changed in this diff Show More