spkr.c (8288) | spkr.c (8876) |
---|---|
1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * | 1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * |
7 * $Id: spkr.c,v 1.12 1995/03/16 18:12:05 bde Exp $ | 7 * $Id: spkr.c,v 1.13 1995/05/05 06:15:11 davidg Exp $ |
8 */ 9 10#include "speaker.h" 11 12#if NSPEAKER > 0 13 14#include <sys/param.h> 15#include <sys/systm.h> --- 27 unchanged lines hidden (view full) --- 43 * channel 2, frequency LSB first, square-wave mode and binary encoding. 44 * The encoding is as follows: 45 * 46 * +----------+----------+---------------+-----+ 47 * | 1 0 | 1 1 | 0 1 1 | 0 | 48 * | SC1 SC0 | RW1 RW0 | M2 M1 M0 | BCD | 49 * +----------+----------+---------------+-----+ 50 * Counter Write Mode 3 Binary | 8 */ 9 10#include "speaker.h" 11 12#if NSPEAKER > 0 13 14#include <sys/param.h> 15#include <sys/systm.h> --- 27 unchanged lines hidden (view full) --- 43 * channel 2, frequency LSB first, square-wave mode and binary encoding. 44 * The encoding is as follows: 45 * 46 * +----------+----------+---------------+-----+ 47 * | 1 0 | 1 1 | 0 1 1 | 0 | 48 * | SC1 SC0 | RW1 RW0 | M2 M1 M0 | BCD | 49 * +----------+----------+---------------+-----+ 50 * Counter Write Mode 3 Binary |
51 * Channel 2 LSB first, (Square Wave) Encoding | 51 * Channel 2 LSB first, (Square Wave) Encoding |
52 * MSB second 53 */ 54#define PPI_SPKR 0x03 /* turn these PPI bits on to pass sound */ 55#define PIT_MODE 0xB6 /* set timer mode for sound generation */ 56 57/* | 52 * MSB second 53 */ 54#define PPI_SPKR 0x03 /* turn these PPI bits on to pass sound */ 55#define PIT_MODE 0xB6 /* set timer mode for sound generation */ 56 57/* |
58 * Magic numbers for timer control. | 58 * Magic numbers for timer control. |
59 */ 60#define TIMER_CLK 1193180L /* corresponds to 18.2 MHz tick rate */ 61 62#define SPKRPRI PSOCK 63static char endtone, endrest; 64 65static void tone(thz, ticks) 66/* emit tone of frequency thz for given number of ticks */ --- 487 unchanged lines hidden --- | 59 */ 60#define TIMER_CLK 1193180L /* corresponds to 18.2 MHz tick rate */ 61 62#define SPKRPRI PSOCK 63static char endtone, endrest; 64 65static void tone(thz, ticks) 66/* emit tone of frequency thz for given number of ticks */ --- 487 unchanged lines hidden --- |