Commit d2273c02 authored by Hubert Guan's avatar Hubert Guan Committed by Carles Cufi
Browse files

include: zephyr: dt-bindings: clock: Define STM32_CLOCK macro



Define new macro for reading and writing convenience.

Signed-off-by: default avatarHubert Guan <hguan@ucsb.edu>
parent 22ad2059
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -45,4 +45,13 @@
	 (((mask) & STM32_MCO_CFGR_MASK_MASK) << STM32_MCO_CFGR_MASK_SHIFT) |        \
	 (((val) & STM32_MCO_CFGR_VAL_MASK) << STM32_MCO_CFGR_VAL_SHIFT))

/**
 * Pack RCC clock register offset and bit in two 32-bit values
 * as expected for the Device Tree `clocks` property on STM32.
 *
 * @param bus STM32 bus name (expands to STM32_CLOCK_BUS_{bus})
 * @param bit Clock bit
 */
#define STM32_CLOCK(bus, bit) (STM32_CLOCK_BUS_##bus) (1 << bit)

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32_COMMON_CLOCKS_H_ */