PicoVGA  1.0-cmake
VGA/TV display on Raspberry Pico
pwmsnd.h File Reference

File Description

PWM sound output.

Author
Miroslav Nemecek Panda.nosp@m.38@s.nosp@m.eznam.nosp@m..cz
See also
PWM Audio
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PWMSND_GPIO   19
 
#define PWMSND_SLICE   ((PWMSND_GPIO>>1)&7)
 
#define PWMSND_CHAN   (PWMSND_GPIO&1)
 
#define SOUNDRATE   22050
 
#define PWMSND_TOP   255
 
#define PWMSND_CLOCK   (SOUNDRATE*(PWMSND_TOP+1))
 
#define SNDFRAC   10
 
#define SNDINT   (1<<SNDFRAC)
 

Functions

void PWMSndInit ()
 Initialize PWM sound output. More...
 
void PlaySound (const u8 *snd, int len, Bool rep=False, float speed=1.0f)
 Output PWM sound. More...
 
void StopSound ()
 stop playing sound More...
 
void SpeedSound (float speed)
 Update sound speed. More...
 
Bool PlayingSound ()
 Check if playing sound.
 
void SetNextSound (const u8 *snd, int len)
 Set the next sound to play. More...
 

Variables

const u8 * CurSound
 
volatile int SoundCnt
 
int SoundInc
 
volatile int SoundAcc
 
const u8 * NextSound
 
int NextSoundCnt