Jspice3
capparam.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "capdefs.h"
11 #include "util.h"
12 #include "sperror.h"
13 
14 
15 /* ARGSUSED */
16 int
17 CAPparam(ckt,param,value,inst,select)
18 
19 CKTcircuit *ckt;
20 int param;
21 IFvalue *value;
22 GENinstance *inst;
23 IFvalue *select;
24 {
25  CAPinstance *here = (CAPinstance*)inst;
26 
27  switch (param) {
28 
29  case CAP_CAP:
30  here->CAPcapac = value->rValue;
31  here->CAPcapGiven = TRUE;
32  break;
33  case CAP_IC:
34  here->CAPinitCond = value->rValue;
35  here->CAPicGiven = TRUE;
36  break;
37  case CAP_WIDTH:
38  here->CAPwidth = value->rValue;
39  here->CAPwidthGiven = TRUE;
40  break;
41  case CAP_LENGTH:
42  here->CAPlength = value->rValue;
43  here->CAPlengthGiven = TRUE;
44  break;
45  default:
46  return (E_BADPARM);
47  }
48  return (OK);
49 }
#define CAP_CAP
Definition: capdefs.h:76
unsigned CAPlengthGiven
Definition: capdefs.h:47
#define E_BADPARM
Definition: iferrmsg.h:26
#define TRUE
Definition: util.h:27
unsigned CAPicGiven
Definition: capdefs.h:45
double rValue
Definition: ifsim.h:233
#define OK
Definition: iferrmsg.h:17
double CAPwidth
Definition: capdefs.h:31
#define CAP_LENGTH
Definition: capdefs.h:79
double CAPinitCond
Definition: capdefs.h:28
double CAPlength
Definition: capdefs.h:32
int CAPparam(CKTcircuit *ckt, int param, IFvalue *value, GENinstance *inst, IFvalue *select)
Definition: capparam.c:17
unsigned CAPcapGiven
Definition: capdefs.h:44
unsigned CAPwidthGiven
Definition: capdefs.h:46
#define CAP_IC
Definition: capdefs.h:77
double CAPcapac
Definition: capdefs.h:27
#define CAP_WIDTH
Definition: capdefs.h:78