RT-Thread RTOS
An open source embedded real-time operating system
rt_clk_node Struct Reference

#include <clk.h>

Detailed Description

Clock provider node - represents a hardware clock controller.

A rt_clk_node corresponds to one hardware clock provider in the system, such as a PLL controller, a clock multiplexer, or a composite clock block defined in the device tree.

Each clock node may contain multiple hardware clock outputs, described as rt_clk_cell structures, which represent individual leaf clocks.

Members:

  • parent — embedded rt_object header for RT-Thread object system.
  • dev — back-reference to the hardware device providing this clock domain.
  • parents_clk — optional array of parent clock handles.
  • multi_clk — number of clock outputs exported by this provider.
  • cells — list of rt_clk_cell pointers representing each output.
  • ofw_parse — callback used to parse clock arguments from device tree (#clock-cells) and select the corresponding rt_clk_cell.
  • priv — implementation-specific private data.

Typical usage:

  1. Define a rt_clk_node describing the hardware clock controller.
  2. Implement ofw_parse() to resolve device tree phandle arguments.
  3. Register the node using rt_clk_register().