LAT Hologramm-Software 2.0
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
stepper.c File Reference
#include "grbl.h"
Include dependency graph for stepper.c:

Go to the source code of this file.

Classes

struct  st_block_t
 
struct  segment_t
 
struct  stepper_t
 
struct  st_prep_t
 

Macros

#define DT_SEGMENT   (1.0/(ACCELERATION_TICKS_PER_SECOND*60.0))
 
#define REQ_MM_INCREMENT_SCALAR   1.25
 
#define RAMP_ACCEL   0
 
#define RAMP_CRUISE   1
 
#define RAMP_DECEL   2
 
#define RAMP_DECEL_OVERRIDE   3
 
#define PREP_FLAG_RECALCULATE   bit(0)
 
#define PREP_FLAG_HOLD_PARTIAL_BLOCK   bit(1)
 
#define PREP_FLAG_PARKING   bit(2)
 
#define PREP_FLAG_DECEL_OVERRIDE   bit(3)
 
#define MAX_AMASS_LEVEL   3
 
#define AMASS_LEVEL1   (F_CPU/8000)
 
#define AMASS_LEVEL2   (F_CPU/4000)
 
#define AMASS_LEVEL3   (F_CPU/2000)
 

Functions

void st_wake_up ()
 
void st_go_idle ()
 
 ISR (TIMER1_COMPA_vect)
 
 ISR (TIMER0_OVF_vect)
 
void st_generate_step_dir_invert_masks ()
 
void st_reset ()
 
void stepper_init ()
 
void st_update_plan_block_parameters ()
 
static uint8_t st_next_block_index (uint8_t block_index)
 
void st_prep_buffer ()
 
float st_get_realtime_rate ()
 

Variables

static st_block_t st_block_buffer [SEGMENT_BUFFER_SIZE-1]
 
static segment_t segment_buffer [SEGMENT_BUFFER_SIZE]
 
static stepper_t st
 
static volatile uint8_t segment_buffer_tail
 
static uint8_t segment_buffer_head
 
static uint8_t segment_next_head
 
static uint8_t step_port_invert_mask
 
static uint8_t dir_port_invert_mask
 
static volatile uint8_t busy
 
static plan_block_tpl_block
 
static st_block_tst_prep_block
 
static st_prep_t prep
 

Macro Definition Documentation

◆ AMASS_LEVEL1

#define AMASS_LEVEL1   (F_CPU/8000)

Definition at line 50 of file stepper.c.

◆ AMASS_LEVEL2

#define AMASS_LEVEL2   (F_CPU/4000)

Definition at line 51 of file stepper.c.

◆ AMASS_LEVEL3

#define AMASS_LEVEL3   (F_CPU/2000)

Definition at line 52 of file stepper.c.

◆ DT_SEGMENT

#define DT_SEGMENT   (1.0/(ACCELERATION_TICKS_PER_SECOND*60.0))

Definition at line 26 of file stepper.c.

◆ MAX_AMASS_LEVEL

#define MAX_AMASS_LEVEL   3

Definition at line 48 of file stepper.c.

◆ PREP_FLAG_DECEL_OVERRIDE

#define PREP_FLAG_DECEL_OVERRIDE   bit(3)

Definition at line 36 of file stepper.c.

◆ PREP_FLAG_HOLD_PARTIAL_BLOCK

#define PREP_FLAG_HOLD_PARTIAL_BLOCK   bit(1)

Definition at line 34 of file stepper.c.

◆ PREP_FLAG_PARKING

#define PREP_FLAG_PARKING   bit(2)

Definition at line 35 of file stepper.c.

◆ PREP_FLAG_RECALCULATE

#define PREP_FLAG_RECALCULATE   bit(0)

Definition at line 33 of file stepper.c.

◆ RAMP_ACCEL

#define RAMP_ACCEL   0

Definition at line 28 of file stepper.c.

◆ RAMP_CRUISE

#define RAMP_CRUISE   1

Definition at line 29 of file stepper.c.

◆ RAMP_DECEL

#define RAMP_DECEL   2

Definition at line 30 of file stepper.c.

◆ RAMP_DECEL_OVERRIDE

#define RAMP_DECEL_OVERRIDE   3

Definition at line 31 of file stepper.c.

◆ REQ_MM_INCREMENT_SCALAR

#define REQ_MM_INCREMENT_SCALAR   1.25

Definition at line 27 of file stepper.c.

Function Documentation

◆ ISR() [1/2]

ISR ( TIMER0_OVF_vect  )

Definition at line 489 of file stepper.c.

◆ ISR() [2/2]

ISR ( TIMER1_COMPA_vect  )

Definition at line 319 of file stepper.c.

◆ st_generate_step_dir_invert_masks()

void st_generate_step_dir_invert_masks ( )

Definition at line 515 of file stepper.c.

◆ st_get_realtime_rate()

float st_get_realtime_rate ( )

Definition at line 1089 of file stepper.c.

◆ st_go_idle()

void st_go_idle ( )

Definition at line 250 of file stepper.c.

◆ st_next_block_index()

static uint8_t st_next_block_index ( uint8_t  block_index)
static

Definition at line 609 of file stepper.c.

◆ st_prep_buffer()

void st_prep_buffer ( )

Definition at line 668 of file stepper.c.

◆ st_reset()

void st_reset ( )

Definition at line 535 of file stepper.c.

◆ st_update_plan_block_parameters()

void st_update_plan_block_parameters ( )

Definition at line 598 of file stepper.c.

◆ st_wake_up()

void st_wake_up ( )

Definition at line 224 of file stepper.c.

◆ stepper_init()

void stepper_init ( )

Definition at line 566 of file stepper.c.

Variable Documentation

◆ busy

volatile uint8_t busy
static

Definition at line 141 of file stepper.c.

◆ dir_port_invert_mask

uint8_t dir_port_invert_mask
static

Definition at line 134 of file stepper.c.

◆ pl_block

plan_block_t* pl_block
static

Definition at line 145 of file stepper.c.

◆ prep

st_prep_t prep
static

Definition at line 180 of file stepper.c.

◆ segment_buffer

segment_t segment_buffer[SEGMENT_BUFFER_SIZE]
static

Definition at line 96 of file stepper.c.

◆ segment_buffer_head

uint8_t segment_buffer_head
static

Definition at line 129 of file stepper.c.

◆ segment_buffer_tail

volatile uint8_t segment_buffer_tail
static

Definition at line 128 of file stepper.c.

◆ segment_next_head

uint8_t segment_next_head
static

Definition at line 130 of file stepper.c.

◆ st

stepper_t st
static

Definition at line 125 of file stepper.c.

◆ st_block_buffer

st_block_t st_block_buffer[SEGMENT_BUFFER_SIZE-1]
static

Definition at line 77 of file stepper.c.

◆ st_prep_block

st_block_t* st_prep_block
static

Definition at line 146 of file stepper.c.

◆ step_port_invert_mask

uint8_t step_port_invert_mask
static

Definition at line 133 of file stepper.c.