[riot-notifications] [RIOT-OS/RIOT] cc26x2_cc13x2: add oscillator switching functions (#13991)

Jean Pierre Dudey notifications at github.com
Sat May 2 20:09:13 CEST 2020


@jeandudey commented on this pull request.



> +           DDI_0_OSC_STAT0_SCLK_HF_SRC_s;
+}
+
+static inline void _hf_source_set(uint32_t osc)
+{
+    uint32_t mask = DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_m;
+    uint32_t ctl = osc << DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_s;
+
+    /* Use a 16-bit masked write, target bits are on the lower 16-bit
+     * half */
+    DDI_0_OSC_M16->CTL0.LOW = (mask << 16) | ctl;
+}
+
+void osc_hf_source_switch(uint32_t osc)
+{
+    if (_hf_source_get() == osc) {

Oops, wrong logic, I'll fix it.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13991#discussion_r418989472
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200502/c27c9966/attachment.htm>


More information about the notifications mailing list