00001 /* 00002 Aseba - an event-based framework for distributed robot control 00003 Copyright (C) 2006 - 2009: 00004 Philippe Rétornaz <philippe.retornaz at epfl dot ch> 00005 and other contributors, see authors.txt for details 00006 Mobots group, Laboratory of Robotics Systems, EPFL, Lausanne 00007 00008 This program is free software: you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation, either version 3 of the License, or 00011 any other version as decided by the two original authors 00012 Stephane Magnenat and Valentin Longchamp. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 00023 00024 00025 00026 00027 // No multiple include protection since this file must ONLY BE INCLUDED FROM SKEL.h 00028 00029 // DMA Channels to use with CAN 00030 #define DMA_CAN_RX DMA_CHANNEL_0 00031 #define DMA_CAN_TX DMA_CHANNEL_1 00032 00033 // GPIO to use to set CAN speed 00034 #define CAN_SELECT_MODE GPIO_MAKE_ID(GPIO_PORTD,11) 00035 00036 // CAN interrupt priority 00037 #define PRIO_CAN 5 00038 00039 00040 /* Send queue size may be smaller (64 is the smallest value) something like 70-80 is better 00041 128 is luxury */ 00042 #define SEND_QUEUE_SIZE 128 00043 00044 /* Warning, at least an aseba message MUST be able to fit into this RECV_QUEUE_SIZE buffer */ 00045 /* 256 is IMHO the minimum, but maybe it can be lowered with a lot of caution. 00046 * The bigger you have, the best it is. Fill the empty ram with it :) 00047 */ 00048 #define RECV_QUEUE_SIZE 756 00049 00050 /* This is the number of "private" variable the aseba script can have */ 00051 #define VM_VARIABLES_FREE_SPACE 256 00052 00053 /* This is the maximum number of argument an aseba event can recieve */ 00054 #define VM_VARIABLES_ARG_SIZE 32 00055 00056 00057 /* The number of opcode an aseba script can have */ 00058 #define VM_BYTECODE_SIZE 766 // PUT HERE 766 + 768 * a, where a is >= 0 00059 #define VM_STACK_SIZE 32 00060 00061 00062 00063 struct _vmVariables { 00064 // NodeID 00065 sint16 id; 00066 // source 00067 sint16 source; 00068 // args 00069 sint16 args[VM_VARIABLES_ARG_SIZE]; 00070 00071 /**** 00072 ---> PUT YOUR VARIABLES HERE <--- 00073 ****/ 00074 00075 00076 // free space 00077 sint16 freeSpace[VM_VARIABLES_FREE_SPACE]; 00078 }; 00079 00080 00081 enum Events 00082 { 00083 YOUR_FIRST_EVENT = 0, 00084 YOUR_SECOND_EVENT, 00085 /**** 00086 ---> PUT YOUR EVENT NUMBER HERE <--- 00087 Must be in the same order as in skel.c 00088 ****/ 00089 EVENTS_COUNT // Do not touch 00090 }; 00091 00092 // The content of this structure is implementation-specific. 00093 // The glue provide a way to store and retrive it from flash. 00094 // The only way to write it is to do it from inside the VM (native function) 00095 // The native function access it as a integer array. So, use only int inside this structure 00096 struct private_settings { 00097 /* ADD here the settings to save into flash */ 00098 /* The minimum size is one integer, the maximum size is 95 integer (Check done at compilation) */ 00099 int first_setting; 00100 int second_setting; 00101 }; 00102