00001 /* 00002 * Copyright Droids Corporation, Microb Technology, Eirbot (2005) 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: quadramp.h,v 1.5 2008-01-08 20:05:03 zer0 Exp $ 00019 * 00020 */ 00021 00022 #ifndef _QUADRAMP_H_ 00023 #define _QUADRAMP_H_ 00024 00025 #include <aversive.h> 00026 00027 struct quadramp_filter 00028 { 00029 uint32_t var_2nd_ord_pos; 00030 uint32_t var_2nd_ord_neg; 00031 uint32_t var_1st_ord_pos; 00032 uint32_t var_1st_ord_neg; 00033 00034 int32_t previous_var; 00035 int32_t previous_out; 00036 int32_t previous_in; 00037 }; 00038 00040 void quadramp_init(struct quadramp_filter *q); 00041 00042 void quadramp_set_2nd_order_vars(struct quadramp_filter *q, 00043 uint32_t var_2nd_ord_pos, 00044 uint32_t var_2nd_ord_neg); 00045 00046 void quadramp_set_1st_order_vars(struct quadramp_filter *q, 00047 uint32_t var_1st_ord_pos, 00048 uint32_t var_1st_ord_neg); 00049 00054 uint8_t quadramp_is_finished(struct quadramp_filter *q); 00055 00062 int32_t quadramp_do_filter(void * data, int32_t in); 00063 00064 #endif