drivers/ecos_lpc2138_sja1000/lpc2138_defs.h
author lbessard
Mon, 15 May 2006 08:02:47 +0200
changeset 5 e4365e7d47f0
parent 0 4472ee7c6c3e
permissions -rw-r--r--
Bug on number in hexa computed by gen_cfile corrected
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
This file is part of CanFestival, a library implementing CanOpen Stack.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
 Author: Christian Fortin (canfestival@canopencanada.ca)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
See COPYING file for copyrights details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
/**
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
 * Définitions pour le LPC2138.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
 */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
#if !defined(_LPC2138_DEF_H_)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
#define _LPC2138_DEF_H_
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
#include <stdio.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
// #include "types.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
#define BITMASK_0  0x00000000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
#define BITMASK_1  0x00000001
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
#define BITMASK_2  0x00000003
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
#define BITMASK_4  0x0000000F
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
#define BITMASK_8  0x000000FF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
#define BITMASK_16 0x0000FFFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
#define BITMASK_32 0xFFFFFFFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
typedef volatile unsigned char   REG8;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
typedef volatile unsigned char  *REG8_ADDR;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
typedef volatile unsigned short  REG16;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
typedef volatile unsigned short *REG16_ADDR;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
typedef volatile unsigned int    REG32;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
typedef volatile unsigned int   *REG32_ADDR;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
#define SET_EQ_SET =
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
#define SET_EQ_CLR =
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
#define P0_IOPIN_ADDR   0xE0028000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
#define P0_IOSET_ADDR   0xE0028004
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
#define P0_IODIR_ADDR   0xE0028008
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
#define P0_IOCLR_ADDR   0xE002800C
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
#define P0_PINSEL0_ADDR 0xE002C000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
#define P0_PINSEL1_ADDR 0xE002C004
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
#define P1_IOPIN_ADDR   0xE0028010
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
#define P1_IOSET_ADDR   0xE0028014
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
#define P1_IODIR_ADDR   0xE0028018
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
#define P1_IOCLR_ADDR   0xE002801C
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
#define P1_PINSEL2_ADDR 0xE002C014
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
#define DACR_ADDR       0xE006C000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
/* Vectored Interrupt Controller (VIC) */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
#define VICVectAddr_ADDR  0xFFFFF030
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
#define VICVectAddr0_ADDR 0xFFFFF100
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
#define VICVectCntl0_ADDR 0xFFFFF200
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
#define VICIntEnable_ADDR 0xFFFFF010
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
/* External Interrupts */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
#define EXTINT_ADDR     0xE01FC140
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
#define INTWAKE_ADDR    0xE01FC144
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
#define EXTMODE_ADDR    0xE01FC148
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
#define EXTPOLAR_ADDR   0xE01FC14C
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
#ifdef TEST
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
#include "test_stubs.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
/* Vectored Interrupt Controller (VIC) */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
#define VICIRQStatus   (*((REG32_ADDR) 0xFFFFF000))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
#define VICFIQStatus   (*((REG32_ADDR) 0xFFFFF004))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
#define VICRawIntr     (*((REG32_ADDR) 0xFFFFF008))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
#define VICIntSelect   (*((REG32_ADDR) 0xFFFFF00C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
#define VICIntEnable   (*((REG32_ADDR) 0xFFFFF010))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
#define VICIntEnClr    (*((REG32_ADDR) 0xFFFFF014))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
#define VICSoftInt     (*((REG32_ADDR) 0xFFFFF018))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
#define VICSoftIntClr  (*((REG32_ADDR) 0xFFFFF01C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
#define VICProtection  (*((REG32_ADDR) 0xFFFFF020))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
#define VICVectAddr    (*((REG32_ADDR) 0xFFFFF030))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
#define VICDefVectAddr (*((REG32_ADDR) 0xFFFFF034))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
#define VICVectAddr0   (*((REG32_ADDR) 0xFFFFF100))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
#define VICVectAddr1   (*((REG32_ADDR) 0xFFFFF104))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
#define VICVectAddr2   (*((REG32_ADDR) 0xFFFFF108))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
#define VICVectAddr3   (*((REG32_ADDR) 0xFFFFF10C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
#define VICVectAddr4   (*((REG32_ADDR) 0xFFFFF110))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   101
#define VICVectAddr5   (*((REG32_ADDR) 0xFFFFF114))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
#define VICVectAddr6   (*((REG32_ADDR) 0xFFFFF118))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   103
#define VICVectAddr7   (*((REG32_ADDR) 0xFFFFF11C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
#define VICVectAddr8   (*((REG32_ADDR) 0xFFFFF120))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   105
#define VICVectAddr9   (*((REG32_ADDR) 0xFFFFF124))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
#define VICVectAddr10  (*((REG32_ADDR) 0xFFFFF128))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   107
#define VICVectAddr11  (*((REG32_ADDR) 0xFFFFF12C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   108
#define VICVectAddr12  (*((REG32_ADDR) 0xFFFFF130))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   109
#define VICVectAddr13  (*((REG32_ADDR) 0xFFFFF134))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   110
#define VICVectAddr14  (*((REG32_ADDR) 0xFFFFF138))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   111
#define VICVectAddr15  (*((REG32_ADDR) 0xFFFFF13C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   112
#define VICVectCntl0   (*((REG32_ADDR) 0xFFFFF200))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   113
#define VICVectCntl1   (*((REG32_ADDR) 0xFFFFF204))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   114
#define VICVectCntl2   (*((REG32_ADDR) 0xFFFFF208))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
#define VICVectCntl3   (*((REG32_ADDR) 0xFFFFF20C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   116
#define VICVectCntl4   (*((REG32_ADDR) 0xFFFFF210))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
#define VICVectCntl5   (*((REG32_ADDR) 0xFFFFF214))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
#define VICVectCntl6   (*((REG32_ADDR) 0xFFFFF218))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   119
#define VICVectCntl7   (*((REG32_ADDR) 0xFFFFF21C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   120
#define VICVectCntl8   (*((REG32_ADDR) 0xFFFFF220))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   121
#define VICVectCntl9   (*((REG32_ADDR) 0xFFFFF224))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   122
#define VICVectCntl10  (*((REG32_ADDR) 0xFFFFF228))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   123
#define VICVectCntl11  (*((REG32_ADDR) 0xFFFFF22C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   124
#define VICVectCntl12  (*((REG32_ADDR) 0xFFFFF230))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   125
#define VICVectCntl13  (*((REG32_ADDR) 0xFFFFF234))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   126
#define VICVectCntl14  (*((REG32_ADDR) 0xFFFFF238))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   127
#define VICVectCntl15  (*((REG32_ADDR) 0xFFFFF23C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   128
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   129
#define P0_IOPIN   (*((REG32_ADDR) P0_IOPIN_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   130
#define P0_IOSET   (*((REG32_ADDR) P0_IOSET_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   131
#define P0_IODIR   (*((REG32_ADDR) P0_IODIR_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   132
#define P0_IOCLR   (*((REG32_ADDR) P0_IOCLR_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   133
#define P0_PINSEL0 (*((REG32_ADDR) P0_PINSEL0_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   134
#define P0_PINSEL1 (*((REG32_ADDR) P0_PINSEL1_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   135
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   136
#define P1_IOPIN   (*((REG32_ADDR) P1_IOPIN_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   137
#define P1_IOSET   (*((REG32_ADDR) P1_IOSET_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   138
#define P1_IODIR   (*((REG32_ADDR) P1_IODIR_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   139
#define P1_IOCLR   (*((REG32_ADDR) P1_IOCLR_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   140
#define P1_PINSEL2 (*((REG32_ADDR) P1_PINSEL2_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   141
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   142
#define DACR       (*((REG32_ADDR) DACR_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   143
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   144
/* External Interrupts */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   145
#define EXTINT   (*((REG32_ADDR) EXTINT_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   146
#define INTWAKE  (*((REG32_ADDR) INTWAKE_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   147
#define EXTMODE  (*((REG32_ADDR) EXTMODE_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   148
#define EXTPOLAR (*((REG32_ADDR) EXTPOLAR_ADDR))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   149
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   150
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   151
/* Timer 0 */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   152
#define T0IR           (*((REG32_ADDR) 0xE0004000))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   153
#define T0TCR          (*((REG32_ADDR) 0xE0004004))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   154
#define T0TC           (*((REG32_ADDR) 0xE0004008))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   155
#define T0PR           (*((REG32_ADDR) 0xE000400C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   156
#define T0PC           (*((REG32_ADDR) 0xE0004010))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   157
#define T0MCR          (*((REG32_ADDR) 0xE0004014))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   158
#define T0MR0          (*((REG32_ADDR) 0xE0004018))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   159
#define T0MR1          (*((REG32_ADDR) 0xE000401C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   160
#define T0MR2          (*((REG32_ADDR) 0xE0004020))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   161
#define T0MR3          (*((REG32_ADDR) 0xE0004024))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   162
#define T0CCR          (*((REG32_ADDR) 0xE0004028))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   163
#define T0CR0          (*((REG32_ADDR) 0xE000402C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   164
#define T0CR1          (*((REG32_ADDR) 0xE0004030))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   165
#define T0CR2          (*((REG32_ADDR) 0xE0004034))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   166
#define T0CR3          (*((REG32_ADDR) 0xE0004038))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   167
#define T0EMR          (*((REG32_ADDR) 0xE000403C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   168
#define T0CTCR         (*((REG32_ADDR) 0xE0004070))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   169
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   170
/* Timer 1 */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   171
#define T1IR           (*((REG32_ADDR) 0xE0008000))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   172
#define T1TCR          (*((REG32_ADDR) 0xE0008004))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   173
#define T1TC           (*((REG32_ADDR) 0xE0008008))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   174
#define T1PR           (*((REG32_ADDR) 0xE000800C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   175
#define T1PC           (*((REG32_ADDR) 0xE0008010))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   176
#define T1MCR          (*((REG32_ADDR) 0xE0008014))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   177
#define T1MR0          (*((REG32_ADDR) 0xE0008018))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   178
#define T1MR1          (*((REG32_ADDR) 0xE000801C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   179
#define T1MR2          (*((REG32_ADDR) 0xE0008020))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   180
#define T1MR3          (*((REG32_ADDR) 0xE0008024))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   181
#define T1CCR          (*((REG32_ADDR) 0xE0008028))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   182
#define T1CR0          (*((REG32_ADDR) 0xE000802C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   183
#define T1CR1          (*((REG32_ADDR) 0xE0008030))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   184
#define T1CR2          (*((REG32_ADDR) 0xE0008034))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   185
#define T1CR3          (*((REG32_ADDR) 0xE0008038))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   186
#define T1EMR          (*((REG32_ADDR) 0xE000803C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   187
#define T1CTCR         (*((REG32_ADDR) 0xE0008070))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   188
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   189
/* Real Time Clock */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   190
#define ILR            (*((REG8_ADDR) 0xE0024000))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   191
#define CTC            (*((REG16_ADDR) 0xE0024004))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   192
#define CCR            (*((REG8_ADDR) 0xE0024008))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   193
#define CIIR           (*((REG8_ADDR) 0xE002400C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   194
#define AMR            (*((REG8_ADDR) 0xE0024010))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   195
#define CTIME0         (*((REG32_ADDR) 0xE0024014))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   196
#define CTIME1         (*((REG32_ADDR) 0xE0024018))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   197
#define CTIME2         (*((REG32_ADDR) 0xE002401C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   198
#define SEC            (*((REG8_ADDR) 0xE0024020))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   199
#define MIN            (*((REG8_ADDR) 0xE0024024))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   200
#define HOUR           (*((REG8_ADDR) 0xE0024028))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   201
#define DOM            (*((REG8_ADDR) 0xE002402C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   202
#define DOW            (*((REG8_ADDR) 0xE0024030))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   203
#define DOY            (*((REG16_ADDR) 0xE0024034))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   204
#define MONTH          (*((REG8_ADDR) 0xE0024038))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   205
#define YEAR           (*((REG16_ADDR) 0xE002403C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   206
#define ALSEC          (*((REG8_ADDR) 0xE0024060))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   207
#define ALMIN          (*((REG8_ADDR) 0xE0024064))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   208
#define ALHOUR         (*((REG8_ADDR) 0xE0024068))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   209
#define ALDOM          (*((REG8_ADDR) 0xE002406C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   210
#define ALDOW          (*((REG8_ADDR) 0xE0024070))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   211
#define ALDOY          (*((REG16_ADDR) 0xE0024074))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   212
#define ALMON          (*((REG8_ADDR) 0xE0024078))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   213
#define ALYEAR         (*((REG16_ADDR) 0xE002407C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   214
#define PREINT         (*((REG16_ADDR) 0xE0024080))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   215
#define PREFRAC        (*((REG16_ADDR) 0xE0024084))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   216
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   217
/* SPI Registers */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   218
#define S0SPCR         (*((REG32_ADDR) 0xE0020000))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   219
#define S0SPSR         (*((REG32_ADDR) 0xE0020004))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   220
#define S0SPDR         (*((REG32_ADDR) 0xE0020008))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   221
#define S0SPCCR        (*((REG32_ADDR) 0xE002000C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   222
#define S0SPINT        (*((REG32_ADDR) 0xE002001C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   223
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   224
/* SSP Registers */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   225
#define SSPCR0         (*((REG32_ADDR) 0xE0068000))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   226
#define SSPCR1         (*((REG32_ADDR) 0xE0068004))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   227
#define SSPDR          (*((REG32_ADDR) 0xE0068008))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   228
#define SSPSR          (*((REG32_ADDR) 0xE006800C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   229
#define SSPCPSR        (*((REG32_ADDR) 0xE0068010))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   230
#define SSPIMSC        (*((REG32_ADDR) 0xE0068014))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   231
#define SSPRIS         (*((REG32_ADDR) 0xE0068018))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   232
#define SSPMIS         (*((REG32_ADDR) 0xE006801C))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   233
#define SSPICR         (*((REG32_ADDR) 0xE0068020))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   234
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   235
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   236
typedef enum {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   237
    LPC2138_MODE_INPUT  = 0,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   238
    LPC2138_MODE_OUTPUT = 1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   239
} LPC2138_MODE;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   240
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   241
typedef enum {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   242
    P0 = 0,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   243
    P1 = 1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   244
} LPC2138_PORT;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   245
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   246
/* === Fonctions "#define" génériques ======================================= */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   247
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   248
#define _cat(a, b) a##b
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   249
#define _CAT(a, b) _cat(a, b)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   250
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   251
#define _PIN(pin)  LPC2138_##pin
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   252
#define _PORT(pin) LPC2138_##pin##_PORT
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   253
#define _SIZE(pin) LPC2138_##pin##_SIZE
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   254
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   255
/* ((P[0|1]_IOPIN >> pin) & BITMASK_[0-32]) */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   256
#define lpc2138_get(pin) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   257
    ((_CAT(_PORT(pin), _IOPIN) >> _PIN(pin)) & _CAT(BITMASK_, _SIZE(pin)))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   258
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   259
#define lpc2138_set(pin, i) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   260
    { if (_SIZE(pin) == 1) { lpc2138_set_bit(pin, i); } \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   261
        else { lpc2138_set_all(pin, i); } }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   262
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   263
#define lpc2138_set_bit(pin, i) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   264
    { if ((i) == 1) { _CAT(_PORT(pin), _IOSET) SET_EQ_SET (1 << _PIN(pin)); } \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   265
           else { _CAT(_PORT(pin), _IOCLR) SET_EQ_CLR (1 << _PIN(pin)); } }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   266
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   267
#define lpc2138_set_all(pin, i) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   268
    (_CAT(_PORT(pin), _IOPIN) = \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   269
        (_CAT(_PORT(pin), _IOPIN) & \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   270
            ~(_CAT(BITMASK_, _SIZE(pin)) << _PIN(pin))) | ((i) << _PIN(pin)))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   271
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   272
/* Identique à lpc2138_set(p, f, nbits, i) sans effet secondaire (plus lent). */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   273
#define lpc2138_set_SAFE_(pin, i) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   274
    ((_SIZE(pin) == 1) && lpc2138_set_bit_SAFE_(pin, (i)) || \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   275
        lpc2138_set_all(pin, (i)))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   276
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   277
/* Identique à lpc2138_set_bit(p, f, i) sans effet secondaire (plus lent). */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   278
#define lpc2138_set_bit_SAFE_(pin, i) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   279
    ((i == 1) && (_CAT(_PORT(pin), _IOSET) SET_EQ_SET (1 << _PIN(pin))) || \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   280
        (_CAT(_PORT(pin), _IOCLR) SET_EQ_CLR (1 << _PIN(pin))))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   281
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   282
#define lpc2138_set_mode(pin, mode) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   283
    (_CAT(_PORT(pin), _IODIR) = (mode == LPC2138_MODE_OUTPUT) ? \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   284
        (_CAT(_PORT(pin), _IODIR)|(_CAT(BITMASK_, _SIZE(pin)) << _PIN(pin))) : \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   285
        (_CAT(_PORT(pin), _IODIR) & ~(_CAT(BITMASK_, _SIZE(pin)) << _PIN(pin))))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   286
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   287
#define lpc2138_set_pinsel(pin, func) \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   288
    lpc2138_pinsel_set(_PIN(pin), _PORT(pin), _SIZE(pin), func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   289
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   290
/* === Fonctions pinout "#define" par défaut ================================ */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   291
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   292
#ifndef lpc2138_uart0_tx_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   293
#define lpc2138_uart0_tx_set_pinsel(func)          lpc2138_set_pinsel(uart0_tx, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   294
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   295
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   296
#ifndef lpc2138_uart0_rx_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   297
#define lpc2138_uart0_rx_set_pinsel(func)          lpc2138_set_pinsel(uart0_rx, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   298
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   299
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   300
#ifndef lpc2138_cs_s1d13706_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   301
#define lpc2138_cs_s1d13706_get()                  lpc2138_get       (cs_s1d13706)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   302
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   303
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   304
#ifndef lpc2138_cs_s1d13706_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   305
#define lpc2138_cs_s1d13706_set(i)                 lpc2138_set       (cs_s1d13706, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   306
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   307
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   308
#ifndef lpc2138_cs_s1d13706_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   309
#define lpc2138_cs_s1d13706_set_mode(mode)         lpc2138_set_mode  (cs_s1d13706, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   310
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   311
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   312
#ifndef lpc2138_cs_s1d13706_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   313
#define lpc2138_cs_s1d13706_set_pinsel(func)       lpc2138_set_pinsel(cs_s1d13706, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   314
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   315
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   316
#ifndef lpc2138_cs_sja1000_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   317
#define lpc2138_cs_sja1000_get()                   lpc2138_get       (cs_sja1000)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   318
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   319
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   320
#ifndef lpc2138_cs_sja1000_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   321
#define lpc2138_cs_sja1000_set(i)                  lpc2138_set       (cs_sja1000, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   322
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   323
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   324
#ifndef lpc2138_cs_sja1000_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   325
#define lpc2138_cs_sja1000_set_mode(mode)          lpc2138_set_mode  (cs_sja1000, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   326
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   327
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   328
#ifndef lpc2138_cs_sja1000_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   329
#define lpc2138_cs_sja1000_set_pinsel(func)        lpc2138_set_pinsel(cs_sja1000, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   330
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   331
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   332
#ifndef lpc2138_wait_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   333
#define lpc2138_wait_get()                         lpc2138_get       (wait)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   334
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   335
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   336
#ifndef lpc2138_wait_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   337
#define lpc2138_wait_set(i)                        lpc2138_set       (wait, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   338
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   339
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   340
#ifndef lpc2138_wait_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   341
#define lpc2138_wait_set_mode(mode)                lpc2138_set_mode  (wait, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   342
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   343
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   344
#ifndef lpc2138_wait_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   345
#define lpc2138_wait_set_pinsel(func)              lpc2138_set_pinsel(wait, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   346
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   347
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   348
#ifndef lpc2138_bhe_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   349
#define lpc2138_bhe_get()                          lpc2138_get       (bhe)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   350
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   351
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   352
#ifndef lpc2138_bhe_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   353
#define lpc2138_bhe_set(i)                         lpc2138_set       (bhe, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   354
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   355
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   356
#ifndef lpc2138_bhe_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   357
#define lpc2138_bhe_set_mode(mode)                 lpc2138_set_mode  (bhe, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   358
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   359
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   360
#ifndef lpc2138_bhe_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   361
#define lpc2138_bhe_set_pinsel(func)               lpc2138_set_pinsel(bhe, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   362
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   363
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   364
#ifndef lpc2138_interrupt_sja1000_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   365
#define lpc2138_interrupt_sja1000_get()            lpc2138_get       (interrupt_sja1000)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   366
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   367
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   368
#ifndef lpc2138_interrupt_sja1000_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   369
#define lpc2138_interrupt_sja1000_set(i)           lpc2138_set       (interrupt_sja1000, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   370
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   371
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   372
#ifndef lpc2138_interrupt_sja1000_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   373
#define lpc2138_interrupt_sja1000_set_mode(mode)   lpc2138_set_mode  (interrupt_sja1000, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   374
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   375
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   376
#ifndef lpc2138_interrupt_sja1000_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   377
#define lpc2138_interrupt_sja1000_set_pinsel(func) lpc2138_set_pinsel(interrupt_sja1000, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   378
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   379
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   380
#ifndef lpc2138_redgreenled_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   381
#define lpc2138_redgreenled_get()            lpc2138_get       (redgreenled)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   382
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   383
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   384
#ifndef lpc2138_redgreenled_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   385
#define lpc2138_redgreenled_set(i)           lpc2138_set       (redgreenled, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   386
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   387
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   388
#ifndef lpc2138_redgreenled_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   389
#define lpc2138_redgreenled_set_mode(mode)   lpc2138_set_mode  (redgreenled, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   390
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   391
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   392
#ifndef lpc2138_redgreenled_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   393
#define lpc2138_redgreenled_set_pinsel(func) lpc2138_set_pinsel(redgreenled, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   394
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   395
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   396
#ifndef lpc2138_dac0_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   397
#define lpc2138_dac0_set()                         lpc2138_set       (dac0, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   398
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   399
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   400
#ifndef lpc2138_dac0_set_value
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   401
#define lpc2138_dac0_set_value(i)                  DACR =            ((1 << 16) | ((i & 0x3FF) << 6))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   402
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   403
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   404
#ifndef lpc2138_dac0_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   405
#define lpc2138_dac0_set_pinsel(func)              lpc2138_set_pinsel(dac0, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   406
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   407
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   408
#ifndef lpc2138_spi0_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   409
#define lpc2138_spi0_set()                         lpc2138_set       (spi0, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   410
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   411
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   412
#ifndef lpc2138_spi0_set_value
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   413
#define lpc2138_spi0_set_value(i)                  SSPDR = i
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   414
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   415
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   416
#ifndef lpc2138_spi0_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   417
#define lpc2138_spi0_set_pinsel(func)              lpc2138_set_pinsel(spi0, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   418
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   419
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   420
#ifndef lpc2138_ale_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   421
#define lpc2138_ale_get()                          lpc2138_get       (ale)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   422
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   423
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   424
#ifndef lpc2138_ale_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   425
#define lpc2138_ale_set(i)                         lpc2138_set       (ale, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   426
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   427
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   428
#ifndef lpc2138_ale_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   429
#define lpc2138_ale_set_mode(mode)                 lpc2138_set_mode  (ale, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   430
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   431
#ifndef lpc2138_ale_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   432
#define lpc2138_ale_set_pinsel(func)               lpc2138_set_pinsel(ale, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   433
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   434
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   435
#ifndef lpc2138_rd_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   436
#define lpc2138_rd_get()                           lpc2138_get       (rd)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   437
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   438
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   439
#ifndef lpc2138_rd_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   440
#define lpc2138_rd_set(i)                          lpc2138_set       (rd, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   441
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   442
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   443
#ifndef lpc2138_rd_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   444
#define lpc2138_rd_set_mode(mode)                  lpc2138_set_mode  (rd, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   445
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   446
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   447
#ifndef lpc2138_rd_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   448
#define lpc2138_rd_set_pinsel(func)                lpc2138_set_pinsel(rd, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   449
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   450
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   451
#ifndef lpc2138_wr_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   452
#define lpc2138_wr_get()                           lpc2138_get       (wr)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   453
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   454
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   455
#ifndef lpc2138_wr_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   456
#define lpc2138_wr_set(i)                          lpc2138_set       (wr, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   457
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   458
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   459
#ifndef lpc2138_wr_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   460
#define lpc2138_wr_set_mode(mode)                  lpc2138_set_mode  (wr, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   461
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   462
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   463
#ifndef lpc2138_wr_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   464
#define lpc2138_wr_set_pinsel(func)                lpc2138_set_pinsel(wr, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   465
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   466
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   467
#ifndef lpc2138_data_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   468
#define lpc2138_data_get()                         lpc2138_get       (data)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   469
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   470
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   471
#ifndef lpc2138_data_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   472
#define lpc2138_data_set(i)                        lpc2138_set       (data, i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   473
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   474
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   475
#ifndef lpc2138_data_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   476
#define lpc2138_data_set_mode(mode)                lpc2138_set_mode  (data, mode)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   477
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   478
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   479
#ifndef lpc2138_data_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   480
#define lpc2138_data_set_pinsel(func)              lpc2138_set_pinsel(data, func)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   481
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   482
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   483
#ifndef lpc2138_addresses_get
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   484
#define lpc2138_addresses_get()                    ((lpc2138_get      (a17_mr) << 17) | \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   485
                                                    (lpc2138_get      (a16)    << 16) | \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   486
                                                    (lpc2138_get      (a0_a15)))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   487
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   488
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   489
#ifndef lpc2138_addresses_set
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   490
#define lpc2138_addresses_set(i)                     lpc2138_set      (a17_mr, ((i >> 17) & BITMASK_1)); \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   491
                                                     lpc2138_set      (a16,    ((i >> 16) & BITMASK_1)); \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   492
                                                     lpc2138_set      (a0_a15, ((i)       & BITMASK_16))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   493
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   494
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   495
#ifndef lpc2138_addresses_set_mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   496
#define lpc2138_addresses_set_mode(mode)            (lpc2138_set_mode  (a17_mr, mode), \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   497
                                                     lpc2138_set_mode  (a16,    mode), \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   498
                                                     lpc2138_set_mode  (a0_a15, mode))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   499
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   500
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   501
#ifndef lpc2138_addresses_set_pinsel
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   502
#define lpc2138_addresses_set_pinsel(func)          (lpc2138_set_pinsel(a17_mr, func), \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   503
                                                     lpc2138_set_pinsel(a16,    func), \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   504
                                                     lpc2138_set_pinsel(a0_a15, func))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   505
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   506
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   507
#define CMR 1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   508
#define RRB 2	// 1=released message in fifo are released
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   509
#define AT 1	// 1= cancel next tranmission
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   510
#define SR 2
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   511
#define TBS 2	// 1=released the cpu may write a message in the transmit buffer
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   512
#define SRR 4	// 1=present  a message shall be transmit and receive sim
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   513
#define TR 0	// 1=present a message shall be transmit
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   514
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   515
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   516
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   517
	FLASH
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   518
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   519
#define EE_SEC_L		1		// Flash sector where EEPROM begins (see UM for details)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   520
#define EE_SEC_H		3	  	// Flash sector where EEPROM ends (see UM for details)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   521
#define EE_ADDR_L		0x00001000	// Must match the EE_SEC_L Flash sector start address
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   522
#define EE_ADDR_H		0x00003FFF 	// Must match the EE_SEC_H Flash sector end address
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   523
#define EE_CCLK			60000		// system clock cclk expressed in kHz (5*12 MHz)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   524
#define EE_BUFFER_SIZE	        256
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   525
#define EE_START_MASK           0xFFFFFF00
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   526
#define EE_BUFFER_MASK          0x000000F0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   527
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   528
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   529
#endif