This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: buzzer on PC
- From: davidw at dedasys dot com (David N. Welton)
- To: Piotr Trojanek <ptroja at elproma dot com dot pl>
- Cc: ecos-discuss <ecos-discuss at sources dot redhat dot com>
- Date: 08 Sep 2003 17:38:57 +0200
- Subject: Re: [ECOS] buzzer on PC
- References: <20030908133829.GA2199@elproma.com.pl>
Piotr Trojanek <ptroja@elproma.com.pl> writes:
> how to 'beep' on PC buzzer from ecos?
Oh, I know this one!
countdown = 1193180 / speaker_frequency;
set_speaker(int countdown)
{
char snd = 0;
/* Init speaker. */
HAL_WRITE_UINT8(0x43, 0xb6);
HAL_WRITE_UINT8(0x42, countdown & 0xff);
HAL_WRITE_UINT8(0x42, countdown >> 8);
HAL_READ_UINT8(0x61, snd);
snd |= 3;
HAL_WRITE_UINT8(0x61, snd);
}
Something like that ought to work.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss