Mozzi  version v1.1.0
sound synthesis library for Arduino
AudioConfigSTM32.h
1 #ifndef AUDIOCONFIGSTM32_H
2 #define AUDIOCONFIGSTM32_H
3 
4 #if not IS_STM32()
5 #error This header should be included for STM32, only
6 #endif
7 
8 // Audio output pin. If you want to change this, make sure to also set AUDIO_PWM_TIMER to whichever timer is responsible for your PWM pin, and set the other timers to non-conflicting values
9 #define AUDIO_CHANNEL_1_PIN PB8
10 #define AUDIO_PWM_TIMER 4
11 // The timer used for running the audio update loop. NOTE: Timer 3 appears to clash with SPI DMA transfers under some circumstances
12 #define AUDIO_UPDATE_TIMER 2
13 
14 #if (AUDIO_MODE == HIFI)
15 // Second out pin for HIFI mode. This must be on the same timer as AUDIO_CHANNEL_1_PIN!
16 // Note that by default we are not using adjacent pins. This is to leave the "Serial1" pins available (often used for upload/communication with Arduino IDE). If you don't need that, PA9 is a good choice.
17 #define AUDIO_CHANNEL_1_PIN_HIGH PB9
18 // Total audio bits.
19 #define AUDIO_BITS 14
20 #define AUDIO_BITS_PER_CHANNEL 7
21 #else
22 // The more audio bits you use, the slower the carrier frequency of the PWM signal. 10 bits yields ~ 70kHz on a 72Mhz CPU (which appears to be a reasonable compromise)
23 #define AUDIO_BITS 10
24 #define AUDIO_BITS_PER_CHANNEL AUDIO_BITS
25 #if (AUDIO_CHANNELS > 1)
26 #define AUDIO_CHANNEL_2_PIN PB9
27 #endif
28 #endif
29 
30 #define AUDIO_BIAS ((uint16_t) 1<<(AUDIO_BITS-1))
31 
32 #endif // #ifndef AUDIOCONFIGSTM32_H
#define AUDIO_BITS
Definition: MozziGuts.h:228