FreeCalypso > hg > freecalypso-schem2
comparison venus/src/periph/loudspeaker.v @ 59:66d99b5be8a3
loudspeaker block implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 01 Dec 2021 04:08:35 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
58:229f0b2dd1bf | 59:66d99b5be8a3 |
---|---|
1 /* Loudspeaker circuit following Leonardo schematics */ | |
2 | |
3 module loudspeaker (GND, VBAT, Input_pos, Input_neg, GPIO_enable); | |
4 | |
5 input GND, VBAT; | |
6 input Input_pos, Input_neg; | |
7 input GPIO_enable; | |
8 | |
9 wire PA_in_pos, PA_in_neg; | |
10 wire Out_pos, Out_neg; | |
11 wire BYPASS; | |
12 | |
13 /* instantiate the audio PA */ | |
14 pkg_TPA6203A1 apa (.BYPASS(BYPASS), | |
15 .GND(GND), | |
16 .In_neg(PA_in_neg), | |
17 .In_pos(PA_in_pos), | |
18 .SHUTDOWN(GPIO_enable), | |
19 .VDD(VBAT), | |
20 .Out_pos(Out_pos), | |
21 .Out_neg(Out_neg) | |
22 ); | |
23 | |
24 /* input resistors: the inversion is per Leonardo schematics */ | |
25 resistor R33xA (Input_pos, PA_in_neg); | |
26 resistor R33xB (Input_neg, PA_in_pos); | |
27 | |
28 /* feedback resistors */ | |
29 resistor R331 (Out_neg, PA_in_pos); | |
30 resistor R332 (Out_pos, PA_in_neg); | |
31 | |
32 /* bypass and supply decoupling caps */ | |
33 capacitor C319 (BYPASS, GND); | |
34 capacitor C330 (VBAT, GND); | |
35 | |
36 /* small output capacitors */ | |
37 capacitor C331 (Out_neg, GND); | |
38 capacitor C332 (Out_pos, GND); | |
39 | |
40 /* the speaker itself! */ | |
41 header_2pin spkr_connector (Out_pos, Out_neg); | |
42 | |
43 /* pull-down on the GPIO control line */ | |
44 resistor R338 (GPIO_enable, GND); | |
45 | |
46 endmodule |