aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-08-30 13:54:04 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-08-30 13:54:04 +0000
commite40ae9763814661fa99e2b546e4f2562fb48650b (patch)
treef3157c29964739ef5e7fcc46688861d63c5b9313 /testhal
parenta2ee0679d1525a80cdaccc020413bfbb61d9b070 (diff)
downloadChibiOS-e40ae9763814661fa99e2b546e4f2562fb48650b.tar.gz
ChibiOS-e40ae9763814661fa99e2b546e4f2562fb48650b.tar.bz2
ChibiOS-e40ae9763814661fa99e2b546e4f2562fb48650b.zip
Enhanced PWM driver
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7208 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r--testhal/STM32/STM32F0xx/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32F1xx/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32F30x/PWM-ICU/debug/STM32F30x-PWM_ICU (OpenOCD, Flash and Run).launch52
-rw-r--r--testhal/STM32/STM32F30x/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32F37x/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32F4xx/PWM-ICU/main.c2
-rw-r--r--testhal/STM32/STM32L1xx/PWM-ICU/.cproject1
-rw-r--r--testhal/STM32/STM32L1xx/PWM-ICU/main.c2
8 files changed, 65 insertions, 0 deletions
diff --git a/testhal/STM32/STM32F0xx/PWM-ICU/main.c b/testhal/STM32/STM32F0xx/PWM-ICU/main.c
index fa4c4de8c..661635c95 100644
--- a/testhal/STM32/STM32F0xx/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F0xx/PWM-ICU/main.c
@@ -94,6 +94,7 @@ int main(void) {
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD1, &pwmcfg);
+ pwmEnablePeriodicNotification(&PWMD1);
palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(2));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1));
@@ -104,6 +105,7 @@ int main(void) {
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
+ pwmEnableChannelNotification(&PWMD1, 0);
chThdSleepMilliseconds(5000);
/*
diff --git a/testhal/STM32/STM32F1xx/PWM-ICU/main.c b/testhal/STM32/STM32F1xx/PWM-ICU/main.c
index eecd5b2ad..92805fec4 100644
--- a/testhal/STM32/STM32F1xx/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F1xx/PWM-ICU/main.c
@@ -92,6 +92,7 @@ int main(void) {
* Initializes the PWM driver 1 and ICU driver 4.
*/
pwmStart(&PWMD1, &pwmcfg);
+ pwmEnablePeriodicNotification(&PWMD1);
palSetPadMode(IOPORT1, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
icuStart(&ICUD4, &icucfg);
icuEnable(&ICUD4);
@@ -101,6 +102,7 @@ int main(void) {
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
+ pwmEnableChannelNotification(&PWMD1, 0);
chThdSleepMilliseconds(5000);
/*
diff --git a/testhal/STM32/STM32F30x/PWM-ICU/debug/STM32F30x-PWM_ICU (OpenOCD, Flash and Run).launch b/testhal/STM32/STM32F30x/PWM-ICU/debug/STM32F30x-PWM_ICU (OpenOCD, Flash and Run).launch
new file mode 100644
index 000000000..3b55accd1
--- /dev/null
+++ b/testhal/STM32/STM32F30x/PWM-ICU/debug/STM32F30x-PWM_ICU (OpenOCD, Flash and Run).launch
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
+<stringAttribute key="bad_container_name" value="\STM32F30x-PWM-ICU\debug"/>
+<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="1"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20&#13;&#10;monitor reset init&#13;&#10;monitor sleep 50&#13;&#10;"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
+<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
+<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
+<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
+<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList/&gt;"/>
+<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;globalVariableList/&gt;&#13;&#10;"/>
+<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList/&gt;&#13;&#10;"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32F30x-PWM-ICU"/>
+<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="0.1093754934"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/STM32F30x-PWM-ICU"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+</launchConfiguration>
diff --git a/testhal/STM32/STM32F30x/PWM-ICU/main.c b/testhal/STM32/STM32F30x/PWM-ICU/main.c
index 96444baef..f0af2504a 100644
--- a/testhal/STM32/STM32F30x/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F30x/PWM-ICU/main.c
@@ -89,6 +89,7 @@ int main(void) {
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD4, &pwmcfg);
+ pwmEnablePeriodicNotification(&PWMD4);
palSetPadMode(GPIOD, 12, PAL_MODE_ALTERNATE(2));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
@@ -99,6 +100,7 @@ int main(void) {
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD4, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD4, 7500));
+ pwmEnableChannelNotification(&PWMD4, 0);
chThdSleepMilliseconds(5000);
/*
diff --git a/testhal/STM32/STM32F37x/PWM-ICU/main.c b/testhal/STM32/STM32F37x/PWM-ICU/main.c
index ccc877f3f..0178af14a 100644
--- a/testhal/STM32/STM32F37x/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F37x/PWM-ICU/main.c
@@ -89,6 +89,7 @@ int main(void) {
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD5, &pwmcfg);
+ pwmEnablePeriodicNotification(&PWMD5);
palSetPadMode(GPIOC, 0, PAL_MODE_ALTERNATE(2));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
@@ -99,6 +100,7 @@ int main(void) {
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD5, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD5, 7500));
+ pwmEnableChannelNotification(&PWMD5, 0);
chThdSleepMilliseconds(5000);
/*
diff --git a/testhal/STM32/STM32F4xx/PWM-ICU/main.c b/testhal/STM32/STM32F4xx/PWM-ICU/main.c
index a964d221e..64da60b1d 100644
--- a/testhal/STM32/STM32F4xx/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F4xx/PWM-ICU/main.c
@@ -89,6 +89,7 @@ int main(void) {
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD1, &pwmcfg);
+ pwmEnablePeriodicNotification(&PWMD1);
palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(1));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
@@ -99,6 +100,7 @@ int main(void) {
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
+ pwmEnableChannelNotification(&PWMD1, 0);
chThdSleepMilliseconds(5000);
/*
diff --git a/testhal/STM32/STM32L1xx/PWM-ICU/.cproject b/testhal/STM32/STM32L1xx/PWM-ICU/.cproject
index b96ec18ee..077ea250c 100644
--- a/testhal/STM32/STM32L1xx/PWM-ICU/.cproject
+++ b/testhal/STM32/STM32L1xx/PWM-ICU/.cproject
@@ -48,4 +48,5 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="refreshScope"/>
</cproject>
diff --git a/testhal/STM32/STM32L1xx/PWM-ICU/main.c b/testhal/STM32/STM32L1xx/PWM-ICU/main.c
index 9e5955e4a..654f23379 100644
--- a/testhal/STM32/STM32L1xx/PWM-ICU/main.c
+++ b/testhal/STM32/STM32L1xx/PWM-ICU/main.c
@@ -89,6 +89,7 @@ int main(void) {
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD2, &pwmcfg);
+ pwmEnablePeriodicNotification(&PWMD2);
palSetPadMode(GPIOA, 15, PAL_MODE_ALTERNATE(1));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
@@ -99,6 +100,7 @@ int main(void) {
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 7500));
+ pwmEnableChannelNotification(&PWMD2, 0);
chThdSleepMilliseconds(5000);
/*