feat(v16): add CI1302 voice control (VGR/VFL, motion control, menu navigation) (#7501)
Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Peter Feerick
Claude Sonnet 5
parent
f364c6ef63
commit
4aa9a258ee
@@ -116,6 +116,7 @@ if (PCB STREQUAL X10)
|
||||
set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches")
|
||||
set(AUX2_SERIAL OFF)
|
||||
set(CSD203_SENSOR ON)
|
||||
set(CI1302_SENSOR ON)
|
||||
set(FLYSKY_GIMBAL ON)
|
||||
add_definitions(-DIMU_ICM42627)
|
||||
add_definitions(-DIMU_SC7U22)
|
||||
@@ -350,6 +351,14 @@ if (MULTIMODULE)
|
||||
add_definitions(-DMULTI_PROTOLIST)
|
||||
endif()
|
||||
|
||||
if(CI1302_SENSOR)
|
||||
# Via SRC (not target_sources(board ...)), same as io/frsky_firmware_update.cpp
|
||||
# below: made available to SIMU/WASM builds, not just firmware. Live-sensor
|
||||
# call sites are SIMU-guarded individually.
|
||||
set(SRC ${SRC} drivers/CI1302.cpp)
|
||||
add_definitions(-DVOICE_CONTROL_SENSOR)
|
||||
endif()
|
||||
|
||||
set(SRC ${SRC}
|
||||
io/frsky_firmware_update.cpp
|
||||
io/multi_firmware_update.cpp
|
||||
|
||||
@@ -115,6 +115,10 @@ void boardBLInit()
|
||||
#if !defined(BOOT)
|
||||
#include "edgetx.h"
|
||||
|
||||
#if defined(VOICE_CONTROL_SENSOR)
|
||||
#include "drivers/CI1302.h"
|
||||
#endif
|
||||
|
||||
#if defined(PCBX12S)
|
||||
static void audio_set_rst_pin(bool set)
|
||||
{
|
||||
@@ -239,6 +243,10 @@ void boardInit()
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
|
||||
#endif
|
||||
|
||||
#if defined(VOICE_CONTROL_SENSOR)
|
||||
voiceControlInit();
|
||||
#endif
|
||||
|
||||
#if defined(VIDEO_SWITCH)
|
||||
videoSwitchInit();
|
||||
#endif
|
||||
|
||||
@@ -485,6 +485,20 @@
|
||||
#define FLYSKY_HALL_DMA_Stream_TX LL_DMA_STREAM_4
|
||||
#endif
|
||||
|
||||
#if defined(VOICE_CONTROL_SENSOR)
|
||||
#if defined(RADIO_V16)
|
||||
#define VOICE_CTRL_BAUD 115200
|
||||
#define VOICE_CONTROL_USART UART7
|
||||
#define VOICE_CONTROL_USART_IRQn UART7_IRQn
|
||||
#define VOICE_CONTROL_GPIO GPIOF
|
||||
#define VOICE_CONTROL_TX_GPIO GPIO_PIN(GPIOF, 7) // PF.7
|
||||
#define VOICE_CONTROL_RX_GPIO GPIO_PIN(GPIOF, 6) // PF.6
|
||||
#define VOICE_CONTROL_PWR_GPIO GPIO_PIN(GPIOH, 13) // PH.13 1=ON, 0=OFF
|
||||
#else
|
||||
#error VOICE_CONTROL_SENSOR is only supported on RADIO_V16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Internal Module
|
||||
#define INTMODULE_PWR_GPIO GPIO_PIN(GPIOA, 8) // PA.08
|
||||
#define INTMODULE_TX_GPIO GPIO_PIN(GPIOB, 6) // PB.06
|
||||
|
||||
@@ -40,7 +40,13 @@ uint16_t getLuxSensorValue()
|
||||
|
||||
uint16_t getBatteryVoltage()
|
||||
{
|
||||
if (adcGetMaxInputs(ADC_INPUT_VBAT) < 1) return 0;
|
||||
if (adcGetMaxInputs(ADC_INPUT_VBAT) < 1) {
|
||||
// Battery is not an ADC input on this board (e.g. read from an I2C
|
||||
// sensor on hardware), so report the same default as simu_start_conversion
|
||||
uint16_t vBatWarn = BATTERY_WARN;
|
||||
if (g_eeGeneral.vBatWarn > 0) vBatWarn = g_eeGeneral.vBatWarn;
|
||||
return (vBatWarn + 5) * 10;
|
||||
}
|
||||
return anaIn(adcGetInputOffset(ADC_INPUT_VBAT));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user