5 #ifndef ARUNA_STEPPER_H 6 #define ARUNA_STEPPER_H 11 #include "freertos/FreeRTOS.h" 12 #include <freertos/task.h> 13 #include <freertos/semphr.h> 125 #endif //ARUNA_STEPPER_H
static void _timer_task_wrapper(void *_this)
wrapper for timer_task(), as FreeRTOS only wants to create tasks from static functions ...
void timer_task()
task to set the next phase on time.
Stepper(uint8_t *pins, size_t pins_count, movement::axis_mask_t axis, bool active_high)
Stepper motor.
virtual err_t init_pin(uint8_t pin_nr)=0
init single pin as output
TaskHandle_t timer_task_handle
err_t clear_pins()
reset the pins back to initial state (run when program is finished)
movement::axis_mask_t asked_direction
Link * driver
stores the driver.
err_t init_pins()
initialize the pins for output
void do_steps(int32_t steps)
Do an x number of steps.
err_t do_step(movement::axis_mask_t direction)
Do a single step in a direction.
err_t _set(movement::axis_mask_t axisMask, int16_t speed) override
Implementation of axis movement, this function is called from set(...).
virtual err_t clear_pin(uint8_t pin_nr)
clear single pin after program is finished
SemaphoreHandle_t asked_set_mutex
void set_speed(int16_t speed)
Set speed of the stepper motor.
virtual err_t set_pin(uint8_t pin_nr, bool value)=0
set pin level high or low
uint8_t get_pin(movement::axis_mask_t direction, uint8_t n=0)
pop pin from circular array buffer.