This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: buzzer on PC
- From: Piotr Trojanek <ptroja at elproma dot com dot pl>
- To: "David N. Welton" <davidw at dedasys dot com>,ecos-discuss <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 10 Sep 2003 15:29:40 +0200
- Subject: Re: [ECOS] buzzer on PC
- References: <20030908133829.GA2199@elproma.com.pl> <87y8wz47e6.fsf@dedasys.com>
On Mon, Sep 08, 2003 at 05:38:57PM +0200, David N. Welton wrote:
> 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.
works great:), thanks!
--
Piotr Trojanek
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss