drivers/pinmux/stm32/pinmux_stm32.c
/**
 * @brief enable IO port clock
 *
 * @param port I/O port ID
 * @param clk  optional clock device
 *
 * @return 0 on success, error otherwise
 */
@brief enable IO port clock
@param port I/O port ID
@param clk  optional clock device

@return 0 on success, error otherwise
@brief enable IO port clock @param port I / O port ID @param clk optional clock device @return 0 on success error otherwise
static int enable_port(u32_t port, struct device *clk)
{
	if (!clk) {
		clk = device_get_binding(STM32_CLOCK_CONTROL_NAME);
	}
#if defined(CONFIG_CLOCK_CONTROL_STM32_CUBE)
	struct stm32_pclken pclken;
	pclken.bus = STM32_CLOCK_BUS_GPIO;
	pclken.enr = ports_enable[port];
	return clock_control_on(clk, (clock_control_subsys_t *) &pclken);
#else
	clock_control_subsys_t subsys = stm32_get_port_clock(port);
	return clock_control_on(clk, subsys);
#endif 
}
static int enable_port ( u32_t port , struct device * clk ) { if ( ! clk ) { clk = device_get_binding ( STM32_CLOCK_CONTROL_NAME ) ; } #if defined ( CONFIG_CLOCK_CONTROL_STM32_CUBE ) struct stm32_pclken pclken ; pclken . bus = STM32_CLOCK_BUS_GPIO ; pclken . enr = ports_enable [ port ] ; return clock_control_on ( clk , ( clock_control_subsys_t * ) & pclken ) ; #else clock_control_subsys_t subsys = stm32_get_port_clock ( port ) ; return clock_control_on ( clk , subsys ) ; #endif }
@brief enable IO port clock
 @param port I/O port ID
 @param clk  optional clock device
@brief enable IO port clock @param port I / O port ID @param clk optional clock device
/* enable port clock */ /* TODO: Merge this and move the port clock to the soc file */ /* TODO: Clean once F1 series moved to LL Clock control */ /* CONFIG_CLOCK_CONTROL_STM32_CUBE */