search for: speaker_pit_frequ

Displaying 1 result from an estimated 1 matches for "speaker_pit_frequ".

2020 Jan 22
0
[PATCH] com32/modules: introduce play module
...00000..68741bf5 --- /dev/null +++ b/com32/modules/play.c @@ -0,0 +1,95 @@ +/* + * Plays a tune through the PC speaker. + * + * This file is based loosely on similar GRUB2 code. + */ +#include <stdlib.h> +#include <stdio.h> +#include <sys/io.h> +#include <unistd.h> + +#define SPEAKER_PIT_FREQUENCY 0x1234dd +#define BASE_TEMPO (60 * 1000) +#define T_REST 0 + +#define PIT_COUNTER_2 0x42 +#define PIT_CTRL 0x43 +#define PIT_SPEAKER_PORT 0x61 + +#define PIT_SPK_TMR2 0x01 +#define PIT_SPK_DATA 0x02 +#define PIT_SPK_TMR2_LATCH 0x20 +#define PIT_CTRL_SELECT_2 0x80 +#define PIT_CTRL_READLOAD_WORD...