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


aseba
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:39