Corporate ¤ Home ¤ License ¤ Memory ¤ MIPs ¤ Performance ¤ Products ¤ Prices

Mesi_logo6.gif (2951 bytes)

"TARGET.ASM" Hardware Device Driver Information

MESi components all ship with a file that contains drivers for a variety of hardware components including DSP chip initialization, serial port initialization, audio codec A/D and DAC interfaces, telephone hook-switch and ring detect interfaces, and timer functions.  This assembly source driver file is called TARGET.ASM with assembly include file TARGET.INC. The TARGET.OBJ Object is built using the appropriate C compiler shell or assembler and using the -d command-line option to selectively build the correct drivers for your system configuration. See the comments at the top of TARGET.ASM for command-line symbol definitions for specific target boards.  MESi supports demos for several popular hardware boards including Analog Devices EZ-KIT Lite® and EZ-LAB boards, Texas Instruments EVM and DSK boards, DSP Research Tiger boards, and Silicon Labs DAA EVBs. For customers using similar configurations in their own hardware designs, the driver file serves as a template.

The functions in the driver file are described in detail below. The source code includes many #ifdefs to control the type of software implementation specific to supported hardware configurations, such as DSK5416, TIGER5410, EZBF535, etc.

Variable or Function Name

arguments returns Description

extern void start_timer(void)

none none This function causes the on-chip timer to start from it's reset state

extern int stop_timer(void)

none 16 bit unsigned This function stops the on-chip timer, and returns the unsigned integer count value corresponding to the number of CPU cycles elapsed since it was started.  The on-chip timer is used in the demos to provide a mechanism to measure the MIPs for each call to transmitter() and receiver().

extern void write_sample_to_DAC(int)

16 bit integer none This function writes the 16 bit integer argument to the specific hardware device implementing the Digital-to-Analog Converter. The hardware is usually a serial port transmit register such as DXR.

extern int read_sample_from_ADC(void)

 none

16 bit integer This function reads a 16 bit integer from the specific device implementing the Analog-to-Digital Converter, and returns it to the caller.  The hardware is usually a serial port receive register such as DRR

extern int HW_system_delay

 n/a

n/a This integer is copied into Tx->system_delay in transmitter()'s TX_BLOCK structure.  It's initialized with a delay value that corresponds to the delays inherent in the selected audio codes.

extern void init_hardware(void)

 none

none This function initializes the DSP chip and hardware registers (if applicable) so the the target board will run at 8 kHz sample rate through the specified codec device. It also initializes the serial port and registers in the audio codec device (if applicable) for operation at 8 kHz sample rate.

extern int go_off_hook(void)

 none

bool This function causes the external hook-switch to go off-hook. A zero return value indicates that the function successfully executed

extern int go_on_hook(void)

 none

bool This function causes the external hook-switch to go on-hook. A zero return value indicates that the function successfully executed

extern int wait_billing_delay(void)

 none

bool This function polls the billing delay pin on some DAA circuits. It returns zero if the billing delay squelch is inactive, and non-zero if the DAA is squelching.

extern int poll_ring_indicator(void)

 none

bool This function polls the hardware ringing indicator and returns zero if not ringing, and non-zero if ringing is detected.

extern void dump_init(void)

none

none This function sets the dump buffer pointer, *dump_ptr, equal to the start of the dump buffer, dump[].  It also fills the dump buffer, dump[] with a "0xabcd" pattern so that the user can quickly determine if valid data has been logged.

extern void dump_write(int)

 16 bit integer

none This function writes the 16 bit integer (32 bits for 'C3x/C4x) to the location in dump[] pointed to by *dump_ptr, and increments dump_ptr. If the dump[] buffer is full, then the function simply returns to the caller with no action performed. This you can trigger the dump_write() function endlessly without concern for overflow.  You can also reset *dump_ptr to allow logging to continue

extern int dump[]

 n/a

n/a This array is the dump buffer written to by the dump_write() function. It's size defaults to 1 unless DUMP_LEN is defined otherwise in the C compiler command line (example: -dDUMP_LEN=10000). 

extern int *dump_ptr

n/a n/a This pointer points to elements in dump[] and is incremented by the dump_write() function until the end of dump[].

IQ_DAC_write:

32 bit long none This assembly language routine allows the user to plot the modem's I and Q symbol pair to an X-Y display device such as an oscilloscope via a dual DAC. The demodulator calls this routine every time an I,Q symbol pair is demodulated. The I,Q pair is packed into a 32 bit word with I in the lower 16 bits, and Q in the upper 16 bits. Unless c54x.c is compiled for target hardware with a dual DAC, such as the DSP Research Tiger54x boards, this routine simply returns with no action.