From ba78bd9ba834260d035a9830726afc34fdad2a15 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 18 Oct 2009 23:32:54 +0200 Subject: import firmware from LEGO v1.05 --- AT91SAM7S256/Source/m_sched.h | 135 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 AT91SAM7S256/Source/m_sched.h (limited to 'AT91SAM7S256/Source/m_sched.h') diff --git a/AT91SAM7S256/Source/m_sched.h b/AT91SAM7S256/Source/m_sched.h new file mode 100644 index 0000000..6bf5a07 --- /dev/null +++ b/AT91SAM7S256/Source/m_sched.h @@ -0,0 +1,135 @@ +// +// Date init 14.12.2004 +// +// Revision date $Date:: 16-05-06 10:15 $ +// +// Filename $Workfile:: m_sched.h $ +// +// Version $Revision:: 20 $ +// +// Archive $Archive:: /LMS2006/Sys01/Main/Firmware/Source/m_sched.h $ +// +// Platform C +// + + + +#define APPNAME "LMS01" + +#define COPYRIGHTSTRING "Let's samba nxt arm in arm, (c)LEGO System A/S" + +#define COPYRIGHTSTRINGLENGTH 46 /* Number of bytes checked in COPYRIGHTSTRING */ + + +#ifndef _WINDOWS + +#define SAM7SXX + +#ifdef SAM7SXX + + // + // Platform ATMEL ARM7 + // + // + +#define OSC 48054850L +#define SYSFREQ 1000 + + +#include "..\SAM7S256\include\sam7s256.h" + +#if defined (PROTOTYPE_PCB_3) || (PROTOTYPE_PCB_4) + +#define TSTPin AT91C_PIO_PA27 + +#else + +#define TSTPin AT91C_PIO_PA31 + +#endif + +#define TSTInit {\ + *AT91C_PIOA_PER = TSTPin;\ + *AT91C_PIOA_OER = TSTPin;\ + } + +#define TSTOn {\ + *AT91C_PIOA_SODR = TSTPin;\ + } + +#define TSTOff {\ + *AT91C_PIOA_CODR = TSTPin;\ + } + +#define TSTExit {\ + *AT91C_PIOA_ODR = TSTPin;\ + *AT91C_PIOA_CODR = TSTPin;\ + } + +/* Defines related to loader */ +#define MAX_HANDLES 16 + + +/* Defines related to I2c */ +#define BYTES_TO_TX 8 +#define BYTES_TO_RX 12 + +enum +{ + NOS_OF_AVR_OUTPUTS = 4, + NOS_OF_AVR_BTNS = 4, + NOS_OF_AVR_INPUTS = 4 +}; + +typedef struct +{ + UWORD AdValue[NOS_OF_AVR_INPUTS]; + UWORD Buttons; + UWORD Battery; +}IOFROMAVR; + +typedef struct +{ + UBYTE Power; + UBYTE PwmFreq; + SBYTE PwmValue[NOS_OF_AVR_OUTPUTS]; + UBYTE OutputMode; + UBYTE InputPower; +}IOTOAVR; + +extern IOTOAVR IoToAvr; +extern IOFROMAVR IoFromAvr; + +#ifdef INCLUDE_OS + +#include "..\SAM7S256\include\sam7s256.c" + +IOTOAVR IoToAvr; +IOFROMAVR IoFromAvr; + +#endif + +#endif + +#else + + // + // Platform PCWIN + // + // + +#define OSC 1192000L +#define SYSFREQ 1000 + +#include "Pcwin.h" + +#ifdef INCLUDE_OS + +#include "Pcwin.c" + +#endif + +#endif + + + -- cgit v1.2.3