drivers/pwm/pwm_k64_ftm.c
/**
 * @brief API call to reenable FTM
 *
 * This function simply sets the clock source to the configuration value with
 * the assumption that FTM was previously disabled by setting the clock source
 * to "no clock selected" due to a call to pwm_ftm_suspend.
 *
 * @param dev Device struct
 * @return 0 if successful, failed otherwise
 */
@brief API call to reenable FTM
This function simply sets the clock source to the configuration value with
the assumption that FTM was previously disabled by setting the clock source
to "no clock selected" due to a call to pwm_ftm_suspend.

@param dev Device struct
@return 0 if successful, failed otherwise
@brief API call to reenable FTM This function simply sets the clock source to the configuration value with the assumption that FTM was previously disabled by setting the clock source to " no clock selected " due to a call to pwm_ftm_suspend . @param dev Device struct @return 0 if successful failed otherwise
static int pwm_ftm_resume_from_suspend(struct device *dev)
{
	u32_t clock_source;
	u32_t reg_val;
	const struct pwm_ftm_config * const config =
		dev->config->config_info;
	SYS_LOG_DBG("...");
	clock_source = (config->clock_source << PWM_K64_FTM_SC_CLKS_SHIFT) &&
		PWM_K64_FTM_SC_CLKS_MASK;
	reg_val = sys_read32(PWM_K64_FTM_SC(config->reg_base));
	reg_val &= ~PWM_K64_FTM_SC_CLKS_MASK;
	reg_val |= clock_source;
	sys_write32(reg_val, PWM_K64_FTM_SC(config->reg_base));
	pwm_ftm_set_power_state(DEVICE_PM_ACTIVE_STATE);
	SYS_LOG_DBG("done.");
	return 0;
}
static int pwm_ftm_resume_from_suspend ( struct device * dev ) { u32_t clock_source ; u32_t reg_val ; const struct pwm_ftm_config * const config = dev -> config -> config_info ; SYS_LOG_DBG ( " " ) ; clock_source = ( config -> clock_source << PWM_K64_FTM_SC_CLKS_SHIFT ) && PWM_K64_FTM_SC_CLKS_MASK ; reg_val = sys_read32 ( PWM_K64_FTM_SC ( config -> reg_base ) ) ; reg_val &= ~ PWM_K64_FTM_SC_CLKS_MASK ; reg_val |= clock_source ; sys_write32 ( reg_val , PWM_K64_FTM_SC ( config -> reg_base ) ) ; pwm_ftm_set_power_state ( DEVICE_PM_ACTIVE_STATE ) ; SYS_LOG_DBG ( " " ) ; return 0 ; }
@brief API call to reenable FTM
 This function simply sets the clock source to the configuration value with
 the assumption that FTM was previously disabled by setting the clock source
 to "no clock selected" due to a call to pwm_ftm_suspend.
@brief API call to reenable FTM This function simply sets the clock source to the configuration value with the assumption that FTM was previously disabled by setting the clock source to " no clock selected " due to a call to pwm_ftm_suspend .
/* set clock source to config value */