From 1193ef26a1f1431d4974a0235cd923786509bab1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 24 Feb 2015 23:23:30 +0100 Subject: moved tuer-rfid to realraum github repo --- tuer-rfid/stepper.c | 127 ---------------------------------------------------- 1 file changed, 127 deletions(-) delete mode 100644 tuer-rfid/stepper.c (limited to 'tuer-rfid/stepper.c') diff --git a/tuer-rfid/stepper.c b/tuer-rfid/stepper.c deleted file mode 100644 index b477419..0000000 --- a/tuer-rfid/stepper.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * spreadspace avr utils - * - * - * Copyright (C) 2013-2014 Christian Pointner - * Othmar Gsenger - * - * This file is part of spreadspace avr utils. - * - * spreadspace avr utils is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * spreadspace avr utils is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with spreadspace avr utils. If not, see . - */ - -#include -#include - -#include "stepper.h" -#include "limits.h" -#include "eventqueue.h" - -uint8_t step_table [] = -{ - /* full steps */ - /* 6, // 0110 */ - /* 5, // 0101 */ - /* 9, // 1001 */ - /* 10, // 1010 */ - - /* half steps */ - 2, // 0010 - 6, // 0110 - 4, // 0100 - 5, // 0101 - 1, // 0001 - 9, // 1001 - 8, // 1000 - 10, // 1010 -}; - -#define STEPPER_PORT PORTF -#define STEPPER_DDR DDRF -#define STEPPER_FIRST_BIT 4 -#define STEPPER_ENABLE_A_BIT 0 -#define STEPPER_ENABLE_B_BIT 1 -#define LENGTH_STEP_TABLE (sizeof(step_table)/sizeof(uint8_t)) -#define STEPPER_OUTPUT_BITMASK (~(0xF << STEPPER_FIRST_BIT )) - -volatile uint16_t step_cnt = 0; -#define STEP_CNT_STOP (LENGTH_STEP_TABLE*172) -#define STEP_CNT_STOP_PLUS_EXTRA (STEP_CNT_STOP + (LENGTH_STEP_TABLE*20)) -stepper_direction_t step_direction = dir_open; - -inline void stepper_stop(void) -{ - STEPPER_PORT &= ~(0xF << STEPPER_FIRST_BIT | 1<= STEP_CNT_STOP_PLUS_EXTRA) - return 0; //stop - - return 1; // continue running -} - -void stepper_init(void) -{ - STEPPER_PORT &= ~(0xF << STEPPER_FIRST_BIT | 1<