-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundles.stanza
47 lines (39 loc) · 988 Bytes
/
bundles.stanza
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
; ====================
; A number of helpful functions to check your designs, export to CAD,
; update your design in CAD, etc.
; ====================
#use-added-syntax(jitx)
defpackage bundles :
import core
import jitx
import jitx/commands
public pcb-bundle rgb-led :
port r
port g
port b
port a
public pcb-bundle low-freq-oscillator :
port lo-in
port lo-out
public pcb-bundle high-freq-oscillator :
port hi-in
port hi-out
; Operational Amplifier's are typically a differential input
; amplifier with a single-ended output.
; They may optionally include a TRIM input for correcting
; input offset voltages.
public pcb-enum bundles/OpAmp :
TRIM-OFFSET
public pcb-bundle op-amp (pins:Tuple<bundles/OpAmp>) :
port in+
port in-
port out
for p in pins do :
switch(p) :
TRIM-OFFSET :
make-pin(`trim+)
make-pin(`trim-)
; Helper for a simple op-amp bundle without
; trim inputs.
public defn op-amp () :
op-amp([])