How to call "clock_control_off(const struct device *dev, clock_control_subsys_t sys)" on LFCLK

Hi,

If i need to call zephyr driver API clock_control_off( ) present in zephyr\include\drivers\clock_control.h on LFCLK.
How can I do it,.?

As an example, to populate the argument '*dev' in 

clock_control_off(const struct device *dev, clock_control_subsys_t sys)


Do I Use something like:

	const struct device *clock;
	
	clock = device_get_binding("CLOCK");

Will this give me dev struct to LFCLK..?
And how do I populate for:

clock_control_subsys_t sys

for LFCLK.

Kindly suggest.

Thanks,

Parents Reply Children
  • Hello Priyanka,

    Thank you, this helps.
    Please find as in the clock tree for my nRF board:

    Now, moving ahead, suppose that if I want to use PCLK16M from HFCLK for a peripheral, how can I get that..?


    Similarly, if I want to use PCLK32KI from LFCLK for a timer perhaps, how can I get that frequency..?

  • Hi,

    It is possible like we mentioned earlier, to turn on the HFCLK or turn off the LFCLK (which is not recommended as it will result in an error), but you do not specify the frequency requirement. You can only specify or configure the source of your clock, i.e. external crystal, internal RC, etc.

    Depending on your requirement, the system will automatically assign the required, based on your peripheral. 

    The peripherals connected will automatically request the required clock type from the CLOCK peripheral based on the configuration of the peripheral. This can be seen mentioned in the CLOCK chapter

    I hope this answers your doubts related to the ticket and in case of any different queries kindly open a new ticket.

    Kind Regards,

    Priyanka

Related