Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
clock_control.h File Reference

Public Clock Control APIs. More...

#include <zephyr/types.h>
#include <stddef.h>
#include <device.h>
#include <sys/__assert.h>
#include <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 voidclock_control_subsys_t
 
typedef void(* clock_control_cb_t) (const struct device *dev, clock_control_subsys_t subsys, void *user_data)
 Callback called on clock started. More...
 
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)
 

Enumerations

enum  clock_control_status {
  CLOCK_CONTROL_STATUS_STARTING , CLOCK_CONTROL_STATUS_OFF , CLOCK_CONTROL_STATUS_ON , CLOCK_CONTROL_STATUS_UNAVAILABLE ,
  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. More...
 
static int clock_control_off (const struct device *dev, clock_control_subsys_t sys)
 Disable a clock controlled by the device. More...
 
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. More...
 
static enum clock_control_status clock_control_get_status (const struct device *dev, clock_control_subsys_t sys)
 Get clock status. More...
 
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. More...
 

Detailed Description

Public Clock Control APIs.