feat: H7 support (#5738)
Co-authored-by: Richard Li <richard.li@ces.hk> Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
co-authored by
Richard Li
philmoz
raphaelcoeffic
parent
5a15ffb017
commit
3d25c2a0f8
@@ -173,7 +173,6 @@ class ADCInputParser:
|
||||
if adc_spi:
|
||||
#eprint('## Found SPI ADC')
|
||||
adc = ADC('SPI', adc_spi)
|
||||
adc.gpio = self.hw_defs['ADC_SPI_GPIO']
|
||||
adc.gpio_pin_miso = self.hw_defs['ADC_SPI_GPIO_PIN_MISO']
|
||||
adc.gpio_pin_mosi = self.hw_defs['ADC_SPI_GPIO_PIN_MOSI']
|
||||
adc.gpio_pin_sck = self.hw_defs['ADC_SPI_GPIO_PIN_SCK']
|
||||
|
||||
@@ -131,4 +131,4 @@ def parse_switches(target, hw_defs, adc_parser):
|
||||
switch.type = "FSWITCH"
|
||||
switches.append(switch)
|
||||
|
||||
return switches
|
||||
return switches
|
||||
@@ -90,4 +90,4 @@ def build_key_gpio_port_index(keys):
|
||||
for key in keys:
|
||||
append_to_index(gpios, key["gpio"], key["pin"])
|
||||
|
||||
return gpios
|
||||
return gpios
|
||||
@@ -912,10 +912,33 @@ LEGACY_NAMES = [
|
||||
"lua": "rs",
|
||||
"label": "RS",
|
||||
"short_label": "R",
|
||||
"description": "Right slider"
|
||||
}
|
||||
}
|
||||
}
|
||||
"description": "Right slider",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"targets": {"h747", "h7rs"},
|
||||
"inputs": {
|
||||
"LH": {"yaml": "Rud", "lua": "rud", "description": "Rudder"},
|
||||
"LV": {"yaml": "Ele", "lua": "ele", "description": "Elevator"},
|
||||
"RV": {"yaml": "Thr", "lua": "thr", "description": "Throttle"},
|
||||
"RH": {"yaml": "Ail", "lua": "ail", "description": "Aileron"},
|
||||
"P1": {
|
||||
"yaml": "POT1",
|
||||
"lua": "s1",
|
||||
"label": "S1",
|
||||
"short_label": "1",
|
||||
"description": "Potentiometer 1",
|
||||
},
|
||||
"P2": {
|
||||
"yaml": "POT2",
|
||||
"lua": "s2",
|
||||
"label": "S2",
|
||||
"short_label": "2",
|
||||
"description": "Potentiometer 2",
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// This file has been generated from the target's JSON hardware description
|
||||
//
|
||||
|
||||
#include "stm32_gpio.h"
|
||||
|
||||
static const stm32_adc_input_t _ADC_inputs[] = {
|
||||
{% for input in adc_inputs.inputs %}
|
||||
{
|
||||
@@ -52,9 +54,9 @@ static const stm32_spi_adc_t _ADC_spi[] = {
|
||||
{
|
||||
.spi = {
|
||||
{{ adc.adc }},
|
||||
{{ adc.gpio }},
|
||||
{{ adc.gpio_pin_miso }} | {{ adc.gpio_pin_mosi }} | {{ adc.gpio_pin_sck }},
|
||||
{{ adc.gpio }},
|
||||
{{ adc.gpio_pin_sck }},
|
||||
{{ adc.gpio_pin_miso }},
|
||||
{{ adc.gpio_pin_mosi }},
|
||||
{{ adc.gpio_pin_cs }},
|
||||
},
|
||||
_ADC_{{ adc.name }}_channels,
|
||||
|
||||
@@ -84,4 +84,4 @@ const switch_display_pos_t _switch_display[] = {
|
||||
{ 0, 0 },
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user