Sync edgetx to Gitea

This commit is contained in:
2026-08-03 16:37:20 +08:00
commit 14eb5a3fb9
5364 changed files with 2835009 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
//
// WARNING: DO NOT EDIT THIS FILE
// This file has been generated from the target's JSON hardware description
//
{% set hw_keys = keys | rejectattr('pin', 'none') | rejectattr('gpio', 'none') | list %}
static inline void _init_keys()
{
{% for key_gpio, pins in key_gpios | dictsort %}
{% if key_gpio %}
stm32_gpio_enable_clock({{ key_gpio }});
{% endif %}
{% endfor %}
LL_GPIO_InitTypeDef pinInit;
LL_GPIO_StructInit(&pinInit);
pinInit.Mode = LL_GPIO_MODE_INPUT;
{% for key in hw_keys %}
pinInit.Pin = {{ key.pin }};
pinInit.Pull = {{ 'LL_GPIO_PULL_UP' if key.active_low else 'LL_GPIO_PULL_DOWN' }};
LL_GPIO_Init({{ key.gpio }}, &pinInit);
{% endfor %}
}
static inline uint32_t _read_keys()
{
uint32_t keys = 0;
{% for key in hw_keys %}
if ({{'!' if key.active_low }}LL_GPIO_IsInputPinSet({{ key.gpio }}, {{ key.pin }}))
keys |= (1 << {{ key.key }});
{% endfor %}
return keys;
}
{% set hw_trims = trims | selectattr('dec', 'defined') | selectattr('inc', 'defined') | list %}
static inline void _init_trims()
{
{% for trim_gpio, pins in trim_gpios | dictsort %}
stm32_gpio_enable_clock({{ trim_gpio }});
{% endfor %}
LL_GPIO_InitTypeDef pinInit;
LL_GPIO_StructInit(&pinInit);
pinInit.Mode = LL_GPIO_MODE_INPUT;
{% for trim in hw_trims %}
pinInit.Pin = {{ trim.dec.pin }};
pinInit.Pull = {{ 'LL_GPIO_PULL_UP' if trim.dec.active_low else 'LL_GPIO_PULL_DOWN' }};
LL_GPIO_Init({{ trim.dec.gpio }}, &pinInit);
pinInit.Pin = {{ trim.inc.pin }};
pinInit.Pull = {{ 'LL_GPIO_PULL_UP' if trim.inc.active_low else 'LL_GPIO_PULL_DOWN' }};
LL_GPIO_Init({{ trim.inc.gpio }}, &pinInit);
{% endfor %}
}
static inline uint32_t _read_trims()
{
uint32_t trims = 0;
{% for trim in hw_trims %}
if ({{'!' if trim.dec.active_low }}LL_GPIO_IsInputPinSet({{ trim.dec.gpio }}, {{ trim.dec.pin }}))
trims |= (1 << {{ loop.index0 * 2 }});
if ({{'!' if trim.inc.active_low }}LL_GPIO_IsInputPinSet({{ trim.inc.gpio }}, {{ trim.inc.pin }}))
trims |= (1 << {{ loop.index0 * 2 + 1 }});
{% endfor %}
return trims;
}