/* $NetBSD: essreg.h,v 1.18 2024/02/09 22:08:35 andvar Exp $ */
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
** @(#) $RCSfile: essreg.h,v $ $Revision: 1.18 $ (SHARK) $Date: 2024/02/09 22:08:35 $
**
**++
**
** essreg.h
**
** FACILITY:
**
** DIGITAL Network Appliance Reference Design (DNARD)
**
** MODULE DESCRIPTION:
**
** This module contains the constant definitions for the device
** registers on the ESS Technologies 1888/1887/888 sound chip.
**
** AUTHORS:
**
** Blair Fidler Software Engineering Australia
** Gold Coast, Australia.
**
** CREATION DATE:
**
** March 10, 1997.
**
** MODIFICATION HISTORY:
**
**--
*/
/*
* DSP commands. This unit handles MIDI and audio capabilities.
* The DSP can be reset, data/commands can be read or written to it,
* and it can generate interrupts. Interrupts are generated for MIDI
* input or DMA completion. They seem to have neglected the fact
* that it would be nice to have a MIDI transmission complete interrupt.
* Worse, the DMA engine is half-duplex. This means you need to do
* (timed) programmed I/O to be able to record and play simultaneously.
*/
#define ESS_ACMD_DAC8WRITE 0x10 /* direct-mode 8-bit DAC write */
#define ESS_ACMD_DAC16WRITE 0x11 /* direct-mode 16-bit DAC write */
#define ESS_ACMD_DMA8OUT 0x14 /* 8-bit linear DMA output */
#define ESS_ACMD_DMA16OUT 0x15 /* 16-bit linear DMA output */
#define ESS_ACMD_AUTODMA8OUT 0x1C /* auto-init 8-bit linear DMA output */
#define ESS_ACMD_AUTODMA16OUT 0x1D /* auto-init 16-bit linear DMA output */
#define ESS_ACMD_ADC8READ 0x20 /* direct-mode 8-bit ADC read */
#define ESS_ACMD_ADC16READ 0x21 /* direct-mode 16-bit ADC read */
#define ESS_ACMD_DMA8IN 0x24 /* 8-bit linear DMA input */
#define ESS_ACMD_DMA16IN 0x25 /* 16-bit linear DMA input */
#define ESS_ACMD_AUTODMA8IN 0x2C /* auto-init 8-bit linear DMA input */
#define ESS_ACMD_AUTODMA16IN 0x2D /* auto-init 16-bit linear DMA input */
#define ESS_ACMD_SETTIMECONST1 0x40 /* set time constant (1MHz base) */
#define ESS_ACMD_SETTIMECONST15 0x41 /* set time constant (1.5MHz base) */
#define ESS_ACMD_SETFILTER 0x42 /* set filter clock independently */
#define ESS_ACMD_BLOCKSIZE 0x48 /* set blk size for high speed xfer */
/*****************************************************************************/
/* DSP Timeout Definitions */
/*****************************************************************************/
#define ESS_READ_TIMEOUT 5000 /* number of times to try a read, 5ms*/
#define ESS_WRITE_TIMEOUT 5000 /* number of times to try a write, 5ms */
#define ESS_NPORT 16
#define ESS_DSP_RESET 0x06
#define ESS_RESET_EXT 0x03 /* reset and use second DMA */
#define ESS_MAGIC 0xAA /* response to successful reset */