Project

General

Profile

Statistics
| Branch: | Revision:

root / scout_avr / src / stepper.h @ daf6a575

History | View | Annotate | Download (640 Bytes)

1
#ifndef _STEPPER_H_
2
#define _STEPPER_H_
3

    
4
#define S_STEP    PD6
5
#define S_DIR     PD7
6

    
7
#define S_MS      PB7
8

    
9
#define S_EN      PF0
10

    
11
#define STEP_WHOLE 2
12
#define STEP_HALF 1
13

    
14
/* Initializes the stepper with whole steps and no direction. step_sweep_bounds
15
 * and step_dir should be called before using step_sweep. */
16
void step_init();
17

    
18
/* Don't call step_do_step or step_sweep if you haven't called step_enable() */
19

    
20
void step_set_size(char size);
21
void step_dir(int dir);
22
void step_do_step();
23
void step_flush();
24
void step_sweep_bounds(int ccw, int cw);
25
void step_sweep();
26
void step_enable();
27
void step_disable();
28
int step_get_pos();
29

    
30

    
31
#endif