|
|
@@ -11,6 +11,24 @@ void dtmf_dolphin_speaker_init() {
|
|
|
TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_ENABLE;
|
|
|
TIM_OC_InitStruct.CompareValue = 127;
|
|
|
LL_TIM_OC_Init(FURI_HAL_SPEAKER_TIMER, FURI_HAL_SPEAKER_CHANNEL, &TIM_OC_InitStruct);
|
|
|
+
|
|
|
+ // Enable GPIO output
|
|
|
+ // Enable bus
|
|
|
+ furi_hal_bus_enable(FuriHalBusTIM2);
|
|
|
+
|
|
|
+ //configuring PA6 pin as TIM16 output
|
|
|
+ furi_hal_gpio_init_ex(
|
|
|
+ &gpio_ext_pa6,
|
|
|
+ GpioModeAltFunctionPushPull,
|
|
|
+ GpioPullNo,
|
|
|
+ GpioSpeedVeryHigh,
|
|
|
+ GpioAltFn14TIM16);
|
|
|
+}
|
|
|
+
|
|
|
+void dtmf_dolphin_gpio_deinit() {
|
|
|
+ // Disable GPIO output
|
|
|
+ furi_hal_gpio_init(&gpio_ext_pa6, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
|
|
+ furi_hal_bus_disable(FuriHalBusTIM2);
|
|
|
}
|
|
|
|
|
|
void dtmf_dolphin_speaker_start() {
|
|
|
@@ -24,7 +42,7 @@ void dtmf_dolphin_speaker_stop() {
|
|
|
}
|
|
|
|
|
|
void dtmf_dolphin_dma_init(uint32_t address, size_t size) {
|
|
|
- uint32_t dma_dst = (uint32_t) & (FURI_HAL_SPEAKER_TIMER->CCR1);
|
|
|
+ uint32_t dma_dst = (uint32_t)&(FURI_HAL_SPEAKER_TIMER->CCR1);
|
|
|
|
|
|
LL_DMA_ConfigAddresses(DMA_INSTANCE, address, dma_dst, LL_DMA_DIRECTION_MEMORY_TO_PERIPH);
|
|
|
LL_DMA_SetDataLength(DMA_INSTANCE, size);
|