annotate venus/src/periph/loudspeaker.v @ 83:c27854430cb3

add 3-pin header for possible external boot control
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 08 Dec 2021 05:32:47 +0000
parents 66d99b5be8a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
59
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /* Loudspeaker circuit following Leonardo schematics */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 module loudspeaker (GND, VBAT, Input_pos, Input_neg, GPIO_enable);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 input GND, VBAT;
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 input Input_pos, Input_neg;
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 input GPIO_enable;
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 wire PA_in_pos, PA_in_neg;
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 wire Out_pos, Out_neg;
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 wire BYPASS;
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 /* instantiate the audio PA */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 pkg_TPA6203A1 apa (.BYPASS(BYPASS),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 .GND(GND),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 .In_neg(PA_in_neg),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 .In_pos(PA_in_pos),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 .SHUTDOWN(GPIO_enable),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 .VDD(VBAT),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 .Out_pos(Out_pos),
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 .Out_neg(Out_neg)
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 );
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 /* input resistors: the inversion is per Leonardo schematics */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 resistor R33xA (Input_pos, PA_in_neg);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 resistor R33xB (Input_neg, PA_in_pos);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 /* feedback resistors */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 resistor R331 (Out_neg, PA_in_pos);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 resistor R332 (Out_pos, PA_in_neg);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 /* bypass and supply decoupling caps */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 capacitor C319 (BYPASS, GND);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 capacitor C330 (VBAT, GND);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 /* small output capacitors */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 capacitor C331 (Out_neg, GND);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 capacitor C332 (Out_pos, GND);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 /* the speaker itself! */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 header_2pin spkr_connector (Out_pos, Out_neg);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 /* pull-down on the GPIO control line */
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 resistor R338 (GPIO_enable, GND);
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
66d99b5be8a3 loudspeaker block implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 endmodule