Lines Matching +full:micro +full:- +full:step

2  * SPDX-FileCopyrightText: Copyright (c) 2024 Navimatix GmbH
3 * SPDX-License-Identifier: Apache-2.0
61 LOG_ERR("%s: Failed to reset micro-step pin (error: %d)", dev->name, ret); in drv8424_set_microstep_pin()
74 /* Hi-Z is set by configuring pin as disconnected, not in drv8424_set_microstep_pin()
84 LOG_ERR("%s: Failed to set micro-step pin (error: %d)", dev->name, ret); in drv8424_set_microstep_pin()
95 const struct drv8424_config *config = dev->config; in drv8424_microstep_recovery()
96 struct drv8424_data *data = dev->data; in drv8424_microstep_recovery()
99 uint8_t m0_value = data->pin_states.m0; in drv8424_microstep_recovery()
100 uint8_t m1_value = data->pin_states.m1; in drv8424_microstep_recovery()
102 ret = drv8424_set_microstep_pin(dev, &config->m0_pin, m0_value); in drv8424_microstep_recovery()
104 LOG_ERR("%s: Failed to restore microstep configuration (error: %d)", dev->name, in drv8424_microstep_recovery()
109 ret = drv8424_set_microstep_pin(dev, &config->m1_pin, m1_value); in drv8424_microstep_recovery()
111 LOG_ERR("%s: Failed to restore microstep configuration (error: %d)", dev->name, in drv8424_microstep_recovery()
122 const struct drv8424_config *config = dev->config; in drv8424_enable()
123 struct drv8424_data *data = dev->data; in drv8424_enable()
124 bool has_enable_pin = config->en_pin.port != NULL; in drv8424_enable()
125 bool has_sleep_pin = config->sleep_pin.port != NULL; in drv8424_enable()
131 dev->name); in drv8424_enable()
132 return -ENOTSUP; in drv8424_enable()
136 ret = gpio_pin_set_dt(&config->sleep_pin, !enable); in drv8424_enable()
138 LOG_ERR("%s: Failed to set sleep_pin (error: %d)", dev->name, ret); in drv8424_enable()
141 data->pin_states.sleep = enable ? 0U : 1U; in drv8424_enable()
145 ret = gpio_pin_set_dt(&config->en_pin, enable); in drv8424_enable()
147 LOG_ERR("%s: Failed to set en_pin (error: %d)", dev->name, ret); in drv8424_enable()
150 data->pin_states.en = enable ? 1U : 0U; in drv8424_enable()
153 data->enabled = enable; in drv8424_enable()
155 config->common.timing_source->stop(dev); in drv8424_enable()
156 gpio_pin_set_dt(&config->common.step_pin, 0); in drv8424_enable()
165 const struct drv8424_config *config = dev->config; in drv8424_set_micro_step_res()
166 struct drv8424_data *data = dev->data; in drv8424_set_micro_step_res()
174 * 2: Hi-Z in drv8424_set_micro_step_res()
215 return -EINVAL; in drv8424_set_micro_step_res()
218 ret = drv8424_set_microstep_pin(dev, &config->m0_pin, m0_value); in drv8424_set_micro_step_res()
223 ret = drv8424_set_microstep_pin(dev, &config->m1_pin, m1_value); in drv8424_set_micro_step_res()
228 data->ustep_res = micro_step_res; in drv8424_set_micro_step_res()
229 data->pin_states.m0 = m0_value; in drv8424_set_micro_step_res()
230 data->pin_states.m1 = m1_value; in drv8424_set_micro_step_res()
238 struct drv8424_data *data = dev->data; in drv8424_get_micro_step_res()
239 *micro_step_res = data->ustep_res; in drv8424_get_micro_step_res()
245 struct drv8424_data *data = dev->data; in drv8424_move_to()
247 if (!data->enabled) { in drv8424_move_to()
249 return -ECANCELED; in drv8424_move_to()
257 struct drv8424_data *data = dev->data; in drv8424_move_by()
259 if (!data->enabled) { in drv8424_move_by()
261 return -ECANCELED; in drv8424_move_by()
270 struct drv8424_data *data = dev->data; in drv8424_run()
272 if (!data->enabled) { in drv8424_run()
274 return -ECANCELED; in drv8424_run()
282 const struct drv8424_config *const config = dev->config; in drv8424_init()
283 struct drv8424_data *const data = dev->data; in drv8424_init()
287 if (config->sleep_pin.port != NULL) { in drv8424_init()
288 ret = gpio_pin_configure_dt(&config->sleep_pin, GPIO_OUTPUT_ACTIVE); in drv8424_init()
290 LOG_ERR("%s: Failed to configure sleep_pin (error: %d)", dev->name, ret); in drv8424_init()
293 data->pin_states.sleep = 1U; in drv8424_init()
297 if (config->en_pin.port != NULL) { in drv8424_init()
298 ret = gpio_pin_configure_dt(&config->en_pin, GPIO_OUTPUT_INACTIVE); in drv8424_init()
300 LOG_ERR("%s: Failed to configure en_pin (error: %d)", dev->name, ret); in drv8424_init()
303 data->pin_states.en = 0U; in drv8424_init()
307 ret = gpio_pin_configure_dt(&config->m0_pin, GPIO_OUTPUT_INACTIVE); in drv8424_init()
309 LOG_ERR("%s: Failed to configure m0_pin (error: %d)", dev->name, ret); in drv8424_init()
312 data->pin_states.m0 = 0U; in drv8424_init()
315 ret = gpio_pin_configure_dt(&config->m1_pin, GPIO_OUTPUT_INACTIVE); in drv8424_init()
317 LOG_ERR("%s: Failed to configure m1_pin (error: %d)", dev->name, ret); in drv8424_init()
320 data->pin_states.m1 = 0U; in drv8424_init()
322 ret = drv8424_set_micro_step_res(dev, data->ustep_res); in drv8424_init()
329 LOG_ERR("Failed to initialize common step direction stepper (error: %d)", ret); in drv8424_init()