DM-1701: audio driver

This commit is contained in:
Silvano Seva 2025-03-29 18:56:43 +01:00
parent e469c856cc
commit b5a20719b0
1 changed files with 6 additions and 6 deletions

View File

@ -30,7 +30,7 @@
#include "stm32_pwm.h" #include "stm32_pwm.h"
#include "stm32_adc.h" #include "stm32_adc.h"
#ifdef PLATFORM_MDUV3x0 #if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701)
#include <HR_C6000.h> #include <HR_C6000.h>
#include "Cx000_dac.h" #include "Cx000_dac.h"
#endif #endif
@ -73,7 +73,7 @@ static const struct PwmChannelCfg stm32pwm_cfg =
stm32pwm_stopCbk stm32pwm_stopCbk
}; };
#ifdef PLATFORM_MDUV3x0 #if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701)
static void *audio_thread(void *arg) static void *audio_thread(void *arg)
{ {
(void) arg; (void) arg;
@ -109,7 +109,7 @@ static void *audio_thread(void *arg)
const struct audioDevice outputDevices[] = const struct audioDevice outputDevices[] =
{ {
{NULL, NULL, 0, SINK_MCU}, {NULL, NULL, 0, SINK_MCU},
#ifdef PLATFORM_MDUV3x0 #if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701)
{&Cx000_dac_audio_driver, NULL, 0, SINK_SPK}, {&Cx000_dac_audio_driver, NULL, 0, SINK_SPK},
#else #else
{&stm32_pwm_audio_driver, &stm32pwm_cfg, 0, SINK_SPK}, {&stm32_pwm_audio_driver, &stm32pwm_cfg, 0, SINK_SPK},
@ -149,7 +149,7 @@ void audio_init()
stm32pwm_init(); stm32pwm_init();
stm32adc_init(STM32_ADC_ADC2); stm32adc_init(STM32_ADC_ADC2);
#ifdef PLATFORM_MDUV3x0 #if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701)
gpio_setMode(DMR_CLK, OUTPUT); gpio_setMode(DMR_CLK, OUTPUT);
gpio_setMode(DMR_MOSI, OUTPUT); gpio_setMode(DMR_MOSI, OUTPUT);
gpio_setMode(DMR_MISO, INPUT); gpio_setMode(DMR_MISO, INPUT);
@ -203,7 +203,7 @@ void audio_connect(const enum AudioSource source, const enum AudioSink sink)
// MD-UV380 uses HR_C6000 for MCU->SPK audio output. Switching between // MD-UV380 uses HR_C6000 for MCU->SPK audio output. Switching between
// incoming FM audio and DAC output is done automatically inside the IC. // incoming FM audio and DAC output is done automatically inside the IC.
#ifndef PLATFORM_MDUV3x0 #if !defined(PLATFORM_MDUV3x0) && !defined(PLATFORM_DM1701)
case PATH(SOURCE_MCU, SINK_SPK): case PATH(SOURCE_MCU, SINK_SPK):
#endif #endif
case PATH(SOURCE_MCU, SINK_RTX): case PATH(SOURCE_MCU, SINK_RTX):
@ -251,7 +251,7 @@ void audio_disconnect(const enum AudioSource source, const enum AudioSink sink)
radio_disableAfOutput(); radio_disableAfOutput();
break; break;
#ifndef PLATFORM_MDUV3x0 #if !defined(PLATFORM_MDUV3x0) && !defined(PLATFORM_DM1701)
case PATH(SOURCE_MCU, SINK_SPK): case PATH(SOURCE_MCU, SINK_SPK):
#endif #endif
case PATH(SOURCE_MCU, SINK_RTX): case PATH(SOURCE_MCU, SINK_RTX):