Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: qonly_controller foc-ed_in_the_bot_compact foc-ed_in_the_bot_compact CurrentModeSine ... more
Fork of FastPWM by
Revision 16:ec208b5ec0bb, committed 2014-10-02
- Comitter:
- jocis
- Date:
- Thu Oct 02 08:09:52 2014 +0000
- Parent:
- 15:49a7eff133b3
- Child:
- 17:8378bc456f0d
- Commit message:
- Added NUCLEO F103RB
Changed in this revision
| Device/FastPWM_STM_TIM_PinOut.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Device/FastPWM_STM_TIM_PinOut.cpp Wed Oct 01 18:20:41 2014 +0000
+++ b/Device/FastPWM_STM_TIM_PinOut.cpp Thu Oct 02 08:09:52 2014 +0000
@@ -26,22 +26,45 @@
#if defined TARGET_NUCLEO_F401RE || defined TARGET_NUCLEO_F411RE
__IO uint32_t* getChannel(TIM_TypeDef* pwm, PinName pin) {
switch (pin) {
- // Channels 1
+ // Channels 1 : PWMx/1
case PA_0: case PA_5: case PA_6: case PA_8: case PA_15: case PB_4: case PB_6: case PC_6: case PA_7: case PB_13:
return &pwm->CCR1;
- // Channels 2
+ // Channels 2 : PWMx/2
case PA_1: case PA_9: case PB_3: case PB_5: case PB_7: case PC_7: case PB_0: case PB_14:
return &pwm->CCR2;
- // Channels 3
+ // Channels 3 : PWMx/3
case PA_2: case PA_10: case PB_8: case PB_10: case PC_8: case PB_1: case PB_15:
return &pwm->CCR3;
- // Channels 4
+ // Channels 4 : PWMx/4
case PA_3: case PA_11: case PB_9: case PC_9:
return &pwm->CCR4;
}
return NULL;
}
+#endif
+
+#if defined TARGET_NUCLEO_F103RB
+__IO uint32_t* getChannel(TIM_TypeDef* pwm, PinName pin) {
+ switch (pin) {
+ // Channels 1 : PWMx/1
+ case PA_6: case PA_8: case PA_15: case PB_4: case PC_6: case PB_13:
+ return (uint32_t*)&pwm->CCR1;
+
+ // Channels 2 : PWMx/2
+ case PA_1: case PA_7: case PA_9: case PB_3: case PB_5: case PC_7: case PB_14:
+ return (uint32_t*)&pwm->CCR2;
+
+ // Channels 3 : PWMx/3
+ case PA_2: case PA_10: case PB_0: case PB_10: case PC_8: case PB_15:
+ return (uint32_t*)&pwm->CCR3;
+
+ // Channels 4 : PWMx/4
+ case PA_3: case PA_11: case PB_1: case PB_11: case PC_9:
+ return (uint32_t*)&pwm->CCR4;
+ }
+ return NULL;
+}
#endif
\ No newline at end of file
