12#ifndef _INCLUDE_ZEPHYR_DRIVERS_CLOCK_CONTROL_SF32LB_H_
13#define _INCLUDE_ZEPHYR_DRIVERS_CLOCK_CONTROL_SF32LB_H_
41#define SF32LB_CLOCK_DT_SPEC_GET(node_id) \
43 .dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(node_id)), \
44 .id = DT_CLOCKS_CELL(node_id, id), \
53#define SF32LB_CLOCK_DT_SPEC_GET_OR(node_id, default_spec) \
54 COND_CODE_1(DT_CLOCKS_HAS_IDX(node_id, 0), \
55 (SF32LB_CLOCK_DT_SPEC_GET(node_id)), (default_spec))
62#define SF32LB_CLOCK_DT_INST_SPEC_GET(index) SF32LB_CLOCK_DT_SPEC_GET(DT_DRV_INST(index))
69#define SF32LB_CLOCK_DT_INST_PARENT_SPEC_GET(index) \
71 .dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_INST_PARENT(index))), \
72 .id = DT_CLOCKS_CELL(DT_INST_PARENT(index), id), \
81#define SF32LB_CLOCK_DT_INST_SPEC_GET_OR(index, default_spec) \
82 SF32LB_CLOCK_DT_SPEC_GET_OR(DT_DRV_INST(index), default_spec)
Main header file for clock control driver API.
Clocks Devicetree macro public API header file.
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.
Definition clock_control.h:276
static enum clock_control_status clock_control_get_status(const struct device *dev, clock_control_subsys_t sys)
Get clock status.
Definition clock_control.h:252
void * clock_control_subsys_t
Opaque handle identifying a clock controller subsystem.
Definition clock_control.h:65
clock_control_status
Current clock status.
Definition clock_control.h:52
static int clock_control_off(const struct device *dev, clock_control_subsys_t sys)
Disable a clock controlled by the device.
Definition clock_control.h:201
static int clock_control_on(const struct device *dev, clock_control_subsys_t sys)
Enable a clock controlled by the device.
Definition clock_control.h:179
static int sf32lb_clock_control_off_dt(const struct sf32lb_clock_dt_spec *spec)
Turn off a clock using a sf32lb_clock_dt_spec structure.
Definition sf32lb.h:113
static int sf32lb_clock_control_on_dt(const struct sf32lb_clock_dt_spec *spec)
Turn on a clock using a sf32lb_clock_dt_spec structure.
Definition sf32lb.h:102
static enum clock_control_status sf32lb_clock_control_get_status_dt(const struct sf32lb_clock_dt_spec *spec)
Get the status of a clock using a sf32lb_clock_dt_spec structure.
Definition sf32lb.h:124
static uint32_t sf32lb_clock_control_get_rate_dt(const struct sf32lb_clock_dt_spec *spec, uint32_t *rate)
Get the clock rate using a sf32lb_clock_dt_spec structure.
Definition sf32lb.h:138
static bool sf32lb_clock_is_ready_dt(const struct sf32lb_clock_dt_spec *spec)
Check if the clock device is ready.
Definition sf32lb.h:91
bool device_is_ready(const struct device *dev)
Verify that a device is ready for use.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
SF32LB Clock DT spec.
Definition sf32lb.h:29
uint16_t id
Clock ID.
Definition sf32lb.h:33
const struct device * dev
Clock controller (RCC).
Definition sf32lb.h:31