#ifndef motor_h #define motor_h /* motor.h */ /* APBTasserv - asservissement Robot 2004 {{{ * * Copyright (C) 2003 Nicolas Schodet * * Robot APB Team/Efrei 2004. * Web: http://assos.efrei.fr/robot/ * Mail: robot AT efrei DOT fr * * This program 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 2 of the License, or * (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * }}} */ /* +AutoDec */ /* Initialise le modue moteur. */ void motor_init (void); /* Addition limitée à 32000. */ signed long safe_add_long (signed long &a, signed long &b); /* Limite un entier entre -MAX et MAX. */ signed long boundary (signed long &n, signed long &max); /* Multiplication par les coef. */ signed long safe_mul_long (signed long &a, unsigned int &k); /* Met à jour la vitesse du moteur gauche. */ void motor_update_left_speed (void); /* Met à jour la vitesse du moteur droit. */ void motor_update_right_speed (void); /* Calcule le PID associé au moteur gauche. */ void motor_compute_left_pid (void); /* Calcule le PID associé au moteur droit. */ void motor_compute_right_pid (void); /* Paramètre la PWM pour le moteur gauche. */ void motor_g_pwm (signed long &pwm); /* Paramètre la PWM pour le moteur droit. */ void motor_d_pwm (signed long &pwm); /* Interruptions de comptage moteur. */ #int_EXT EXT_isr(); #int_EXT1 EXT1_isr(); /* Interruption de PID. */ #int_TIMER2 TIMER2_isr (); /* Traite une entrée série. */ short motor_parse (void); /* Démarre l'asservissement. */ void motor_toggle_asservi (short fl); /* -AutoDec */ #endif /* motor_h */