|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Interface for stepper-drv drivers. More...
Macros | |
| #define | MICRO_STEP_RES_INDEX(res) |
| Macro to calculate the index of the microstep resolution. | |
| #define | VALID_MICRO_STEP_RES(res) |
Enumerations | |
| enum | stepper_drv_micro_step_resolution { STEPPER_DRV_MICRO_STEP_1 = 1 , STEPPER_DRV_MICRO_STEP_2 = 2 , STEPPER_DRV_MICRO_STEP_4 = 4 , STEPPER_DRV_MICRO_STEP_8 = 8 , STEPPER_DRV_MICRO_STEP_16 = 16 , STEPPER_DRV_MICRO_STEP_32 = 32 , STEPPER_DRV_MICRO_STEP_64 = 64 , STEPPER_DRV_MICRO_STEP_128 = 128 , STEPPER_DRV_MICRO_STEP_256 = 256 } |
| Stepper Motor micro-step resolution options. More... | |
| enum | stepper_drv_event { STEPPER_DRV_EVENT_STALL_DETECTED = 0 , STEPPER_DRV_EVENT_FAULT_DETECTED = 1 } |
Functions | |
| int | stepper_drv_enable (const struct device *dev) |
| Enable stepper driver. | |
| int | stepper_drv_disable (const struct device *dev) |
| Disable stepper driver. | |
| int | stepper_drv_set_micro_step_res (const struct device *dev, enum stepper_drv_micro_step_resolution res) |
| Set the micro-step resolution in stepper driver. | |
| int | stepper_drv_get_micro_step_res (const struct device *dev, enum stepper_drv_micro_step_resolution *res) |
| Get the micro-step resolution in stepper driver. | |
| int | stepper_drv_set_event_cb (const struct device *dev, stepper_drv_event_cb_t callback, void *user_data) |
| Set the callback function to be called when a stepper_drv_event occurs. | |
Interface for stepper-drv drivers.
| #define MICRO_STEP_RES_INDEX | ( | res | ) |
#include <zephyr/drivers/stepper.h>
Macro to calculate the index of the microstep resolution.
| res | Microstep resolution |
| #define VALID_MICRO_STEP_RES | ( | res | ) |
#include <zephyr/drivers/stepper.h>
| enum stepper_drv_event |
#include <zephyr/drivers/stepper.h>
| Enumerator | |
|---|---|
| STEPPER_DRV_EVENT_STALL_DETECTED | Stepper driver stall detected. |
| STEPPER_DRV_EVENT_FAULT_DETECTED | Stepper driver fault detected. |
#include <zephyr/drivers/stepper.h>
Stepper Motor micro-step resolution options.
| int stepper_drv_disable | ( | const struct device * | dev | ) |
#include <zephyr/drivers/stepper.h>
Disable stepper driver.
Disabling the driver shall switch off the power stage and de-energize the coils.
| dev | pointer to the device structure for the driver instance. |
| -ENOTSUP | Disabling of driver is not supported. |
| -EIO | Error during Disabling |
| 0 | Success |
| int stepper_drv_enable | ( | const struct device * | dev | ) |
#include <zephyr/drivers/stepper.h>
Enable stepper driver.
Enabling the driver shall switch on the power stage and energize the coils.
| dev | pointer to the device structure for the driver instance. |
| -EIO | Error during Enabling |
| 0 | Success |
| int stepper_drv_get_micro_step_res | ( | const struct device * | dev, |
| enum stepper_drv_micro_step_resolution * | res ) |
#include <zephyr/drivers/stepper.h>
Get the micro-step resolution in stepper driver.
| dev | pointer to the device structure for the driver instance. |
| res | micro-step resolution |
| -EIO | General input / output error |
| 0 | Success |
| int stepper_drv_set_event_cb | ( | const struct device * | dev, |
| stepper_drv_event_cb_t | callback, | ||
| void * | user_data ) |
#include <zephyr/drivers/stepper.h>
Set the callback function to be called when a stepper_drv_event occurs.
| dev | pointer to the device structure for the driver instance. |
| callback | Callback function to be called when a stepper_drv_event occurs passing NULL will disable the callback |
| user_data | User data to be passed to the callback function |
| -ENOSYS | If not implemented by device driver |
| 0 | Success |
| int stepper_drv_set_micro_step_res | ( | const struct device * | dev, |
| enum stepper_drv_micro_step_resolution | res ) |
#include <zephyr/drivers/stepper.h>
Set the micro-step resolution in stepper driver.
| dev | pointer to the device structure for the driver instance. |
| res | micro-step resolution |
| -EIO | General input / output error |
| -EINVAL | If the requested resolution is invalid |
| -ENOTSUP | If the requested resolution is not supported |
| 0 | Success |