2009-02-21 23:02:39 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
< html > < head >
< meta http-equiv = "content-type" content = "text/html; charset=ISO-8859-1" >
2009-06-29 16:43:45 +00:00
< meta http-equiv = "Content-Language" content = "en-us" > < title > Produto< / title >
2009-02-21 23:02:39 +00:00
< 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 >
2009-06-29 16:43:45 +00:00
< 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ã o.< / font >
2009-02-21 23:02:39 +00:00
< / 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 ) < / font > < font face = "Bitstream Vera Sans Mono, sans-serif" >
2009-06-29 16:43:45 +00:00
Data = pwm.setup( id, frequency, duty ): configura o 'id' do bloco PWM para
gerar a frequê ncia especificada com o ciclo 'duty' especificado (duty é
um nú mero inteiro entre 0 e 100, indicando o percentual a ser
utilizado). Ela retorna a frequê ncia real configurada no bloco PWM.< / font >
2009-02-21 23:02:39 +00:00
< / p >
< p style = "margin-bottom: 0in;" >
< / p >
< p style = "margin-bottom: 0in;" > < br >
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > Aqui existe uma enorme
mudanç a na proposta.
2009-02-21 23:02:39 +00:00
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > O Timer Clock e a frequê ncia
PWM "frame" seriam configurados na mesma funç ã o (.setup)
2009-02-21 23:02:39 +00:00
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > A funç ã o normal de
controle configuraria somente o ciclo ativo (.setcycle)
2009-02-21 23:02:39 +00:00
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > A funç ã o original .setup
seria substituí da por:
2009-02-21 23:02:39 +00:00
< / 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()]
2009-06-29 16:43:45 +00:00
pwm.start( id ): inicia o 'id' do bloco PWM.< / font >
2009-02-21 23:02:39 +00:00
< / 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()]
< / font > < font face = "Bitstream Vera Sans Mono, sans-serif" > pwm.stop(
2009-06-29 16:43:45 +00:00
id ): finaliza o 'id' do bloco PWM.< / font >
2009-02-21 23:02:39 +00:00
< / p >
< br >
< p style = "margin-bottom: 0in;" > < font face = "Bitstream Vera Sans Mono, sans-serif" > < a name = "setclock" > < / a > Data = pwm.setclock( id, clock ):
2009-06-29 16:43:45 +00:00
configura o clock base do 'id' do bloco PWM para< / font >
2009-02-21 23:02:39 +00:00
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > < font face = "Bitstream Vera Sans Mono, sans-serif" > o clock informado.
Retorna o clock corrente do bloco PWM.< / font >
2009-02-21 23:02:39 +00:00
< / 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
2009-06-29 16:43:45 +00:00
= pwm.getclock( id ): retorna o clock base do 'id' do bloco PWM.< / font >
2009-02-21 23:02:39 +00:00
< / p >
< p style = "margin-bottom: 0in;" >
< / p >
< p style = "margin-bottom: 0in;" > < br >
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > Realmente é necessá rio
existir
.getclock ?? O clock & eacute configurado pelo mesmo programa, é alterado repentinamente
durante a operaç ã o, ..........
2009-02-21 23:02:39 +00:00
< / p >
2009-06-29 16:43:45 +00:00
< p style = "margin-bottom: 0in;" > Caso fosse realmente necessá rio, poderia ser
algo como pwm.gettimerclock(id) ou quem sabe (isso deve ser mais
discutido.....)
2009-02-21 23:02:39 +00:00
< / 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;" >
< / span > < / big > < br >
< br style = "font-family: Verdana;" >
2009-06-29 16:43:45 +00:00
< / body > < / html >