Functions | Variables
stepper.c File Reference
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "encoder.h"
#include "stepper.h"
#include "utils.h"
#include "usart.h"
Include dependency graph for stepper.c:

Go to the source code of this file.


 ISR (PCINT0_vect)
void stepper_advance ()
void stepper_cal ()
int8_t stepper_get_direction ()
uint8_t stepper_get_latency ()
int16_t stepper_get_rem_steps ()
void stepper_init ()
int16_t stepper_read ()
void stepper_set (const int16_t target_pos)
void stepper_set_direction (int8_t dir)
void stepper_set_latency (const uint8_t lat)
void stepper_set_rem_steps (const int16_t steps)


static int16_t curr_step_num = 0
 AVR includes.
volatile char indexSet = 0
 contains current counter step number in the encoder
static uint8_t latency
static int16_t rem_steps
 flag for detecting index overpassed

Detailed Description

Code for stepper setup.

Julio Sagardoy

Definition in file stepper.c.

Function Documentation

ISR ( PCINT0_vect  )

External pin change interrupt for Index signal

Definition at line 132 of file stepper.c.

void stepper_advance ( void  )

Generate step

Definition at line 88 of file stepper.c.

void stepper_cal ( void  )

Calibration routine. Must be called for a correct operation of counter registers

Definition at line 103 of file stepper.c.

int8_t stepper_get_direction ( void  )

Get current direction status

Definition at line 46 of file stepper.c.

uint8_t stepper_get_latency ( )

Definition at line 81 of file stepper.c.

int16_t stepper_get_rem_steps ( )

Definition at line 73 of file stepper.c.

void stepper_init ( void  )

Inits stepper.

Definition at line 139 of file stepper.c.

int16_t stepper_read ( void  )

Retrieve current step counter number

Definition at line 56 of file stepper.c.

void stepper_set ( const int16_t  target_pos)

Command stepper to go to desired step position

Definition at line 63 of file stepper.c.

void stepper_set_direction ( int8_t  dir)

Change stepper ic controller direction. 1 is CW, 0 is CCW seen from top

Definition at line 36 of file stepper.c.

void stepper_set_latency ( const uint8_t  lat)

Definition at line 77 of file stepper.c.

void stepper_set_rem_steps ( const int16_t  steps)

Definition at line 69 of file stepper.c.

Variable Documentation

int16_t curr_step_num = 0 [static]

AVR includes.

Own includes

Definition at line 28 of file stepper.c.

volatile char indexSet = 0

contains current counter step number in the encoder

Definition at line 29 of file stepper.c.

uint8_t latency [static]

Definition at line 31 of file stepper.c.

int16_t rem_steps [static]

flag for detecting index overpassed

Definition at line 30 of file stepper.c.

Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:03:46