00001 /* 00002 * Copyright Droids Corporation, Microb Technology, Eirbot (2006) 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Revision : $Id: multiservo.h,v 1.4 2007-05-24 13:08:48 zer0 Exp $ 00019 * 00020 */ 00021 00022 #ifndef _MULTISERVO__H_ 00023 #define _MULTISERVO__H_ 00024 00025 #include <aversive.h> 00026 #include <multiservo_config.h> 00027 00028 00029 struct multiservo_element { 00030 volatile uint8_t * port; 00031 uint8_t bitnum; 00032 uint16_t value; 00033 }; 00034 00035 struct multiservo { 00036 uint32_t time_sum; 00037 uint16_t current_multiservo; 00038 int8_t id_prev; 00039 struct multiservo_element elts[MULTISERVO_NB_MAX]; 00040 }; 00041 00042 extern struct multiservo g_multiservo; 00043 00044 00045 00046 void multiservo_init(void); 00047 00048 int8_t multiservo_add(volatile uint8_t * port, uint8_t bitnum); 00049 00050 void multiservo_del(int8_t id); 00051 00052 void multiservo_set(int8_t id, uint16_t val); 00053 00054 00055 #endif