aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/m_sched.h
blob: b3bb27eaac80ab786c39ff928e111b757c0efd53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//
// Date init       14.12.2004
//
// Revision date   $Date:: 14-11-07 12:40                                    $
//
// Filename        $Workfile:: m_sched.h                                     $
//
// Version         $Revision:: 1                                             $
//
// Archive         $Archive:: /LMS2006/Sys01/Main_V02/Firmware/Source/m_sche $
//
// 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