/*H*************************************************************************** * * $Archive:: $ * $Revision:: $ * $Date:: $ * $Author:: $ * * DESCRIPTION: * * USAGE/LIMITATIONS: * * NOTES: * * AUTHOR: Patrick Cresap, 2000 * *H***************************************************************************/ #ifndef codec_controls_h #define codec_controls_h /*---- compilation control switches ----------------------------------------*/ /***************************************************************************** * INCLUDE FILES (minimize nesting of header files) *****************************************************************************/ /*---- system and platform files -------------------------------------------*/ /*---- program files -------------------------------------------------------*/ /***************************************************************************** * FILE CONTENT *****************************************************************************/ /***************************************************************************** * FUNCTIONAL AREA DETAIL *****************************************************************************/ /*A*************************************************************************** * NAME: * * USAGE: * * NOTES: * *A***************************************************************************/ /*---- context -------------------------------------------------------------*/ /*---- data descriptions ---------------------------------------------------*/ #define LOOP_BACK 0x0000 #define TRANSMIT 0x0001 #define CODEC_SECONDARY_REQ 0x0001 /* lowest bit is secondary request */ #define NO_SEC_MASK 0xFFFE /* no secondary request when sending data */ /* isr states */ #define ISR_IDLE 0x0000 #define ISR_SEC_REQ_READ 0x0001 #define ISR_SEND_READ_CMD 0x0002 #define ISR_READ_DATA 0x0004 #define ISR_SEC_REQ_WRITE 0x0008 #define ISR_SEND_WRITE_CMD 0x0010 /* the codec options that the user is able to user */ #define USER_NOTHING 0x0000 /*no command*/ #define USER_RESET 0x0001 /*resets codec*/ #define USER_WRITE 0x0002 /*will write to a reg and then read that reg*/ #define USER_READ 0x0004 /*will read all the registers*/ /*-- Codec Control Register structure -------------------------------------*/ typedef struct codec_control_registers { unsigned short reg1; unsigned short reg2; unsigned short reg3; unsigned short reg4; }CODEC_CONTROL_REGISTERS; /*-- ISR options -----------------------------------------------------------*/ typedef struct codec_control_options { unsigned short sw_reset_cmd; unsigned short read_cmd; unsigned short write_cmd; unsigned short sw_reset_count; unsigned short read_count; unsigned short read_buffer; unsigned short ctl_xfer_busy; unsigned short xmit_buffer; unsigned short rcv_buffer; }CODEC_CONTROL_OPTIONS; /*---- global data declarations --------------------------------------------*/ /*---- global function prototypes ------------------------------------------*/ void reg_read_error (unsigned short reg); void no_sec_mask ( void ); void codec_secondary_req (void); unsigned short user_isr_convert ( void ); void write_to_register_structure ( void ); void write_codec_ctl( unsigned short data, unsigned short write_cmd); #endif /* codec_controls_h END OF FILE -------------------------------------*/