Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

stm32h7: add function to get frequency of a clock

Change-Id: Ice60bc0e443a134ebb8ec03015fef98991ef9b05

authored by

Aidan MacDonald and committed by
Solomon Peachy
a4b0af2a a9b75fc4

+17
+17
firmware/target/arm/stm32/clock-stm32h7.h
··· 23 23 24 24 #include "system.h" 25 25 #include <stdbool.h> 26 + #include <stddef.h> 26 27 27 28 enum stm_clock 28 29 { ··· 55 56 void stm_target_clock_enable(enum stm_clock clock, bool enable); 56 57 57 58 /* 59 + * Callback to return a specific clock's frequency. For most 60 + * peripherals the frequency must be known at initialization 61 + * and not change afterwards; see peripheral drivers for the 62 + * details, as their exact requirements may vary. 63 + */ 64 + size_t stm_target_clock_get_frequency(enum stm_clock clock); 65 + 66 + /* 58 67 * Called from system_init(). Sets up internal book-keeping 59 68 * and then calls stm_target_clock_init(). 60 69 */ ··· 65 74 */ 66 75 void stm_clock_enable(enum stm_clock clock); 67 76 void stm_clock_disable(enum stm_clock clock); 77 + 78 + /* 79 + * Get a clock's frequency in Hz. 80 + */ 81 + static inline size_t stm_clock_get_frequency(enum stm_clock clock) 82 + { 83 + return stm_target_clock_get_frequency(clock); 84 + } 68 85 69 86 #endif /* __CLOCK_STM32H7_H__ */