/* ---------------------------- */ /* pubcomm.h */ /* ---------------------------- */ /* =============================================================================== */ /* public communication constants and function prototypes */ /* public == for use by the host system code and/or by the DSP system code */ /* private == for use by the developers of the communication system only */ /* =============================================================================== */ /* ============================================================ */ /* I. Items used by software running in the host or in the DSP. */ /* ============================================================ */ /* ----------------------------- */ /* message system error codes */ /* ----------------------------- */ #define SUCCESS 0 #define ENOSIG 1 #define EABORT 2 #define ENOMESS 3 #define ECONFLICT 4 #define EBUSY 5 #define ETOOBIG 6 #define EMESSINVAL 7 #define NUM_FLAGS 64 #define NUM_CHAN 7 #define DPRAM_SIZE 0x800 #ifdef I_AM_HOST /* ============================================================= */ /* II. Items here are for use by software running in the host. */ /* ============================================================= */ /* ---------------------------------------------------------- */ /* status codes returned in dsp_status by download system */ /* ---------------------------------------------------------- */ #define DOWN_DONE ( 0) /* download done without errors */ #define DOWN_INCOMPLETE (0xA00) /* no DSP errors, but download is not done */ #define DOWN_TIMEOUT (0xA01) /* DSP timed out */ #define DOWN_ERROR (0xA02) /* Some error besides timeout */ /* ------------------------------- */ /* function prototypes */ /* ------------------------------- */ int init_dsps ( int, int, char*); /* reset, initialize DSP's, downloads system */ int32* dsp_base (int); /* return pointer to base of DSP's DPRAM */ void dsp_led (int, int); /* turn the host's red LED on or off */ void interrupt_dsp (int); /* cause a DSP interrupt */ int send_mess (int32 *); int get_mess (int); int get_flag (int, int); int set_flag (int, int, int); int message_status (void); int check_mess (int); int m_wait(int); void do_echo (); void com_init (void); #endif #ifdef I_AM_DSP /* ============================================================= */ /* III. Items here are for use by software running in the DSP. */ /* ============================================================= */ /* ----------------------- */ /* function prototypes */ /* ----------------------- */ int export_mess (int *); int import_message (void); int m_wait (int); int accept (void); int com_abort (void); int get_flag (int); int set_flag (int, int); int import_code (void); int message_status (void); int check_mess (void); #endif