Coolquest, Inc. Home Products Support About Contact
cbold_logo_gif C++BOLD Example Design: TTM cbold_logo_gif

Design Home <<  File View  >> Class View Output (partial) Parts Library Examples Home

 

// THIS FILE IS IN THE PUBLIC DOMAIN.
// IT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
#ifndef _MultiSwitchH_
#define _MultiSwitchH_
 
#include "powerswitches.h"
#include "diodes.h"
 
// multi-switch circuits
 
// each circuit contains:
//   one or more power-distribution switches
//   one .01 uF input capacitor and one CDC output capacitor per switch
//   a Schottky diode to protect the switch in case of sudden input voltage loss
 
// the Schottky diode discharges capacitance on port OUT when voltage on port IN suddenly drops
 
class CM_MultiSwitch_Base : public TModule {  // Helper module--not intended for general use
protected:
  CM_MultiSwitch_Base(){};                    // only descendants of this class can be instantiated by user
public:
  port GND;
  port IN;
  port OUT;
  port EN;
 
  CP_MBRS130LT3 Dprotect;   // low-threshold Schottky diode
  CP_CDC_POS   CapI;        // input  cap, one per multiswitch   >>> place near TPS2033D
  CP_CDC_POS   CapO;        // output cap, one per multiswitch   >>> place near TPS2033D
 
public:
  virtual void Register() {
    reg( GND );
    reg( IN );
    reg( OUT );
    reg( EN );
 
    reg( Dprotect );
    reg( CapI );
    reg( CapO );
  }
 
  virtual void Connect() {
    IN  << Dprotect.CATHODE  <<  CapI.POS;
    OUT << Dprotect.ANODE    <<  CapO.POS;
    wireall( GND );          // all switches are wired in parallel
    wireall( IN  );
    wireall( OUT );
    wireall( EN );
    wireall( "/NC", "OC_N" );  // overcurrent flags are not used
  }
};
 
 
class CM_MultiSwitch1 : public CM_MultiSwitch_Base {
public:
// ***** member ports ***** //
// ***** member modules and parts ***** //
  enum { sw_cnt = 1 };            // number of paralleled switches in this module
  CP_TPS2034D  Switch[ sw_cnt ];
 
  virtual void Register() {
    CM_MultiSwitch_Base::Register();
    rega( Switch, sw_cnt );
  }
 
//  virtual void Connect()  // all connections are made in the base class
};
 
class CM_MultiSwitch2 : public CM_MultiSwitch_Base {
public:
// ***** member ports ***** //
// ***** member modules and parts ***** //
  enum { sw_cnt = 2 };            // number of paralleled switches in this module
  CP_TPS2034D  Switch[ sw_cnt ];
 
  virtual void Register() {
    CM_MultiSwitch_Base::Register();
    rega( Switch, sw_cnt );
  }
 
//  virtual void Connect()  // all connections are made in the base class
};
 
 
class CM_MultiSwitch3 : public CM_MultiSwitch_Base {
public:
// ***** member ports ***** //
// ***** member modules and parts ***** //
  enum { sw_cnt = 3 };            // number of paralleled switches in this module
  CP_TPS2034D  Switch[ sw_cnt ];
 
  virtual void Register() {
    CM_MultiSwitch_Base::Register();
    rega( Switch, sw_cnt );
  }
 
//  virtual void Connect()  // all connections are made in the base class
};
 
 
class CM_MultiSwitch4: public CM_MultiSwitch_Base {
public:
// ***** member ports ***** //
// ***** member modules and parts ***** //
  enum { sw_cnt = 4 };            // number of paralleled switches in this module
  CP_TPS2034D  Switch[ sw_cnt ];
 
  virtual void Register() {
    CM_MultiSwitch_Base::Register();
    rega( Switch, sw_cnt );
  }
 
//  virtual void Connect()  // all connections are made in the base class
};
 
 
class CM_MultiSwitch5 : public CM_MultiSwitch_Base {
public:
// ***** member ports ***** //
// ***** member modules and parts ***** //
  enum { sw_cnt = 5 };            // number of paralleled switches in this module
  CP_TPS2034D  Switch[ sw_cnt ];
 
  virtual void Register() {
    CM_MultiSwitch_Base::Register();
    rega( Switch, sw_cnt );
  }
 
//  virtual void Connect()  // all connections are made in the base class
};
 
 
class CM_MultiSwitch6 : public CM_MultiSwitch_Base {
public:
// ***** member ports ***** //
// ***** member modules and parts ***** //
  enum { sw_cnt = 6 };            // number of paralleled switches in this module
  CP_TPS2034D  Switch[ sw_cnt ];
 
  virtual void Register() {
    CM_MultiSwitch_Base::Register();
    rega( Switch, sw_cnt );
  }
 
//  virtual void Connect()  // all connections are made in the base class
};
 
 
#endif

 

Design Home <<  File View  >> Class View Output (partial) Parts Library Examples Home

Legal Copyright © 2007 by Coolquest, Inc. Contact