/* RegEPROMA.c
   Stewart September 29, 1983  3:46 PM, created
 */

#include	"Env.h"
#include	"Lark.h"
#include	"LarkSlave.h"
#include	"RegEPROM.h"

extern int numDigits;
extern int number[20];

PickUpLine()
  {
  /* close OH and A relays */
  GoOffHook(true);
  ARelay(true);
  };

HangUpLine()
  {
  /* open OH and A relays */
  GoOffHook(false);
  ARelay(false);
  };

DialNumber()
  {
  /* generate TT sequence from stored number */
  int i;
  for (i = 0; i < numDigits; i += 1) {
    PlayDigit(number[i]);
    };
  };

MikeToLine()
  {
  ClearXbar(XBTeleSet, XBCodec1);
  SetXbar(XBMike, XBCodec1);
  ClearXbar(XBLine1, XBCodec1);
  ClearXbar(XBLine2, XBCodec1);
  AudioIdle();
  SPMode(true);
  SideTone(true);
  };

LineAToLine()
  {
  ClearXbar(XBTeleSet, XBCodec1);
  ClearXbar(XBMike, XBCodec1);
  SetXbar(XBLine1, XBCodec1);
  ClearXbar(XBLine2, XBCodec1);
  AudioIdle();
  SPMode(true);
  SideTone(true);
  };

LineBToLine()
  {
  ClearXbar(XBTeleSet, XBCodec1);
  ClearXbar(XBMike, XBCodec1);
  ClearXbar(XBLine1, XBCodec1);
  SetXbar(XBLine2, XBCodec1);
  AudioIdle();
  SPMode(true);
  SideTone(true);
  };

TSToLine()
  {
  SetXbar(XBTeleSet, XBCodec1);
  ClearXbar(XBMike, XBCodec1);
  ClearXbar(XBLine1, XBCodec1);
  ClearXbar(XBLine2, XBCodec1);
  AudioIdle();
  SPMode(true);
  SideTone(false);
  };

RevertPhone()
  {
  Revert(true);
  RevertHS(false);
  GoOffHook(false);
  ARelay(false);
  };

LineToSpeaker()
  {
  ClearXbar(XBCodec1, XBSpeaker);
  SetXbar(XBTeleWall, XBSpeaker);
  };