Skip to content

Commit 38338fe

Browse files
Sergey Pluzhnikovchris-durand
authored andcommitted
STM32: Add isEnabled() function to all timers
1 parent c6d9aa7 commit 38338fe

File tree

7 files changed

+33
-0
lines changed

7 files changed

+33
-0
lines changed

src/modm/platform/timer/stm32/advanced.cpp.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ modm::platform::Timer{{ id }}::disable()
3333
Rcc::disable<Peripheral::Tim{{id}}>();
3434
}
3535

36+
bool
37+
modm::platform::Timer{{ id }}::isEnabled()
38+
{
39+
return Rcc::isEnabled<Peripheral::Tim{{id}}>();
40+
}
41+
3642
// ----------------------------------------------------------------------------
3743
void
3844
modm::platform::Timer{{ id }}::setMode(Mode mode, SlaveMode slaveMode,

src/modm/platform/timer/stm32/advanced.hpp.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public:
9292
static void
9393
disable();
9494

95+
static bool
96+
isEnabled();
97+
9598
static inline void
9699
pause()
97100
{

src/modm/platform/timer/stm32/basic.cpp.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ modm::platform::Timer{{ id }}::disable()
3232
Rcc::disable<Peripheral::Tim{{id}}>();
3333
}
3434

35+
bool
36+
modm::platform::Timer{{ id }}::isEnabled()
37+
{
38+
return Rcc::isEnabled<Peripheral::Tim{{id}}>();
39+
}
40+
3541
void
3642
modm::platform::Timer{{ id }}::setMode(Mode mode)
3743
{

src/modm/platform/timer/stm32/basic.hpp.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public:
7070
static void
7171
disable();
7272

73+
static bool
74+
isEnabled();
75+
7376
static inline void
7477
pause()
7578
{

src/modm/platform/timer/stm32/basic_base.hpp.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ public:
9191
static void
9292
disable();
9393

94+
/**
95+
* Check, whether clock has been enabled.
96+
*/
97+
static bool
98+
isEnabled();
99+
94100
/**
95101
* Pause timer operation
96102
*

src/modm/platform/timer/stm32/general_purpose.cpp.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ modm::platform::Timer{{ id }}::disable()
4040
Rcc::disable<Peripheral::Tim{{id}}>();
4141
}
4242

43+
bool
44+
modm::platform::Timer{{ id }}::isEnabled()
45+
{
46+
return Rcc::isEnabled<Peripheral::Tim{{id}}>();
47+
}
48+
4349
// ----------------------------------------------------------------------------
4450
void
4551
modm::platform::Timer{{ id }}::setMode(Mode mode, SlaveMode slaveMode,

src/modm/platform/timer/stm32/general_purpose.hpp.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ public:
137137
static void
138138
disable();
139139

140+
static bool
141+
isEnabled();
142+
140143
static inline void
141144
pause()
142145
{

0 commit comments

Comments
 (0)