Clock Control question


Steven Ghekiere <steven.ghekiere@...>
 

Hi!


First off, best wishes for 2021! :)


I've been struggling with using a Clock control. My aim is to be able to calibrate two clocks using BLE and nordic nrf52840 chipsets. 


I've looked through the Clock Control API and found the relevant device binding. 

But now I'm supposed to use a "clock_control_subsys_t​" struct which "is a type to identify a clock controller sub-system". A bit vague but I think I understand it. 


However I'm not sure how I can initialize this variable? Using this without any initialization results in an error when calling "clock_control_on​". Or maybe is my device binding "DT_LABEL(DT_INST(0, nordic_nrf_clock))" wrong? I found this in a couple related tests I think...


Also, since I'm using a Nordic device I assume I'm able to include the <include/drivers/clock_control/clock_control_​nrf.h>.

Since there isn't an example for this (there is for litex, which I'm not familiar with), I'm not too sure how the original Clock Control and the Nordic Clock Control work with each other.

The litex example also use totally different structs which makes me believe this isn't worth looking into.


So to sum up,


1) How do I setup the Clock? Am I doing something wrong? I can send snippets if needed.


2) How should I use both nRF and normal Clock Control?


3) How can I 'extract' the clock value (to send it using Bluetooth) and set it on the receiving end.


Greatly appreciated,


Steven

Join users@lists.zephyrproject.org to automatically receive all group messages.