Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendsp.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS kernel 00004 * FILE: drivers/dd/sound/dsp.c 00005 * PURPOSE: Digital Signal Processing ? 00006 * PROGRAMMER: Snatched from ? 00007 * 00008 * UPDATE HISTORY: 00009 * ??/??/??: Created 00010 * 10/23/02: Steven Edwards (Steven_Ed4153@yahoo.com) 00011 * Minor build fix 00012 */ 00013 00014 #include "sb16.h" 00015 #include "dsp.h" 00016 00017 /************************************ 00018 * unsigned char read_dsp(void) 00019 * 00020 * Reads the DSP chip 00021 * Arguments: none 00022 * Returns: Byte read 00023 ************************************/ 00024 unsigned char read_dsp(unsigned short base) 00025 { 00026 // while((inb(base+0x0e)&0x80)==0); //Wait until there is something to read 00027 // return inb(base+0x0a); 00028 return 0; 00029 } 00030 00031 /************************************' 00032 * sb_status detect_dsp(void); 00033 * 00034 * Detects if a SB16 is installed 00035 * Arguments: None 00036 * Returns: Success or failure 00037 ************************************/ 00038 sb_status detect_dsp(SB16* sb16) 00039 { 00040 for(base=0x200;base<0x280;base+=0x10) //Tries to reset all DSP addresses there is 00041 if(reset_dsp(base)==SB_TRUE) 00042 { 00043 sb16->base=base; 00044 return SB_TRUE; 00045 } 00046 return SB_FALSE; 00047 } 00048 00049 /************************************** 00050 * sb_status reset_dsp(unsigned short base_address); 00051 * 00052 * Tries to reset a DSP chip 00053 * Arguments: base address 00054 * Returns: Success of failure 00055 **************************************/ 00056 sb_status reset_dsp(unsigned short base_address) 00057 { 00058 // int delay; 00059 00060 // outb(base_address+DSP_RESET_PORT,1); 00061 // for(delay=0;delay<0xffff;delay++); 00062 00063 // outb(base_address+DSP_RESET_PORT,0); 00064 // for(delay=0;delay<0xffff;delay++); 00065 00066 // if((inb(base_address+DSP_READ_STATUS_PORT)&0x80)==0) return SB_FALSE; 00067 00068 // if(inb(base_address+DSP_READ_DATA_PORT)!=0xAA) return SB_FALSE; 00069 00070 return SB_TRUE; 00071 } 00072 00073 void write_dsp(unsigned short base,unsigned char data) 00074 { 00075 // while ((inb(base+DSP_WRITE_PORT) & 0x80) != 0); 00076 // outb(base+DSP_WRITE_PORT, data); 00077 } 00078 Generated on Sat May 26 2012 04:26:35 for ReactOS by
1.7.6.1
|