;:ts=8
	far	code
	far	data
;/*  TT8 specific includes  */
;#include        <TT8.h>                 /* Tattletale Model 8 Definitions */
;#include        <tat332.h>              /* 68332 Tattletale (7,8) Hardware Definitions */
;#include        <sim332.h>              /* 68332 System Integration Module Definitions */
;#include        <qsm332.h>              /* 68332 Queued Serial Module Definitions */
;#include        <dio332.h>              /* 68332 Digital I/O Port Pin Definitions */
;#include        <tt8lib.h>              /* definitions and prototypes for Model 8 library */
;
;/*  general C includes  */
;#include        <stdio.h>
;#include        <stdlib.h>
;#include        <userio.h>
;
;/*  includes specific to the ad7716 routines  */
;#include		"power.h"
;
;void AnalogPowerON (void)  {
# 17 'power.c' 586631684
| .2
	xdef	_AnalogPowerON
_AnalogPowerON:
;	//  Turn the power on; this does not configure the output
;	//  lines used by the AD7716.  That must be done seperately.
;	AnalogPositivePowerON ();
^^^	jsr	_AnalogPositivePowerON
;	AnalogNegativePowerON ();
^	jsr	_AnalogNegativePowerON
;}
^.3
	rts
.2
;
;
;
;void AnalogPowerOFF (void)  {
# 26
| .4
	xdef	_AnalogPowerOFF
_AnalogPowerOFF:
;	//  when depowering the analog section we must also be sure that we
;	//	configure the output lines connected to zero output so that we
;	//  don't power the chip through the digital I/O lines.  In fact,
;	//  we we always power it through the SPI interface lines when we
;	//  access the MAX186, but, oh well.
;
;	//  PCS3 idles high
;	_QPDR->PCS3 = 1;
^^^^^^^^	or.w	#64,-1004
;
;	//  Make sure PCS2, 1, and 0 are not assigned to the SPI
;	//  We want to control them independently so we can force them
;	//  to zero.  We can leave PCS3 (for the MAX186) assigned
;	//  in case the software tries to use it while the power to
;	//  this A/D is off
;	_QPAR->PCS2 = 0;
^^^^^^^	and.w	#-8193,-1002
;	_QPAR->PCS1 = 0;
^	and.w	#-4097,-1002
;	_QPAR->PCS0 = 0;
^	and.w	#-2049,-1002
;	
;	//  REVIEW
;	//  Configure the three chip selects as outputs; configure
;	//  MOSI as an output.  There is some question about MISO.
;	//  It should be an input when the QSPI is active (if and
;	//  only if we are talking to the MAX186), but an output
;	//  otherwise.  Here we leave it as an input, which may cause
;	//  it to float, thereby drawing excess power.  Perhaps we
;	//  should add a high value pull down to the hardware (?)
;	_QDDR->PCS2 = 1;
^^^^^^^^^^	or.w	#32,-1002
;	_QDDR->PCS1 = 1;
^	or.w	#16,-1002
;	_QDDR->PCS0 = 1;
^	or.w	#8,-1002
;	_QDDR->MOSI = 1;
^	or.w	#2,-1002
;	_QDDR->MISO = 0;
^	and.w	#-2,-1002
;
;	//  All the outputs should idle low
;	_QPDR->PCS2 = 0;
^^^	and.w	#-33,-1004
;	_QPDR->PCS1 = 0;
^	and.w	#-17,-1004
;	_QPDR->PCS0 = 0;
^	and.w	#-9,-1004
;	_QPDR->MOSI = 0;
^	and.w	#-3,-1004
;
;	//  finally, actually turn the power off
;	AnalogNegativePowerOFF ();
^^^	jsr	_AnalogNegativePowerOFF
;	AnalogPositivePowerOFF ();
^	jsr	_AnalogPositivePowerOFF
;	return;
^.5
	rts
;}
^.4
;
;
;
;
;void SensorPowerON (void)  {
# 74
| .6
	xdef	_SensorPowerON
_SensorPowerON:
;	SensorPositivePowerON ();
^	jsr	_SensorPositivePowerON
;	SensorNegativePowerON ();
^	jsr	_SensorNegativePowerON
;}
^.7
	rts
.6
;
;
;
;void SensorPowerOFF (void)  {
# 81
| .8
	xdef	_SensorPowerOFF
_SensorPowerOFF:
;	SensorNegativePowerOFF ();
^	jsr	_SensorNegativePowerOFF
;	SensorPositivePowerOFF ();
^	jsr	_SensorPositivePowerOFF
;}
^.9
	rts
.8
;
;
;
;/*************************************************************************
;**      AnalogPositivePowerON()
;**      CLEARS TPU0 Output which is connected to MAX649 SHDN.This turns
;**      ON MAX649 (+5 V) output.
;**************************************************************************/
;
;void AnalogPositivePowerON(void)
;	{
# 94
^| .10
	xdef	_AnalogPositivePowerON
_AnalogPositivePowerON:
;	TPUSetPin(5,CLR);
^	clr.w	-(sp)
	move.w	#5,-(sp)
	jsr	_TPUSetPin
;	} /*AnalogPositivePowerON()*/
^	add.w	#4,sp
.11
	rts
.10
;
;/*************************************************************************
;**      AnalogPositivePowerOFF()
;**      SETS TPU0 Output which is connected to MAX649 SHDN.This turns
;**      OFF MAX649 (+5 V) output.
;**************************************************************************/
;
;void AnalogPositivePowerOFF(void)
;	{
# 105
^| .12
	xdef	_AnalogPositivePowerOFF
_AnalogPositivePowerOFF:
;	TPUSetPin(5,SET);
^	move.w	#65535,-(sp)
	move.w	#5,-(sp)
	jsr	_TPUSetPin
;	} /*AnalogPositivePowerOFF()*/
^	add.w	#4,sp
.13
	rts
.12
;
;/*************************************************************************
;**      AnalogNegativePowerON()
;**      CLEARS TPU1 Output which is connected to MAX764 SHDN.This turns
;**      ON MAX764 (-5 V) output.
;**************************************************************************/
;
;void AnalogNegativePowerON(void)
;	{
# 116
^| .14
	xdef	_AnalogNegativePowerON
_AnalogNegativePowerON:
;	TPUSetPin(4,CLR);
^	clr.w	-(sp)
	move.w	#4,-(sp)
	jsr	_TPUSetPin
;	} /*AnalogNegativePowerON()*/
^	add.w	#4,sp
.15
	rts
.14
;
;/*************************************************************************
;**      AnalogNegativePowerOFF()
;**      SETS TPU1 Output which is connected to MAX764 SHDN.This turns
;**      OFF MAX764 (-5 V) output.
;**************************************************************************/
;
;void AnalogNegativePowerOFF(void)
;	{
# 127
^| .16
	xdef	_AnalogNegativePowerOFF
_AnalogNegativePowerOFF:
;	TPUSetPin(4,SET);
^	move.w	#65535,-(sp)
	move.w	#4,-(sp)
	jsr	_TPUSetPin
;	} /*AnalogNegativePowerOFF()*/
^	add.w	#4,sp
.17
	rts
.16
;
;/*************************************************************************
;**      SensorPositivePowerON()
;**      SETS TPU2 Output which is connected to MAX649 -SHDN.This turns
;**      ON MAX649 (+5 V) output.
;**************************************************************************/
;
;void SensorPositivePowerON(void)
;	{
# 138
^| .18
	xdef	_SensorPositivePowerON
_SensorPositivePowerON:
;	TPUSetPin(3,CLR);
^	clr.w	-(sp)
	move.w	#3,-(sp)
	jsr	_TPUSetPin
;	} /*SensorPositivePowerON()*/
^	add.w	#4,sp
.19
	rts
.18
;
;/*************************************************************************
;**      SensorPositivePowerOFF()
;**      CLEARS TPU2 Output which is connected to MAX649 -SHDN.This turns
;**      OFF MAX649 (+5 V) output.
;**************************************************************************/
;
;void SensorPositivePowerOFF(void)
;	{
# 149
^| .20
	xdef	_SensorPositivePowerOFF
_SensorPositivePowerOFF:
;	TPUSetPin(3,SET);
^	move.w	#65535,-(sp)
	move.w	#3,-(sp)
	jsr	_TPUSetPin
;	} /*SensorPositivePowerOFF()*/
^	add.w	#4,sp
.21
	rts
.20
;
;/*************************************************************************
;**      SensorNegativePowerON()
;**      CLEARS TPU3 Output which is connected to MAX764 SHDN.This turns
;**      ON MAX764 (-5 V) output.
;**************************************************************************/
;
;void SensorNegativePowerON(void)
;	{
# 160
^| .22
	xdef	_SensorNegativePowerON
_SensorNegativePowerON:
;	TPUSetPin(2,CLR);
^	clr.w	-(sp)
	move.w	#2,-(sp)
	jsr	_TPUSetPin
;	} /*SensorNegativePowerON()*/
^	add.w	#4,sp
.23
	rts
.22
;
;/*************************************************************************
;**      SensorNegativePowerOFF()
;**      SETS TPU1 Output which is connected to MAX764 SHDN.This turns
;**      OFF MAX764 (-5 V) output.
;**************************************************************************/
;
;void SensorNegativePowerOFF(void)
;	{
# 171
^| .24
	xdef	_SensorNegativePowerOFF
_SensorNegativePowerOFF:
;	TPUSetPin(2,SET);
^	move.w	#65535,-(sp)
	move.w	#2,-(sp)
	jsr	_TPUSetPin
;	} /*SensorNegativePowerOFF()*/
^	add.w	#4,sp
.25
	rts
.24
;
# 174
|
~ _SensorNegativePowerOFF * "(v"
~ _SensorNegativePowerON * "(v"
~ _SensorPositivePowerOFF * "(v"
~ _SensorPositivePowerON * "(v"
~ _SensorPowerOFF * "(v"
~ _SensorPowerON * "(v"
~ _AnalogNegativePowerOFF * "(v"
~ _AnalogNegativePowerON * "(v"
~ _AnalogPositivePowerOFF * "(v"
~ _AnalogPositivePowerON * "(v"
~ _AnalogPowerOFF * "(v"
~ _AnalogPowerON * "(v"
~ ''
~ 1 2 8
~ quot 0 "l"
~ rem 4 "l"
~ ''
~ 2 2 4
~ quot 0 "i"
~ rem 2 "i"
~ ldiv_t ":" 1
~ div_t ":" 2
~ '__stdio'
~ 3 8 22
~ _bp 0 "#C"
~ _bend 4 "#C"
~ _buff 8 "#C"
~ _flags 12 "I"
~ _unit 14 "c"
~ _bytbuf 15 "C"
~ _buflen 16 "L"
~ _tmpnum 20 "I"
~ FILE ":" 3
~ fpos_t "l"
~ va_list "#c"
~ ''
~ 4 13 46
~ libVersion 0 "l"
~ ramBase 4 "#c"
~ ramSize 8 "l"
~ ramWaits 12 "i"
~ flashBase 14 "#c"
~ flashSize 18 "l"
~ flashWaits 22 "i"
~ heapBot 24 "#v"
~ heapTop 28 "#v"
~ heapCur 32 "#v"
~ statusReg 36 "I"
~ vectorBase 38 "#v"
~ stackPtr 42 "#v"
~ infoAction "c"
~ TT8info ":" 4
~ _TPUSetPin * "(v"
~ UeeErr "c"
~ ''
~ 5 2 8
~ secs 0 "L"
~ ticks 4 "l"
~ time_tt ":" 5
~ XmdmErr "c"
~ FlashErr "c"
~ ''
~ 6 4 24
~ eSR 0 "I"
~ ePC 2 "L"
~ vectofs 6 "I"
~ states 8 "[8I"
~ ''
~ 7 4 20
~ preamble 0 "[4I"
~ jump 8 "I"
~ target 10 "L"
~ postamble 14 "[3I"
~ ExcCFramePtr "#:" 7
~ ExcCFrame ":" 7
~ ExcStackFrame ":" 6
~ 'tm'
~ 8 10 20
~ tm_sec 0 "i"
~ tm_min 2 "i"
~ tm_hour 4 "i"
~ tm_mday 6 "i"
~ tm_mon 8 "i"
~ tm_year 10 "i"
~ tm_wday 12 "i"
~ tm_yday 14 "i"
~ tm_isdst 16 "i"
~ tm_hsec 18 "i"
~ time_t "L"
~ clock_t "L"
~ wchar_t "c"
~ ptrdiff_t "l"
~ size_t "L"
~ bool "c"
~ vfptr "#(v"
~ ptr "#c"
~ ulpv "#L"
~ ulong "L"
~ uspv "#I"
~ unsint "I"
~ ushort "I"
~ ucpv "#C"
~ uchar "C"
	xref	_TPUSetPin
	xref	.begin
	dseg
	end
