File tree Expand file tree Collapse file tree 3 files changed +20
-19
lines changed
include/zephyr/drivers/clock_control Expand file tree Collapse file tree 3 files changed +20
-19
lines changed Original file line number Diff line number Diff line change 33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
6+ #include <soc.h>
67#include <zephyr/drivers/counter.h>
78#include <zephyr/drivers/clock_control/nrf_clock_control.h>
89#include <zephyr/devicetree.h>
Original file line number Diff line number Diff line change @@ -343,25 +343,6 @@ void nrf_clock_control_hfxo_release(void);
343343
344344#endif /* defined(CONFIG_CLOCK_CONTROL_NRF2) */
345345
346- /** @brief Get clock frequency that is used for the given node.
347- *
348- * Macro checks if node has clock property and if yes then if clock has clock_frequency property
349- * then it is returned. If it has supported_clock_frequency property with the list of supported
350- * frequencies then the last one is returned with assumption that they are ordered and the last
351- * one is the highest. If node does not have clock then 16 MHz is returned which is the default
352- * frequency.
353- *
354- * @param node Devicetree node.
355- *
356- * @return Frequency of the clock that is used for the node.
357- */
358- #define NRF_PERIPH_GET_FREQUENCY (node ) \
359- COND_CODE_1(DT_CLOCKS_HAS_IDX(node, 0), \
360- (COND_CODE_1(DT_NODE_HAS_PROP(DT_CLOCKS_CTLR(node), clock_frequency), \
361- (DT_PROP(DT_CLOCKS_CTLR(node), clock_frequency)), \
362- (DT_PROP_LAST(DT_CLOCKS_CTLR(node), supported_clock_frequency)))), \
363- (NRFX_MHZ_TO_HZ(16)))
364-
365346#ifdef __cplusplus
366347}
367348#endif
Original file line number Diff line number Diff line change 236236 DT_PINCTRL_HAS_NAME(node_id, sleep), \
237237 DT_NODE_PATH(node_id) " defined without sleep state")
238238
239+ /** @brief Get clock frequency that is used for the given node.
240+ *
241+ * Macro checks if node has clock property and if yes then if clock has clock_frequency property
242+ * then it is returned. If it has supported_clock_frequency property with the list of supported
243+ * frequencies then the last one is returned with assumption that they are ordered and the last
244+ * one is the highest. If node does not have clock then 16 MHz is returned which is the default
245+ * frequency.
246+ *
247+ * @param node Devicetree node.
248+ *
249+ * @return Frequency of the clock that is used for the node.
250+ */
251+ #define NRF_PERIPH_GET_FREQUENCY (node ) \
252+ COND_CODE_1(DT_CLOCKS_HAS_IDX(node, 0), \
253+ (COND_CODE_1(DT_NODE_HAS_PROP(DT_CLOCKS_CTLR(node), clock_frequency), \
254+ (DT_PROP(DT_CLOCKS_CTLR(node), clock_frequency)), \
255+ (DT_PROP_LAST(DT_CLOCKS_CTLR(node), supported_clock_frequency)))), \
256+ (NRFX_MHZ_TO_HZ(16)))
257+
239258#endif /* !_ASMLANGUAGE */
240259
241260#endif
You can’t perform that action at this time.
0 commit comments