|
|
@ -48,12 +48,16 @@ typedef uint32_t hal_timer_t; |
|
|
|
#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones
|
|
|
|
|
|
|
|
#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals
|
|
|
|
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / HAL_TICKS_PER_US) |
|
|
|
|
|
|
|
#define HAL_STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
|
|
|
|
#define HAL_TICKS_PER_US ((HAL_STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
|
|
|
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / HAL_TICKS_PER_US) |
|
|
|
#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts
|
|
|
|
|
|
|
|
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
|
|
|
|
#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts
|
|
|
|
|
|
|
|
#define PULSE_TIMER_NUM STEP_TIMER_NUM |
|
|
|
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE |
|
|
|
|
|
|
|
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) |
|
|
|
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) |
|
|
@ -66,9 +70,6 @@ typedef uint32_t hal_timer_t; |
|
|
|
#define HAL_TEMP_TIMER_ISR void TC4_Handler() |
|
|
|
#define HAL_TONE_TIMER_ISR void TC6_Handler() |
|
|
|
|
|
|
|
#define PULSE_TIMER_NUM STEP_TIMER_NUM |
|
|
|
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE |
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// Types
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|