diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-10-05 18:01:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-06 12:01:45 +1100 |
| commit | ba8f1454f46537609f65a6abb4bb0e82fecbc2f1 (patch) | |
| tree | 62560891f23ca176360fbd25e20bd949cceba469 /platforms/chibios/drivers/audio_pwm.h | |
| parent | 9f0e74802a9fef5bad5052ef0f54fa2ab533f578 (diff) | |
| download | qmk_firmware-ba8f1454f46537609f65a6abb4bb0e82fecbc2f1.tar.gz qmk_firmware-ba8f1454f46537609f65a6abb4bb0e82fecbc2f1.zip | |
Move Audio drivers from quantum to platform drivers folder (#14308)
* Move Audio drivers from quantum to platform drivers folder
* fix path for audio drivers
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'platforms/chibios/drivers/audio_pwm.h')
| -rw-r--r-- | platforms/chibios/drivers/audio_pwm.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/platforms/chibios/drivers/audio_pwm.h b/platforms/chibios/drivers/audio_pwm.h new file mode 100644 index 000000000..86cab916e --- /dev/null +++ b/platforms/chibios/drivers/audio_pwm.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* Copyright 2020 Jack Humbert | ||
| 2 | * Copyright 2020 JohSchneider | ||
| 3 | * | ||
| 4 | * This program is free software: you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation, either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #if !defined(AUDIO_PWM_DRIVER) | ||
| 20 | // NOTE: Timer2 seems to be used otherwise in QMK, otherwise we could default to A5 (= TIM2_CH1, with PWMD2 and alternate-function(1)) | ||
| 21 | # define AUDIO_PWM_DRIVER PWMD1 | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #if !defined(AUDIO_PWM_CHANNEL) | ||
| 25 | // NOTE: sticking to the STM data-sheet numbering: TIMxCH1 to TIMxCH4 | ||
| 26 | // default: STM32F303CC PA8+TIM1_CH1 -> 1 | ||
| 27 | # define AUDIO_PWM_CHANNEL 1 | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #if !defined(AUDIO_PWM_PAL_MODE) | ||
| 31 | // pin-alternate function: see the data-sheet for which pin needs what AF to connect to TIMx_CHy | ||
| 32 | // default: STM32F303CC PA8+TIM1_CH1 -> 6 | ||
| 33 | # define AUDIO_PWM_PAL_MODE 6 | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #if !defined(AUDIO_STATE_TIMER) | ||
| 37 | // timer used to trigger updates in the audio-system, configured/enabled in chibios mcuconf. | ||
| 38 | // Tim6 is the default for "larger" STMs, smaller ones might not have this one (enabled) and need to switch to a different one (e.g.: STM32F103 has only Tim1-Tim4) | ||
| 39 | # define AUDIO_STATE_TIMER GPTD6 | ||
| 40 | #endif | ||
