Files
edgetx-gx12/radio/util/hw_defs/pot_config.py
T
c4f1e7127d chores(flysky): Separate AFHDS2A and AFHDS3 into 2 different module type (#3783)
* chores(flysky): separate AFHDS2A and AFHDS3 into 2 different module type

This should allow to remove some of the hacks added earlier.

* chore: Add some EL18 CI bits

* fix(afhds): cmake defs

* fix(ci): add el18 to commit-tests.sh

* chore(cpn): separate AFHDS2A and AFHDS3

* chore(cpn): remove binary import of afhds and legacy fxFreq field for afhds3

* fix(cpn): limit available internal afhds protocols to those supported by hardware

* chore(cpn): update Flysky int module test

* fix(cpn): compile error

* fix(cpn): afhds2a max channels

* fix: TR_MODULE_PROTOCOLS

* enh(cpn): more support for afhds2a and 3

* fix(cpn): rebase compile error

* fix(cpn): bit indexes

* fix(cpn): emi toString

* fix(cpn): limit available internal afhds protocols to those supported by hardware

* enh(cpn): add support for Flysky EL18

* fix(cpn): available protocols

* fix(cpn): rebase moduledata

* chore(cpn): add module fields to model print

* Separate AFHDS2A and AFHDS3 UI settings.

* Fix AFHDS3 conversion from old subtype value.
Fix 'Channel Range' layout on portrait LCD.

* Fix name.

---------

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
2023-09-07 19:24:03 +10:00

170 lines
5.1 KiB
Python

"""Default configuration of pots and sliders for each target."""
POT_CONFIG = {
"boxer": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"},
"P3": {"default": "MULTIPOS_SWITCH"}
},
"el18": {
"P1": { "default": "WITHOUT_DETENT"},
"P2": { "default": "WITHOUT_DETENT"}
},
"nv14": {
"P1": { "default": "WITHOUT_DETENT"},
"P2": { "default": "WITHOUT_DETENT"}
},
"tpro": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"}
},
"tprov2": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"}
},
"t20": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"},
"SL3": {"default": "SLIDER_WITH_DETENT"},
"SL4": {"default": "SLIDER_WITH_DETENT"},
},
"t12": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "WITHOUT_DETENT"}
},
"tx12": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"}
},
"tx12mk2": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"}
},
"t16": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "MULTIPOS_SWITCH"},
"P3": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"t18": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "MULTIPOS_SWITCH"},
"P3": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"tx16s": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "MULTIPOS_SWITCH"},
"P3": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"x7": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "WITH_DETENT"}
},
"x7access": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "WITH_DETENT"}
},
"x9d": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"x9dp": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"x9dp2019": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"x9e": {
"P1": {"default": "WITH_DETENT"},
"P2": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"},
"SL3": {"default": "SLIDER_WITH_DETENT"},
"SL4": {"default": "SLIDER_WITH_DETENT"}
},
"x10": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "MULTIPOS_SWITCH"},
"P3": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"x10express": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "MULTIPOS_SWITCH"},
"P3": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"}
},
"x12s": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "MULTIPOS_SWITCH"},
"P3": {"default": "WITH_DETENT"},
"SL1": {"default": "SLIDER_WITH_DETENT"},
"SL2": {"default": "SLIDER_WITH_DETENT"},
"SL3": {"default": "SLIDER_WITH_DETENT"},
"SL4": {"default": "SLIDER_WITH_DETENT"}
},
"xlite": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "WITHOUT_DETENT"}
},
"xlites": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "WITHOUT_DETENT"}
},
"x9lite": {
"P1": {"default": "WITH_DETENT"},
},
"x9lites": {
"P1": {"default": "WITH_DETENT"},
},
"zorro": {
"P1": {"default": "WITHOUT_DETENT"},
"P2": {"default": "WITHOUT_DETENT"}
},
"pocket": {
"P1": { "default": "WITHOUT_DETENT" }
},
}
def pot_cfg_by_target(target, name):
"""Retrieve default pot config.
Parameters
----------
target: str
Name of the target
name: str
Canonical name of the pot (Px where 'x' is a number)
or slider (SLx where 'x' is a number)
Returns
-------
dict
a dictionary with one key for each pot or slider that mapped
to another dictionary with a single attribute ("default") containing
the default configuration for a pot or slider
"""
sw = POT_CONFIG.get(target)
if sw:
return sw.get(name)
return None