CS7000P: enabled audio management system
This commit is contained in:
parent
891f18cac7
commit
8625184030
|
|
@ -286,6 +286,8 @@ stm32h743_src = ['platform/mcu/STM32H7xx/boot/startup.cpp',
|
||||||
'platform/drivers/GPIO/gpio_stm32.c',
|
'platform/drivers/GPIO/gpio_stm32.c',
|
||||||
'platform/drivers/ADC/adc_stm32h7.c',
|
'platform/drivers/ADC/adc_stm32h7.c',
|
||||||
'platform/drivers/SPI/spi_stm32h7.c',
|
'platform/drivers/SPI/spi_stm32h7.c',
|
||||||
|
'platform/drivers/audio/stm32_dac.cpp',
|
||||||
|
'platform/drivers/audio/stm32_adc.cpp',
|
||||||
'platform/mcu/CMSIS/Device/ST/STM32H7xx/Source/system_stm32h7xx.c']
|
'platform/mcu/CMSIS/Device/ST/STM32H7xx/Source/system_stm32h7xx.c']
|
||||||
|
|
||||||
stm32h743_inc = ['platform/mcu/CMSIS/Include',
|
stm32h743_inc = ['platform/mcu/CMSIS/Include',
|
||||||
|
|
@ -517,9 +519,13 @@ cs7000_def += openrtx_def + stm32f405_def
|
||||||
cs7000p_src = ['platform/drivers/NVM/nvmem_CS7000.c',
|
cs7000p_src = ['platform/drivers/NVM/nvmem_CS7000.c',
|
||||||
'platform/drivers/NVM/W25Qx.c',
|
'platform/drivers/NVM/W25Qx.c',
|
||||||
'platform/drivers/NVM/eeep.c',
|
'platform/drivers/NVM/eeep.c',
|
||||||
|
'platform/drivers/baseband/HR_C6000.cpp',
|
||||||
|
'platform/drivers/baseband/HR_Cx000.cpp',
|
||||||
|
'platform/drivers/baseband/HR_C6000_CS7000.cpp',
|
||||||
|
'platform/drivers/audio/Cx000_dac.cpp',
|
||||||
|
'platform/drivers/audio/audio_CS7000.cpp',
|
||||||
'platform/drivers/stubs/cps_io_stub.c',
|
'platform/drivers/stubs/cps_io_stub.c',
|
||||||
'platform/drivers/stubs/radio_stub.c',
|
'platform/drivers/stubs/radio_stub.c',
|
||||||
'platform/drivers/stubs/audio_stub.c',
|
|
||||||
'platform/drivers/stubs/radio_stub.c',
|
'platform/drivers/stubs/radio_stub.c',
|
||||||
'platform/drivers/display/ST7735R_CS7000.c',
|
'platform/drivers/display/ST7735R_CS7000.c',
|
||||||
'platform/drivers/keyboard/keyboard_CS7000.c',
|
'platform/drivers/keyboard/keyboard_CS7000.c',
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ const struct audioDevice inputDevices[] =
|
||||||
{&stm32_adc_audio_driver, (const void *) ADC_MIC_CH, STM32_ADC_ADC2, SOURCE_MIC},
|
{&stm32_adc_audio_driver, (const void *) ADC_MIC_CH, STM32_ADC_ADC2, SOURCE_MIC},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HR_C6000 C6000((const struct spiDevice *) &c6000_spi, { C6K_CS });
|
||||||
static bool spkEnabled = false;
|
static bool spkEnabled = false;
|
||||||
|
|
||||||
static inline void selectSpk()
|
static inline void selectSpk()
|
||||||
|
|
@ -106,10 +107,12 @@ void audio_init()
|
||||||
gpioDev_clear(INT_MIC_SEL);
|
gpioDev_clear(INT_MIC_SEL);
|
||||||
gpioDev_clear(EXT_MIC_SEL);
|
gpioDev_clear(EXT_MIC_SEL);
|
||||||
|
|
||||||
|
gpioDev_set(RX_PWR_EN);
|
||||||
gpioDev_clear(C6K_SLEEP);
|
gpioDev_clear(C6K_SLEEP);
|
||||||
delayMs(10);
|
delayMs(10);
|
||||||
spiStm32_init(&c6000_spi, 11000000, SPI_FLAG_CPHA);
|
spiStm32_init(&c6000_spi, 12500000, SPI_FLAG_CPHA);
|
||||||
C6000.init();
|
C6000.init();
|
||||||
|
C6000.fmMode();
|
||||||
|
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,6 @@ static streamCtx ctcssCtx;
|
||||||
static int16_t *prevCtcssBuf;
|
static int16_t *prevCtcssBuf;
|
||||||
static CtcssDetector ctcss(ctcssCoeffs2k, (CTCSS_SAMPLE_RATE / 4), 20.0f);
|
static CtcssDetector ctcss(ctcssCoeffs2k, (CTCSS_SAMPLE_RATE / 4), 20.0f);
|
||||||
|
|
||||||
HR_C6000 C6000((const struct spiDevice *) &c6000_spi, { C6K_CS });
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parameters for RSSI voltage (mV) to input power (dBm) conversion.
|
* Parameters for RSSI voltage (mV) to input power (dBm) conversion.
|
||||||
* Measurements have been taked in the RX calibration points with input signal
|
* Measurements have been taked in the RX calibration points with input signal
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,10 @@ static uint8_t spiSr_func(const void *priv, uint8_t value)
|
||||||
|
|
||||||
static const struct gpioPin shiftRegStrobe = { GPIOEXT_STR };
|
static const struct gpioPin shiftRegStrobe = { GPIOEXT_STR };
|
||||||
static pthread_mutex_t adc1Mutex;
|
static pthread_mutex_t adc1Mutex;
|
||||||
|
static pthread_mutex_t c6000_mutex;
|
||||||
|
|
||||||
SPI_CUSTOM_DEVICE_DEFINE(spiSr, spiSr_func, NULL, NULL)
|
SPI_CUSTOM_DEVICE_DEFINE(spiSr, spiSr_func, NULL, NULL)
|
||||||
SPI_STM32_DEVICE_DEFINE(flash_spi, SPI4, NULL)
|
SPI_STM32_DEVICE_DEFINE(flash_spi, SPI4, NULL)
|
||||||
|
SPI_STM32_DEVICE_DEFINE(c6000_spi, SPI2, &c6000_mutex)
|
||||||
GPIO_SHIFTREG_DEVICE_DEFINE(extGpio, (const struct spiDevice *) &spiSr, shiftRegStrobe, 24)
|
GPIO_SHIFTREG_DEVICE_DEFINE(extGpio, (const struct spiDevice *) &spiSr, shiftRegStrobe, 24)
|
||||||
ADC_STM32_DEVICE_DEFINE(adc1, ADC1, &adc1Mutex, ADC_COUNTS_TO_UV(3300000, 16))
|
ADC_STM32_DEVICE_DEFINE(adc1, ADC1, &adc1Mutex, ADC_COUNTS_TO_UV(3300000, 16))
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ enum AdcChannels
|
||||||
extern const struct Adc adc1;
|
extern const struct Adc adc1;
|
||||||
extern const struct spiCustomDevice spiSr;
|
extern const struct spiCustomDevice spiSr;
|
||||||
extern const struct spiDevice flash_spi;
|
extern const struct spiDevice flash_spi;
|
||||||
|
extern const struct spiDevice c6000_spi;
|
||||||
extern const struct gpioDev extGpio;
|
extern const struct gpioDev extGpio;
|
||||||
extern const struct ak2365a detector;
|
extern const struct ak2365a detector;
|
||||||
extern const struct sky73210 pll;
|
extern const struct sky73210 pll;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include <gpio_shiftReg.h>
|
#include <gpio_shiftReg.h>
|
||||||
#include <spi_bitbang.h>
|
#include <spi_bitbang.h>
|
||||||
#include <adc_stm32.h>
|
#include <adc_stm32.h>
|
||||||
|
#include <Cx000_dac.h>
|
||||||
#include <hwconfig.h>
|
#include <hwconfig.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
@ -193,12 +194,12 @@ void platform_ledOff(led_t led)
|
||||||
|
|
||||||
void platform_beepStart(uint16_t freq)
|
void platform_beepStart(uint16_t freq)
|
||||||
{
|
{
|
||||||
(void) freq;
|
Cx000dac_startBeep(freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_beepStop()
|
void platform_beepStop()
|
||||||
{
|
{
|
||||||
|
Cx000dac_stopBeep();
|
||||||
}
|
}
|
||||||
|
|
||||||
const hwInfo_t *platform_getHwInfo()
|
const hwInfo_t *platform_getHwInfo()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue