drivers/ecos_lpc2138_sja1000/lpc2138.c
author etisserant
Tue, 13 Feb 2007 17:21:19 +0100
changeset 92 0d84d95790d9
parent 0 4472ee7c6c3e
permissions -rw-r--r--
- Some fixes in Makefile.in
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
#include <stdio.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
#include <stdlib.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
#include "applicfg.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
// #include "objdictdef.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
#include "lpc2138_pinout.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
#include "lpc2138_defs.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
#include "lpc2138.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
#define IAP_LOCATION    0x7ffffff1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
// define a page of data of 256 bytes
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
//
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
short          data_len; /* 0 to 256 bytes */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
unsigned int   *data_page = NULL;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
unsigned int   data_addr;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
// local definitons
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
void ee_erase(unsigned int ,unsigned int[]);		//function erases EEPROM
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
void ee_write_page(unsigned int);	//function adds a record in EEPROM
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
void ee_read_page(unsigned int);	//function reads the latest valid record in EEPROM
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
typedef void (*IAP)(unsigned int [],unsigned int[]);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
IAP iap_entry;
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
/***************************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
void lpc2138_pinsel_set(int pin, LPC2138_PORT port, int size, int func) 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
    int i;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
    for (i = 0; i < size; pin++, i++) 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
    {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
        /* 2 bits par broche. */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
        int shift = (pin - ((pin < 16) ? 0 : 16)) << 1;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
        REG32_ADDR pinsel = (port == 1) ?
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
            (REG32_ADDR) P1_PINSEL2_ADDR : ((pin < 16) ?
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
                (REG32_ADDR) P0_PINSEL0_ADDR : (REG32_ADDR) P0_PINSEL1_ADDR);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
        *pinsel = (*pinsel & ~(BITMASK_2 << shift)) | (func << shift);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
    }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
void lpc2138_pinsel_clear() 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
    P0_PINSEL0 = 0x00000000;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
    P0_PINSEL1 = 0x00000000;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
    P1_PINSEL2 = 0x00000000;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
int lpc2138_printf(void) 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
    return lpc2138_fprintf(stdout);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
int lpc2138_printf_pins(void) 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
    return lpc2138_fprintf_pins(stdout);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
int lpc2138_fprintf(FILE *stream) 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
    return fprintf(stream,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
        "[p0=0x%08X,p0_iodir=0x%08X,p0_pinsel0=0x%08X,p0_pinsel1=0x%08X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
        "p1=0x%08X,p1_iodir=0x%08X,p1_pinsel2=0x%08X]",
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
        P0_IOPIN, P0_IODIR, P0_PINSEL0, P0_PINSEL1,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
        P1_IOPIN, P1_IODIR, P1_PINSEL2);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
int lpc2138_fprintf_pins(FILE *stream) 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
    return fprintf(stream,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   101
        "[cs_s1d13706=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
        "cs_sja1000=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   103
        "wait=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
        "bhe=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   105
        "interrupt_sja1000=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
        "redgreenled=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   107
        "ale=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   108
        "rd=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   109
        "wr=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   110
        "data=0x%X," \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   111
        "addresses=0x%X]",
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   112
        lpc2138_cs_s1d13706_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   113
        lpc2138_cs_sja1000_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   114
        lpc2138_wait_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
        lpc2138_bhe_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   116
        lpc2138_redgreenled_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
        lpc2138_interrupt_sja1000_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
        lpc2138_ale_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   119
        lpc2138_rd_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   120
        lpc2138_wr_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   121
        lpc2138_data_get(),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   122
        lpc2138_addresses_get());
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   123
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   124
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   125
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   126
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   127
	SJA1000 interface
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   128
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   129
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   130
unsigned char sja1000_read(unsigned char addr8)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   131
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   132
    unsigned char data;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   133
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   134
    lpc2138_data_set_mode(LPC2138_MODE_OUTPUT);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   135
    lpc2138_ale_set(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   136
    lpc2138_data_set(addr8);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   137
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   138
    lpc2138_ale_set(0);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   139
    lpc2138_data_set_mode(LPC2138_MODE_INPUT);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   140
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   141
    lpc2138_cs_sja1000_set(0);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   142
    lpc2138_rd_set(0);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   143
    data = lpc2138_data_get();
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   144
    data = lpc2138_data_get();
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   145
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   146
    lpc2138_rd_set(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   147
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   148
    lpc2138_cs_sja1000_set(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   149
    lpc2138_data_set_mode(LPC2138_MODE_OUTPUT);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   150
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   151
    return data;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   152
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   153
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   154
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   155
void sja1000_write(unsigned char addr8, unsigned char data)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   156
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   157
    lpc2138_data_set_mode(LPC2138_MODE_OUTPUT);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   158
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   159
    lpc2138_data_set(addr8);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   160
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   161
    lpc2138_ale_set(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   162
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   163
    lpc2138_ale_set(0);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   164
    lpc2138_cs_sja1000_set(0);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   165
    lpc2138_wr_set(0);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   166
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   167
    lpc2138_data_set(data);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   168
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   169
    lpc2138_wr_set(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   170
    lpc2138_cs_sja1000_set(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   171
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   172
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   173
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   174
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   175
	FLASH interface
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   176
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   177
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   178
/************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   179
/*                                                                    	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   180
/* function:								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   181
/*  void ee_erase(unsigned int command_ee,unsigned int result_ee[])	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   182
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   183
/* type: void                                                          	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   184
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   185
/* parameters: 								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   186
/* 	command_ee   - Not used.  	               			*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   187
/*  result_ee[0] - Returns a response to the last IAP command used.	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   188
/*                 0 - EEPROM successfully erased.			*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   189
/*                 For all other response values, see microcontroller 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   190
/*		   User Manual, IAP Commands and Status Codes Summary.	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   191
/*  result_ee[1] - Not used.                         			*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   192
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   193
/* version: 1.1 (01/27/2006)                                           	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   194
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   195
/* constants defined in LPC2k_ee.h used in this function:              	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   196
/*  EE_SEC_L 	 - microcontroller's Flash sector where EEPROM begins	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   197
/*  EE_SEC_H 	 - microcontroller's Flash sector where EEPROM ends	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   198
/*  EE_CCLK		 - microcontroller's system clock (cclk)        */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   199
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   200
/* description:								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   201
/*  This function erases LPC2000 on-chip Flash sectors selected to act 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   202
/*  as an EEPROM. All Flash sectors between EE_SEC_L abd EE_SEC_H	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   203
/*  (including these sectors) will be erased using the In Application	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   204
/*  Programming (IAP) routines (see User Manual for more details). 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   205
/*  Also, this function disables all interrupts while erasing the       */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   206
/*  EEPROM. If this is not needed, three lines of the ee_erase          */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   207
/*  subroutine can simply be commented-out without affecting the        */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   208
/*  routine performance at all.                                         */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   209
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   210
/* revision history:                                                   	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   211
/* - Rev. 1.1 adds interrupt disable feature.				*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   212
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   213
/************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   214
void iat_flash_erase(unsigned int command_ee,unsigned int result_ee[])
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   215
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   216
	unsigned int command_iap[5];
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   217
	unsigned int result_iap[3];
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   218
	unsigned long int enabled_interrupts;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   219
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   220
	enabled_interrupts = VICIntEnable;  //disable all interrupts
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   221
	VICIntEnClr        = enabled_interrupts;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   222
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   223
	command_iap[0]=50;	// prepare sectors from EE_SEC_L to EE_SEC_H for erase
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   224
	command_iap[1]=EE_SEC_L;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   225
	command_iap[2]=EE_SEC_H;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   226
	iap_entry=(IAP) IAP_LOCATION;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   227
	iap_entry(command_iap,result_iap);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   228
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   229
	command_iap[0]=52;	// erase sectors from EE_SEC_L to EE_SEC_H
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   230
	command_iap[1]=EE_SEC_L;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   231
	command_iap[2]=EE_SEC_H;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   232
	command_iap[3]=EE_CCLK;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   233
	iap_entry=(IAP) IAP_LOCATION;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   234
	iap_entry(command_iap,result_iap);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   235
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   236
	command_iap[0]=53;	// blankcheck sectors from EE_SEC_L to EE_SEC_H
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   237
	command_iap[1]=EE_SEC_L;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   238
	command_iap[2]=EE_SEC_H;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   239
	iap_entry=(IAP) IAP_LOCATION;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   240
	iap_entry(command_iap,result_iap);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   241
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   242
	VICIntEnable = enabled_interrupts;  //restore interrupt enable register
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   243
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   244
	result_ee[0]=result_iap[0];
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   245
	return;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   246
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   247
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   248
/************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   249
/*                                                                    	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   250
/* function: 								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   251
/*  void ee_write(unsigned int command_ee,unsigned int result_ee[])	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   252
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   253
/* type: void                                                          	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   254
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   255
/* parameters: 								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   256
/* 	command_ee   - An address of a content of ee_data type that has	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   257
/*                 to be programmed into EEPROM.                       	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   258
/*  result_ee[0] - Returns a response to the last IAP command used.	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   259
/*                 0 - data successfully programmed in EEPROM.		*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   260
/*               501 - no space in EEPROM to program data.             	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   261
/*                 For all other response values, see microcontroller 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   262
/*		   User Manual, IAP Commands and Status Codes Summary.	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   263
/*  result_ee[1] - Not used.                           			*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   264
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   265
/* version: 1.1 (01/27/2006)                                           	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   266
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   267
/* constants defined in LPC2k_ee.h used in this function:              	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   268
/*  EE_BUFFER_SIZE 	   - IAP buffer size; must be 256 or 512 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   269
/*  NO_SPACE_IN_EEPROM - EEPROM is full and no data can be programmed	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   270
/*  EE_BUFFER_MASK	   - parameter used for interfacing with IAP	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   271
/*  EE_REC_SIZE   	   - ee_data structure size in bytes        	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   272
/*  EE_SEC_L 	 	   - micro's Flash sector where EEPROM begins	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   273
/*  EE_SEC_H 	 	   - micro's Flash sector where EEPROM ends	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   274
/*  EE_CCLK		 	   - micro's system clock (cclk)       	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   275
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   276
/* description:								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   277
/*  This function writes a single structure of ee_data type into the	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   278
/*  EEPROM using an In Application	Programming (IAP) routines (see */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   279
/*  User Manual for more details). command_ee contains an address of	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   280
/*  this structure. EEPROM is scanned for the last (if any) record 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   281
/*  identifier (EE_REC_ID), and a new record is added next to it.      	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   282
/*  Also, this function disables all interrupts while erasing the       */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   283
/*  EEPROM. If this is not needed, three lines of the ee_write          */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   284
/*  subroutine can simply be commented-out without affecting the        */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   285
/*  routine performance at all.                                         */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   286
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   287
/* revision history:                                                   	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   288
/* - Rev. 1.1 fixes a bug related to verifying a content written into	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   289
/*   the EEPROM. 1.0 was reporting missmatch even when there were no	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   290
/*   problems at all.							*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   291
/*   Rev. 1.1 adds interrupt disable feature.				*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   292
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   293
/************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   294
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   295
void iat_flash_write_page(unsigned int addr)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   296
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   297
	unsigned long int enabled_interrupts;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   298
	// unsigned char ee_buffer[16];
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   299
	unsigned int command_iap[5], result_iap[3];
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   300
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   301
	enabled_interrupts = VICIntEnable;  //disable all interrupts
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   302
	VICIntEnClr        = enabled_interrupts;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   303
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   304
	iap_entry = (IAP) IAP_LOCATION;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   305
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   306
	// prepare sectors from EE_SEC_L to EE_SEC_H for erase
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   307
	command_iap[0] = 50;			
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   308
	command_iap[1] = EE_SEC_L;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   309
	command_iap[2] = EE_SEC_H;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   310
	iap_entry(command_iap, result_iap);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   311
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   312
	// copy RAM to flash/eeprom
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   313
	command_iap[0] = 51;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   314
	command_iap[1] = (unsigned int) (addr & EE_START_MASK); // 256 kb boundary
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   315
	command_iap[2] = (unsigned int) (data_page);            // should be on a word boundary
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   316
	command_iap[3] = 256;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   317
	command_iap[4] = EE_CCLK;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   318
	iap_entry(command_iap, result_iap);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   319
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   320
#if 0 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   321
	// compare RAM and flash/eeprom
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   322
	command_iap[0] = 56;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   323
	command_iap[1] = (unsigned int) data;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   324
	command_iap[2] = addr;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   325
	command_iap[3] = dlen;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   326
	iap_entry(command_iap, result_iap);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   327
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   328
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   329
	VICIntEnable = enabled_interrupts;  //restore interrupt enable register
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   330
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   331
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   332
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   333
/************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   334
/*                                                                    	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   335
/* function: 								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   336
/*  void ee_read(unsigned int command_ee,unsigned int result_ee[])	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   337
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   338
/* type: void                                                          	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   339
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   340
/* parameters: 								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   341
/* 	command_ee   - Not used.					*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   342
/*  result_ee[0] - Returns a response.					*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   343
/*                 0 - data successfully found in EEPROM.		*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   344
/*               500 - no data/records available in EEPROM.		*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   345
/*  result_ee[1] - an address of the last record of ee_data type	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   346
/*				   in EEPROM.  	              		*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   347
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   348
/* version: 1.1 (01/27/2006)                                           	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   349
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   350
/* constants defined in LPC2k_ee.h used in this function:              	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   351
/*  NO_RECORDS_AVAILABLE - EEPROM is empty/no records identifiable	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   352
/*			   with a record identifier (EE_REC_ID) found	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   353
/*  EE_ADR_L 	    - micro's Flash address from where EEPROM begins	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   354
/*  EE_REC_SIZE    - size (in bytes) of a ee_data structure        	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   355
/*                                                                 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   356
/* description:								*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   357
/*  This function scans an EEPROM content looking for the last record 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   358
/*  that can be identified with a record identifier (EE_REC_ID). When 	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   359
/*  such data is found, its address is passed as result_ee[1].		*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   360
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   361
/* revision history:                                                   	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   362
/* - Rev. 1.0 had problems with accessing the last record in a fully	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   363
/*   occupied EEPROM. Rev. 1.1 fixes this.				*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   364
/*                                                                     	*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   365
/************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   366
void iat_flash_read_page(unsigned int addr)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   367
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   368
	memcpy(data_page, (unsigned int *)addr, sizeof(unsigned int)*64);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   369
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   370
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   371
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   372
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   373