1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
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>.
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
14 * -------------------------------- Arctic Core ------------------------------*/
31 #define DEBUG_LVL DEBUG_LOW
34 static void _JobEndNotify(){
35 DEBUG(DEBUG_LOW,"E2 JOB END NOTIFICATION\n");
37 static void _JobErrorNotify(){
38 DEBUG(DEBUG_LOW,"E2 JOB ERROR NOTIFICATION\n");
41 const Eep_ConfigType EepromConfigData[] = {
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,
50 .EepCmdChannel = SPI_CH_E2_CMD,
51 .EepAddrChannel = SPI_CH_E2_ADDR,
52 .EepWrenChannel = SPI_CH_E2_WREN,
53 .EepDataChannel = SPI_CH_E2_DATA,
57 // number of bytes read within one job processing cycle in normal mode.
58 .EepInitConfiguration = 1,
61 // call cycle of the job processing function during write/erase operations. Unit: [s]
62 .EepJobCallCycle = 0.2,
64 // This parameter is the used size of EEPROM device in bytes.
67 // This parameter is a reference to a callback function for positive job result
68 .Eep_JobEndNotification = &_JobEndNotify,
70 // This parameter is the default EEPROM device mode after initialization.
71 .EepDefaultMode = MEMIF_MODE_FAST,
73 // This parameter is the number of bytes read within one job processing cycle in fast mode
74 .EepFastReadBlockSize = 64,
76 .EepNormalReadBlockSize = 4,
78 // Number of bytes written within one job processing cycle in normal mode.
79 .EepNormalWriteBlockSize = 1,
81 // This parameter is a reference to a callback function for negative job result
82 .Eep_JobErrorNotification = &_JobErrorNotify,
84 // This parameter is the number of bytes written within one job processing cycle in fast mode
85 .EepFastWriteBlockSize = 64,
87 // This parameter is the EEPROM device base address.