 |
PicoVGA
1.0-cmake
VGA/TV display on Raspberry Pico
|
Go to the documentation of this file.
11 #define PWMSND_GPIO 19 // PWM output GPIO pin (0..29)
12 #define PWMSND_SLICE ((PWMSND_GPIO>>1)&7) // PWM slice index (=1)
13 #define PWMSND_CHAN (PWMSND_GPIO&1) // PWM channel index (=1)
15 #define SOUNDRATE 22050 // sound rate [Hz]
16 #define PWMSND_TOP 255 // PRM top (period = PWMSND_TOP + 1 = 256)
17 #define PWMSND_CLOCK (SOUNDRATE*(PWMSND_TOP+1)) // PWM clock (= 22050*256 = 5644800)
19 #define SNDFRAC 10 // number of fraction bits
20 #define SNDINT (1<<SNDFRAC) // integer part of sound fraction
23 extern const u8* CurSound;
24 extern volatile int SoundCnt;
26 extern volatile int SoundAcc;
27 extern const u8* NextSound;
28 extern int NextSoundCnt;
62 void PlaySound(
const u8* snd,
int len, Bool rep = False,
float speed = 1.0f);
Bool PlayingSound()
Check if playing sound.
Definition: pwmsnd.cpp:138
void SetNextSound(const u8 *snd, int len)
Set the next sound to play.
Definition: pwmsnd.cpp:144
void SpeedSound(float speed)
Update sound speed.
Definition: pwmsnd.cpp:132
void PlaySound(const u8 *snd, int len, Bool rep=False, float speed=1.0f)
Output PWM sound.
Definition: pwmsnd.cpp:97
void StopSound()
stop playing sound
Definition: pwmsnd.cpp:124
void PWMSndInit()
Initialize PWM sound output.
Definition: pwmsnd.cpp:65