1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/doc/pt/pwm_ref.html

136 lines
4.3 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Language" content="en-us"><title>Produto</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body style="background-color: rgb(255, 255, 255);">
<h3><a name="over"></a>pwm</h3>
<span style="font-weight: bold;"></span><br>
<p style="margin-bottom: 0in;"> <br>
</p>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif">Permite que Lua use
os blocos PWM para a CPU em quest&atilde;o.</font>
</p>
<p style="margin-bottom: 0in;"> <br>
</p>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif"><strike><a name="setup"></a>[pwm.setup]</strike>(</font><font face="Bitstream Vera Sans Mono, sans-serif">pwm.setup( id,
frequency, Active Cycle ) &nbsp; &nbsp; &nbsp;</font><font face="Bitstream Vera Sans Mono, sans-serif">
Data = pwm.setup( id, frequency, duty ): configura o 'id' do bloco PWM para
gerar a frequ&ecirc;ncia especificada com o ciclo 'duty' especificado (duty &eacute;
um n&uacute;mero inteiro entre 0 e 100, indicando o percentual a ser
utilizado). Ela retorna a frequ&ecirc;ncia real configurada no bloco PWM.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;"> <br>
</p>
<p style="margin-bottom: 0in;"> Aqui existe uma enorme
mudan&ccedil;a na proposta.
</p>
<p style="margin-bottom: 0in;"> O Timer Clock e a frequ&ecirc;ncia
PWM "frame" seriam configurados na mesma fun&ccedil;&atilde;o (.setup)
</p>
<p style="margin-bottom: 0in;"> A fun&ccedil;&atilde;o normal de
controle configuraria somente o ciclo ativo (.setcycle)
</p>
<p style="margin-bottom: 0in;"> A fun&ccedil;&atilde;o original .setup
seria substitu&iacute;da por:
</p>
<p style="margin-bottom: 0in;"> <br>
</p>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif">[pwm.setup( id,
tmrclock, pwm_frequency )</font> ]<br>
</p>
<p style="margin-bottom: 0in;"> <a name="setcycle"></a>[pwm.setcycle(
id, active_cycle )]</p>
<p style="margin-bottom: 0in;"><font face="Bitstream Vera Sans Mono, sans-serif"><a name="start"></a>[pwm.start()]&nbsp;&nbsp;
pwm.start( id ): inicia o 'id' do bloco PWM.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif"><a name="stop"></a>[</font><font face="Bitstream Vera Sans Mono, sans-serif">pwm.stop()]&nbsp;&nbsp;&nbsp;
</font><font face="Bitstream Vera Sans Mono, sans-serif">pwm.stop(
id ): finaliza o 'id' do bloco PWM.</font>
</p>
<br>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif"><a name="setclock"></a>Data = pwm.setclock( id, clock ):
configura o clock base do 'id' do bloco PWM para</font>
</p>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif">o clock informado.
Retorna o clock corrente do bloco PWM.</font>
</p>
<p style="margin-bottom: 0in;"> <br>
</p>
<p style="margin-bottom: 0in;"> <font face="Bitstream Vera Sans Mono, sans-serif">[</font><font face="Bitstream Vera Sans Mono, sans-serif"><strike>pwm.getclock</strike>]
</font><font face="Bitstream Vera Sans Mono, sans-serif">Data
= pwm.getclock( id ): retorna o clock base do 'id' do bloco PWM.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;"> <br>
</p>
<p style="margin-bottom: 0in;"> Realmente &eacute; necess&aacute;rio
existir
.getclock ?? O clock &eacute configurado pelo mesmo programa, &eacute; alterado repentinamente
durante a opera&ccedil;&atilde;o, ..........
</p>
<p style="margin-bottom: 0in;"> Caso fosse realmente necess&aacute;rio, poderia ser
algo como pwm.gettimerclock(id) ou quem sabe (isso deve ser mais
discutido.....)
</p>
<p style="margin-bottom: 0in;"> <br>
</p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<p style="margin-bottom: 0in;"> <br>
</p>
<big><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br style="font-family: Helvetica,Arial,sans-serif;">
<br style="font-family: Helvetica,Arial,sans-serif;">
<br style="font-family: Helvetica,Arial,sans-serif;">
<span style="font-family: Helvetica,Arial,sans-serif;">
&nbsp;
</span></big> <br>
<br style="font-family: Verdana;">
</body></html>