BeRTOS
|
Stepper driver interface implementation. More...
#include "stepper_at91.h"
#include "cfg/cfg_stepper.h"
#include <cfg/macros.h>
#include <cfg/debug.h>
#include <cpu/types.h>
#include <cpu/irq.h>
#include <io/arm.h>
Go to the source code of this file.
Functions | |
static | ISR_PROTO (stepper_tc2_irq) |
Static array of timer counter struct for stepper. | |
void | stepper_tc_tio_irq (struct TimerCounter *t) |
Generic TIO interrupt handler. | |
void | stepper_tc_setup (int index, stepper_isr_t callback, struct Stepper *motor) |
Timer couter setup. | |
void | stepper_tc_init (void) |
Timer counter init. |
Stepper driver interface implementation.
This module use the three timer on the at91 family, to generate a six periodic variable pwm waveform. The pulse width is fix, and could change by setting the STEPPER_DELAY_ON_COMPARE_C define, but you make an attention to do this, becouse the pulse width is not exactly STEPPER_DELAY_ON_COMPARE_C. The pulse width depend also to latency time of cpu to serve an interrupt, this generate an pwm waveform affect to noise. This noise not effect the period but only the pulse width, becouse the raising edge is generate by hardware comply with the our period settings.
Note: is most important to set STEPPER_DELAY_ON_COMPARE_C value minor than a interrupt time service, becouse the falling edge must be happen inside to inerrupt service to guarantee a correct functionaly of pwm generator.
Definition in file stepper_at91.c.
void stepper_tc_setup | ( | int | index, |
stepper_isr_t | callback, | ||
struct Stepper * | motor | ||
) |
Timer couter setup.
This function apply to select timer couter all needed settings. Every settings are stored in stepper_timers[].
Definition at line 332 of file stepper_at91.c.