Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3_cpp_extensions.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisin Dmitriy <d.lisin@thirdpin.ru>2019-03-21 15:11:48 +0300
committerLisin Dmitriy <d.lisin@thirdpin.ru>2019-03-21 15:11:48 +0300
commit09bbf88acd44c6ffb6f2c896865df261133122e4 (patch)
treeb87f502fa0d9e6f586ca15829a077d5421656755
parent4d7ccd7aade6bf647723dd04a47c7e80b4b82417 (diff)
IMPR: Add more master modes
-rw-r--r--cm3cpp_timer.cpp10
-rw-r--r--cm3cpp_timer.h21
2 files changed, 21 insertions, 10 deletions
diff --git a/cm3cpp_timer.cpp b/cm3cpp_timer.cpp
index 95ac204..adde1f5 100644
--- a/cm3cpp_timer.cpp
+++ b/cm3cpp_timer.cpp
@@ -223,7 +223,15 @@ auto Timer::set_master_mode(MasterMode mode) -> Result
TIM_CR2(_timer) = (TIM_CR2(_timer) & ~TIM_CR2_MMS_MASK) |
TIM_CR2_MMS_COMPARE_OC2REF ;
break;
- }
+ case COMPARE_OC3REF:
+ TIM_CR2(_timer) = (TIM_CR2(_timer) & ~TIM_CR2_MMS_MASK) |
+ TIM_CR2_MMS_COMPARE_OC3REF;
+ break;
+ case COMPARE_OC4REF:
+ TIM_CR2(_timer) = (TIM_CR2(_timer) & ~TIM_CR2_MMS_MASK) |
+ TIM_CR2_MMS_COMPARE_OC4REF;
+ break;
+ }
return OK;
}
diff --git a/cm3cpp_timer.h b/cm3cpp_timer.h
index 11f4873..5392020 100644
--- a/cm3cpp_timer.h
+++ b/cm3cpp_timer.h
@@ -70,16 +70,19 @@ public:
TIMER_CLOCK_MUL_4
};
- enum MasterMode {
- MASTER_RESET,
- ENABLE,
- UPDATE,
- COMPARE_PULSE,
- COMPARE_OC1REF,
- COMPARE_OC2REF
- };
+ enum MasterMode
+ {
+ MASTER_RESET,
+ ENABLE,
+ UPDATE,
+ COMPARE_PULSE,
+ COMPARE_OC1REF,
+ COMPARE_OC2REF,
+ COMPARE_OC3REF,
+ COMPARE_OC4REF,
+ };
- enum SlaveMode {
+ enum SlaveMode {
DISABLED,
SLAVE_RESET,
GATED,