Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
clock_control.h File Reference

Public Clock Control APIs. More...

#include <errno.h>
#include <stddef.h>
#include <zephyr/types.h>
#include <zephyr/device.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/slist.h>

Go to the source code of this file.

Data Structures

struct  clock_control_driver_api
 

Macros

#define CLOCK_CONTROL_SUBSYS_ALL   NULL
 

Typedefs

typedef void * clock_control_subsys_t
 clock_control_subsys_t is a type to identify a clock controller sub-system.
 
typedef void * clock_control_subsys_rate_t
 clock_control_subsys_rate_t is a type to identify a clock controller sub-system rate.
 
typedef void(* clock_control_cb_t) (const struct device *dev, clock_control_subsys_t subsys, void *user_data)
 Callback called on clock started.
 
typedef int(* clock_control) (const struct device *dev, clock_control_subsys_t sys)
 
typedef int(* clock_control_get) (const struct device *dev, clock_control_subsys_t sys, uint32_t *rate)
 
typedef int(* clock_control_async_on_fn) (const struct device *dev, clock_control_subsys_t sys, clock_control_cb_t cb, void *user_data)
 
typedef enum clock_control_status(* clock_control_get_status_fn) (const struct device *dev, clock_control_subsys_t sys)
 
typedef int(* clock_control_set) (const struct device *dev, clock_control_subsys_t sys, clock_control_subsys_rate_t rate)
 
typedef int(* clock_control_configure_fn) (const struct device *dev, clock_control_subsys_t sys, void *data)
 

Enumerations

enum  clock_control_status { CLOCK_CONTROL_STATUS_STARTING , CLOCK_CONTROL_STATUS_OFF , CLOCK_CONTROL_STATUS_ON , CLOCK_CONTROL_STATUS_UNKNOWN }
 Current clock status. More...
 

Functions

static int clock_control_on (const struct device *dev, clock_control_subsys_t sys)
 Enable a clock controlled by the device.
 
static int clock_control_off (const struct device *dev, clock_control_subsys_t sys)
 Disable a clock controlled by the device.
 
static int clock_control_async_on (const struct device *dev, clock_control_subsys_t sys, clock_control_cb_t cb, void *user_data)
 Request clock to start with notification when clock has been started.
 
static enum clock_control_status clock_control_get_status (const struct device *dev, clock_control_subsys_t sys)
 Get clock status.
 
static int clock_control_get_rate (const struct device *dev, clock_control_subsys_t sys, uint32_t *rate)
 Obtain the clock rate of given sub-system.
 
static int clock_control_set_rate (const struct device *dev, clock_control_subsys_t sys, clock_control_subsys_rate_t rate)
 Set the rate of the clock controlled by the device.
 
static int clock_control_configure (const struct device *dev, clock_control_subsys_t sys, void *data)
 Configure a source clock.
 

Detailed Description

Public Clock Control APIs.