#include <clock_tree.h>
Public Member Functions | |
void | Acquire (ElementNonBlockingCannotFail &element) |
Status | Acquire (ElementNonBlockingMightFail &element) |
Status | Acquire (ElementBlocking &element) |
Status | Acquire (Element &element) |
Status | AcquireWith (Element &element, Element &element_with) |
void | Release (ElementNonBlockingCannotFail &element) |
Status | Release (ElementNonBlockingMightFail &element) |
Status | Release (ElementBlocking &element) |
Status | Release (Element &element) |
void | SetDividerValue (ClockDividerNonBlockingCannotFail &clock_divider, uint32_t divider_value) |
Status | SetDividerValue (ClockDividerNonBlockingMightFail &clock_divider, uint32_t divider_value) |
Status | SetDividerValue (ClockDividerBlocking &clock_divider, uint32_t divider_value) |
Status | SetDividerValue (ClockDivider &clock_divider, uint32_t divider_value) |
Protected Attributes | |
sync::Mutex | mutex_ |
mutex_ protects ElementBlocking clock tree elements. | |
sync::InterruptSpinLock | interrupt_spin_lock_ |
Clock tree class that manages the state of clock tree elements.
The ClockTree
provides the Acquire
and Release
methods to acquire a reference to ElementNonBlockingCannotFail
, ElementNonBlockingMightFail
, or ElementBlocking
elements or to the generic Element
element. These functions will acquire the proper lock to ensure that clock updates are synchronized.
The SetDividerValue
method allows to change the divider value for ClockDividerNonBlockingCannotFail
, ClockDividerNonBlockingMightFail
or ClockDividerBlocking
elements, or to the generic ClockDivider
element.
Acquire a reference to a clock tree element. Acquiring the clock tree element might fail.
Note: May not be called from inside an interrupt context or with interrupts disabled.
|
inline |
Acquire a reference to a blocking clock tree element. Acquiring the clock tree element might fail.
|
inline |
Acquire a reference to a non-blocking clock tree element. Acquiring the clock tree element will succeed.
|
inline |
Acquire a reference to a non-blocking clock tree element. Acquiring the clock tree element might fail.
Acquire a reference to clock tree element element
while element_with
clock tree is enabled. Acquiring the clock tree element might fail.
This is useful when dealing with synchronized clock muxes where, in order to switch to a new clock source, both the old and new clock must be running. This ensures that the old clock source (element_with
) is running before attempting to activate the new clock source (element
).
Note: May not be called from inside an interrupt context or with interrupts disabled.
Release a reference to a clock tree element. Releasing the clock tree element might fail.
Note: May not be called from inside an interrupt context or with interrupts disabled.
|
inline |
Release a reference to a blocking clock tree element. Releasing the clock tree element might fail.
|
inline |
Release a reference to a non-blocking clock tree element. Releasing the clock tree element will succeed.
|
inline |
Release a reference to a non-blocking clock tree element. Releasing the clock tree element might fail.
|
inline |
Set divider value for a clock divider element. Setting the clock divider value might fail.
Note: May not be called from inside an interrupt context or with interrupts disabled.
|
inline |
Set divider value for a blocking clock divider element. Setting the clock divider value might fail.
|
inline |
Set divider value for a non-blocking clock divider element. Setting the clock divider value will succeed.
|
inline |
Set divider value for a non-blocking clock divider element. Setting the clock divider value might fail.
|
protected |
interrupt_spin_lock_
protects ElementNonBlockingCannotFail
and ElementNonBlockingMightFail
clock tree elements.