]> rtime.felk.cvut.cz Git - arc.git/blob - boards/mpc5516it/config/Eeprom_Lcfg.c
Initial commit.
[arc.git] / boards / mpc5516it / config / Eeprom_Lcfg.c
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16
17
18
19
20
21
22
23
24 #include "Eep.h"
25 #include "Spi.h"
26 #include "Spi_Cfg.h"
27
28 //#define USE_TRACE 1
29 //#define USE_DEBUG     1
30 #undef DEBUG_LVL
31 #define DEBUG_LVL DEBUG_LOW
32 #include "Trace.h"
33
34 static void _JobEndNotify(){
35         DEBUG(DEBUG_LOW,"E2 JOB END NOTIFICATION\n");
36 }
37 static void _JobErrorNotify(){
38         DEBUG(DEBUG_LOW,"E2 JOB ERROR NOTIFICATION\n");
39 }
40
41 const Eep_ConfigType EepromConfigData[] = {
42     {
43                 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
44                 .EepCmdSequence = SPI_SEQ_E2_CMD,
45                 .EepCmd2Sequence = SPI_SEQ_E2_CMD2,
46                 .EepReadSequence = SPI_SEQ_E2_READ,
47                 .EepWriteSequence = SPI_SEQ_E2_WRITE,
48
49     // Channels used
50     .EepCmdChannel      = SPI_CH_E2_CMD,
51     .EepAddrChannel     = SPI_CH_E2_ADDR,
52     .EepWrenChannel     = SPI_CH_E2_WREN,
53     .EepDataChannel     = SPI_CH_E2_DATA,
54
55
56 #if 0
57     // number of bytes read within one job processing cycle in normal mode.
58     .EepInitConfiguration = 1,
59 #endif
60
61     // call cycle of the job processing function during write/erase operations. Unit: [s]
62     .EepJobCallCycle = 0.2,
63
64     // This parameter is the used size of EEPROM device in bytes.
65     .EepSize = 0x8000,
66
67     // This parameter is a reference to a callback function for positive job result
68     .Eep_JobEndNotification = &_JobEndNotify,
69
70     // This parameter is the default EEPROM device mode after initialization.
71     .EepDefaultMode = MEMIF_MODE_FAST,
72
73     // This parameter is the number of bytes read within one job processing cycle in fast mode
74     .EepFastReadBlockSize = 64,
75
76     .EepNormalReadBlockSize = 4,
77
78     // Number of bytes written within one job processing cycle in normal mode.
79     .EepNormalWriteBlockSize = 1,
80
81     // This parameter is a reference to a callback function for negative job result
82     .Eep_JobErrorNotification = &_JobErrorNotify,
83
84     // This parameter is the number of bytes written within one job processing cycle in fast mode
85     .EepFastWriteBlockSize = 64,
86
87     // This parameter is the EEPROM device base address.
88     .EepBaseAddress =  0
89     }
90 };