/* ---------------------------------------------------------------------------- * Setup for the ZEUS MVD C&C Master and Slave * * Author : J.B.Lane UCL February 2000 * ---------------------------------------------------------------------------- */ enum registers { NUMBER, CONTROL, RETURN, COMMAND, STATE, TESTSTATE, SLAVES, MASK, CALIDELAY, FINEDELAY, TESTDELAY } ; void Master_setup (volatile unsigned short * memory_ptr) { /* Example setup for Master registers */ memory_ptr[COMMAND ] = 0x0002 ; /* overall RESET bit clears registers */ memory_ptr[COMMAND ] = 0x0001 ; /* GFLT mode (default is local mode) */ memory_ptr[MASK ] = 0x0421 ; /* enable the returns from Slave A */ memory_ptr[CALIDELAY] = 0x8032 ; /* Calib delay: fine 64ns, coarse 5us */ memory_ptr[FINEDELAY] = 0x0010 ; /* Clock delay: fine 8ns */ memory_ptr[TESTDELAY] = 0x5000 ; /* TestEnable delay: coarse 2ms */ if (((int)memory_ptr[STATE] & 0x0010) == 0) printf ("ADC clock OFF!\n") ; if (((int)memory_ptr[STATE] & 0x0020) == 0) printf ("HLX clock OFF!\n") ; while (((int)memory_ptr[TESTSTATE] & 0x70) != 0) /* just a short while */ memory_ptr[TESTSTATE] = 0 ; /* to clear clock faults due to RESET */ } void Slaves_setup (volatile unsigned short * memory_ptr) { /* Example setup for Slave registers */ memory_ptr[COMMAND] = 0x0002 ; /* overall RESET bit clears registers */ if (((int)memory_ptr[STATE] & 0x0010) == 0) printf ("ADC clock OFF!\n") ; }