const_hoisted_1=/* @__PURE__ */createStaticVNode('<h1id="audio"tabindex="-1">Audio<aclass="header-anchor"href="#audio"aria-label="Permalink to "Audio""></a></h1><p>Yourkeyboardcanmakesounds!Ifyou'vegotasparepinyoucanhookupasimplespeakerandmakeitbeep.Youcanusethosebeepstoindicatelayertransitions,modifiers,specialkeys,orjusttoplaysomefunky8bittunes.</p><p>Toactivatethisfeature,add<code>AUDIO_ENABLE=yes</code>toyour<code>rules.mk</code>.</p><h2id="avr-based-boards"tabindex="-1">AVRbasedboards<aclass="header-anchor"href="#avr-based-boards"aria-label="Permalinkto"AVRbasedboards""></a></h2><p>OnAtmega32U4basedboards,uptotwosimultaneoustonescanberendered.WithonespeakerconnectedtoaPWMcapablepinonPORTCdrivenbytimer3andtheotherononeofthePWMpinsonPORTBdrivenbytimer1.</p><p>Thefollowingpinscanbeconfiguredasaudiooutputsin<code>config.h</code>-foronespeakerseteitheroneoutof:</p><ul><li><code>#defineAUDIO_PINC4</code></li><li><code>#defineAUDIO_PINC5</code></li><li><code>#defineAUDIO_PINC6</code></li><li><code>#defineAUDIO_PINB5</code></li><li><code>#defineAUDIO_PINB6</code></li><li><code>#defineAUDIO_PINB7</code></li></ul><p>and<em>optionally</em>,forasecondspeaker,oneof:</p><ul><li><code>#defineAUDIO_PIN_ALTB5</code></li><li><code>#defineAUDIO_PIN_ALTB6</code></li><li><code>#defineAUDIO_PIN_ALTB7</code></li></ul><h3id="wiring"tabindex="-1">Wiring<aclass="header-anchor"href="#wiring"aria-label="Permalinkto"Wiring""></a></h3><p>perspeakeris-forexamplewithapiezobuzzer-theblackleadtoGround,andtheredleadconnectedtotheselectedAUDIO_PINfortheprimary;andsimilarlywithAUDIO_PIN_ALTforthesecondary.</p><h2id="arm-based-boards"tabindex="-1">ARMbasedboards<aclass="header-anchor"href="#arm-based-boards"aria-label="Permalinkto"ARMbasedboards""></a></h2><p>formoretechnicaldetails,seethenoteson<ahref="./../drivers/audio">Audiodriver</a>.</p><h3id="dac-basic"tabindex="-1">DAC(basic)<aclass="header-anchor"href="#dac-basic"aria-label="Permalinkto"DAC(basic)""></a></h3><p>MostSTM32MCUshaveDACperipherals,withanotableexceptionoftheSTM32F1xxseries.Generally,theDACperipheraldrivespinsA4orA5.ToenableDAC-basedaudiooutputonSTM32devices,add<code>AUDIO_DRIVER=dac_basic</code>to<code>rules.mk</code>andsetin<code>config.h</code>either:</p><p><code>#defineAUDIO_PINA4</code>or<code>#defineAUDIO_PINA5</code></p><p>theotherDACchannelcanoptionallybeusedwithasecondaryspeaker,justset:</p><p><code>#defineAUDIO_PIN_ALTA4</code>or<code>#defineAUDIO_PIN_ALTA5</code></p><p>Donotethoughthatthedac_basicdriverisonlycapableofreproducingonetoneperspeaker/channelatatime,formoretonessimultaneously,trythedac_additivedriver.</p><h4id="wiring-1"tabindex="-1">Wiring:<aclass="header-anchor"href="#wiring-1"aria-label="Permalinkto"Wiring:""></a></h4><p>fortwopiezos,forexampleconfiguredas<code>AUDIO_PINA4</code>and<code>AUDIO_PIN_ALTA5</code>wouldbe:redleadtoA4andblacktoGround,andsimilarlywiththesecondone:A5=red,andGround=black</p><p>anotheralternativeistodrive<em>one</em>piezowithbothDACpins-foranextra"push".wiringredtoA4andblacktoA5(ortheotherwayround)andadd<code>#defineAUDIO_PIN_ALT_AS_NEGATIVE</code>to<code>config.h</code></p><h5id="proton-c-example"tabindex="-1">Proton-CExample:<aclass="header-anchor"href="#proton-c-example"aria-label="Permalinkto"Proton-CExample:""></a></h5><p>TheProton-Ccomes(optionally)withone'builtin'piezo,whichiswiredtoA4+A5.Forthisboard<code>config.h</code>wouldincludethesedefines:</p><divclass="language-cvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">c</span><preclass="shikishiki-themesg