drivers/gpio/gpio_stm32.c
/**
 * @brief Initialize GPIO port
 *
 * Perform basic initialization of a GPIO port. The code will
 * enable the clock for corresponding peripheral.
 *
 * @param dev GPIO device struct
 *
 * @return 0
 */
@brief Initialize GPIO port
Perform basic initialization of a GPIO port. The code will
enable the clock for corresponding peripheral.

@param dev GPIO device struct

@return 0
@brief Initialize GPIO port Perform basic initialization of a GPIO port . The code will enable the clock for corresponding peripheral . @param dev GPIO device struct @return 0
static int gpio_stm32_init(struct device *device)
{
	const struct gpio_stm32_config *cfg = device->config->config_info;
	struct device *clk =
		device_get_binding(STM32_CLOCK_CONTROL_NAME);
#ifdef CONFIG_CLOCK_CONTROL_STM32_CUBE
	clock_control_on(clk, (clock_control_subsys_t *) &cfg->pclken);
#else
	clock_control_on(clk, cfg->clock_subsys);
#endif
	return 0;
}
static int gpio_stm32_init ( struct device * device ) { const struct gpio_stm32_config * cfg = device -> config -> config_info ; struct device * clk = device_get_binding ( STM32_CLOCK_CONTROL_NAME ) ; #ifdef CONFIG_CLOCK_CONTROL_STM32_CUBE clock_control_on ( clk , ( clock_control_subsys_t * ) & cfg -> pclken ) ; #else clock_control_on ( clk , cfg -> clock_subsys ) ; #endif return 0 ; }
@brief Initialize GPIO port
 Perform basic initialization of a GPIO port.
@brief Initialize GPIO port Perform basic initialization of a GPIO port .
/* enable clock for subsystem */