Clock Control Interface.
More...
Clock Control Interface.
◆ CLOCK_CONTROL_SUBSYS_ALL
#define CLOCK_CONTROL_SUBSYS_ALL NULL |
◆ clock_control
◆ clock_control_async_on_fn
◆ clock_control_cb_t
#include <include/drivers/clock_control.h>
Callback called on clock started.
- Parameters
-
dev | Device structure whose driver controls the clock. |
subsys | Opaque data representing the clock. |
user_data | User data. |
◆ clock_control_get
◆ clock_control_get_status_fn
◆ clock_control_subsys_t
#include <include/drivers/clock_control.h>
clock_control_subsys_t is a type to identify a clock controller sub-system. Such data pointed is opaque and relevant only to the clock controller driver instance being used.
◆ clock_control_status
#include <include/drivers/clock_control.h>
Current clock status.
Enumerator |
---|
CLOCK_CONTROL_STATUS_STARTING | |
CLOCK_CONTROL_STATUS_OFF | |
CLOCK_CONTROL_STATUS_ON | |
CLOCK_CONTROL_STATUS_UNAVAILABLE | |
CLOCK_CONTROL_STATUS_UNKNOWN | |
◆ clock_control_async_on()
#include <include/drivers/clock_control.h>
Request clock to start with notification when clock has been started.
Function is non-blocking and can be called from any context. User callback is called when clock is started.
- Parameters
-
dev | Device. |
sys | A pointer to an opaque data representing the sub-system. |
cb | Callback. |
user_data | User context passed to the callback. |
- Return values
-
0 | if start is successfully initiated. |
-EALREADY | if clock was already started and is starting or running. |
-ENOTSUP | If the requested mode of operation is not supported. |
-ENOSYS | if the interface is not implemented. |
other | negative errno on vendor specific error. |
◆ clock_control_get_rate()
#include <include/drivers/clock_control.h>
Obtain the clock rate of given sub-system.
- Parameters
-
| dev | Pointer to the device structure for the clock controller driver instance |
| sys | A pointer to an opaque data representing the sub-system |
[out] | rate | Subsystem clock rate |
◆ clock_control_get_status()
#include <include/drivers/clock_control.h>
Get clock status.
- Parameters
-
dev | Device. |
sys | A pointer to an opaque data representing the sub-system. |
- Returns
- Status.
◆ clock_control_off()
#include <include/drivers/clock_control.h>
Disable a clock controlled by the device.
This function is non-blocking and can be called from any context. On success, the clock is disabled when this function returns.
- Parameters
-
dev | Device structure whose driver controls the clock |
sys | Opaque data representing the clock |
- Returns
- 0 on success, negative errno on failure.
◆ clock_control_on()
#include <include/drivers/clock_control.h>
Enable a clock controlled by the device.
On success, the clock is enabled and ready when this function returns. This function may sleep, and thus can only be called from thread context.
Use clock_control_async_on() for non-blocking operation.
- Parameters
-
dev | Device structure whose driver controls the clock. |
sys | Opaque data representing the clock. |
- Returns
- 0 on success, negative errno on failure.