From 85f98342dd893f9df5c83e031bce562d9c36c034 Mon Sep 17 00:00:00 2001 From: James Snyder Date: Thu, 9 Jul 2009 03:15:38 +0000 Subject: [PATCH] PWM generic doc. --- doc/builddoc.lua | 2 +- doc/luadoc/refman_gen_pwm.lua | 60 +++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 doc/luadoc/refman_gen_pwm.lua diff --git a/doc/builddoc.lua b/doc/builddoc.lua index 20047ef8..96301246 100644 --- a/doc/builddoc.lua +++ b/doc/builddoc.lua @@ -7,7 +7,7 @@ local doc_sections = { "arch_platform", "refman_gen" } local components = { arch_platform = { "ll", "pio", "spi", "uart", "timers", "pwm", "cpu", "eth", "adc" }, - refman_gen = { "bit", "pd", "cpu", "pack", "adc" } + refman_gen = { "bit", "pd", "cpu", "pack", "pwm", "adc" } } -- List here all languages for the documentation (make sure to keep English ("en") the first one) diff --git a/doc/luadoc/refman_gen_pwm.lua b/doc/luadoc/refman_gen_pwm.lua new file mode 100644 index 00000000..656ed48d --- /dev/null +++ b/doc/luadoc/refman_gen_pwm.lua @@ -0,0 +1,60 @@ +-- eLua reference manual - platform data + +data_en = +{ + + -- Title + title = "eLua reference manual - PWM", + + -- Menu name + menu_name = "pwm", + + -- Overview + overview = [[This module contains functions that control pulse-width modulation (PWM) peripherals.]], + + -- Functions + funcs = + { + { sig = "realfrequency = #pwm.setup#( id, frequency, duty )", + desc = "Configure PWM channel.", + args = + { + "$id$ - PWM channel ID.", + "$frequency$ - Frequency of PWM channel cycle (in hertz).", + "$duty$ - PWM channel duty cycle, specified as percent (from 0 to 100). Note that some platform don't allow the full 0-100 duty cycle" + }, + ret = "$realfrequency$ - actual PWM cycle frequency" + }, + { sig = "#pwm.start#( id )", + desc = "Start PWM waveform generation.", + args = + { + "$id$ - PWM channel ID.", + } + }, + { sig = "#pwm.stop#( id )", + desc = "Stop PWM waveform generation.", + args = + { + "$id$ - PWM channel ID.", + } + }, + { sig = "realfrequency = #pwm.setclock#( id, clock )", + desc = "Set base PWM clock frequency", + args = + { + "$id$ - PWM channel ID.", + "$clock$ - Frequency of base clock.", + }, + ret = "$realfrequency$ - actual base PWM clock." + }, + { sig = "clock = #pwm.getclock#( id )", + desc = "Get base PWM clock frequency", + args = + { + "$id$ - PWM channel ID.", + }, + ret = "$clock$ - base PWM clock." + }, + }, +} \ No newline at end of file