summaryrefslogtreecommitdiffstats
path: root/apps/examples/pwm
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-15 22:31:05 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-15 22:31:05 +0000
commit3a4ec3a93203f710ed190244ef98dd544f718b3b (patch)
tree9d64c8ce61b033c342fe18c118e47469098b3720 /apps/examples/pwm
parent184a2a43e3cb1c86f7eadf915a9f584715e82d35 (diff)
Add a watchdog timer test
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4614 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/pwm')
-rw-r--r--apps/examples/pwm/Kconfig35
-rw-r--r--apps/examples/pwm/Makefile4
-rw-r--r--apps/examples/pwm/pwm.h12
3 files changed, 43 insertions, 8 deletions
diff --git a/apps/examples/pwm/Kconfig b/apps/examples/pwm/Kconfig
index 593136f265..78edd2178c 100644
--- a/apps/examples/pwm/Kconfig
+++ b/apps/examples/pwm/Kconfig
@@ -6,8 +6,43 @@
config EXAMPLES_PWM
bool "Pulse width modulation (PWM) example"
default n
+ depends on PWM && NSH_BUILTIN_APPS
---help---
Enable the Pulse width modulation (PWM) example
if EXAMPLES_PWM
+
+config EXAMPLES_PWM_DEVPATH
+ string "PWM device path"
+ default "/dev/pwm0"
+ ---help---
+ The path to the PWM device. Default: /dev/pwm0
+
+config EXAMPLES_PWM_FREQUENCY
+ int "Default PWM freququency"
+ default 100
+ ---help---
+ The default PWM frequency. Default: 100 Hz
+
+config EXAMPLES_PWM_DUTYPCT
+ int "Default PWM duty percentage"
+ default 50
+ ---help---
+ The default PWM duty as a percentage. Default: 50%
+
+config EXAMPLES_PWM_DURATION
+ int "Default PWM duration"
+ default 5 if !EXAMPLES_PWM_PULSECOUNT
+ ---help---
+ The default PWM pulse train duration in seconds. Used only if the current
+ pulse count is zero (pulse countis only supported if CONFIG_PWM_PULSECOUNT
+ is defined). Default: 5 seconds
+
+config EXAMPLES_PWM_PULSECOUNT
+ int "Default pulse count"
+ default 0
+ ---help---
+ The initial PWM pulse count. This option is only available if CONFIG_PWM_PULSECOUNT
+ is nonzero. Default: 0 (i.e., use the duration, not the count).
+
endif
diff --git a/apps/examples/pwm/Makefile b/apps/examples/pwm/Makefile
index 3c9c243cbd..efbdb048e0 100644
--- a/apps/examples/pwm/Makefile
+++ b/apps/examples/pwm/Makefile
@@ -37,7 +37,7 @@
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
-# NuttX NX Graphics Example.
+# PWM Example.
ASRCS =
CSRCS = pwm_main.c
@@ -56,7 +56,7 @@ endif
ROOTDEPPATH = --dep-path .
-# Touchscreen built-in application info
+# PWM built-in application info
APPNAME = pwm
PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/apps/examples/pwm/pwm.h b/apps/examples/pwm/pwm.h
index e15b933fcf..5c049a8f8f 100644
--- a/apps/examples/pwm/pwm.h
+++ b/apps/examples/pwm/pwm.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * examples/examples/pwm.h
+ * examples/examples/pwm/pwm.h
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -52,10 +52,10 @@
* CONFIG_EXAMPLES_PWM_DEVPATH - The path to the PWM device. Default: /dev/pwm0
* CONFIG_EXAMPLES_PWM_FREQUENCY - The initial PWM frequency. Default: 100 Hz
* CONFIG_EXAMPLES_PWM_DUTYPCT - The initial PWM duty as a percentage. Default: 50%
- * CONFIG_EXAMPLES_PWM_DURATION - The initial PWM pulse train duration in sectonds.
- * as a percentage. Used only if the current pulse count is zero (pulse count
- * is only supported if CONFIG_PWM_PULSECOUNT is defined). Default: 5 seconds
- * CONFIG_EXAMPLES_PWM_COUNT - The initial PWM pulse count. This option is
+ * CONFIG_EXAMPLES_PWM_DURATION - The initial PWM pulse train duration in seconds.
+ * Used only if the current pulse count is zero (pulse count is only supported
+ * if CONFIG_PWM_PULSECOUNT is defined). Default: 5 seconds
+ * CONFIG_EXAMPLES_PWM_PULSECOUNT - The initial PWM pulse count. This option is
* only available if CONFIG_PWM_PULSECOUNT is defined. Default: 0 (i.e., use
* the duration, not the count).
*/