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 ------------------------------*/
29 //#define USE_DEBUG_PRINT 1
31 #define DEBUG_LVL DEBUG_LOW
34 static void _JobEndNotify(){
35 DEBUG(DEBUG_LOW,"EEP JOB END NOTIFICATION\n");
37 static void _JobErrorNotify(){
38 DEBUG(DEBUG_LOW,"EEP JOB ERROR NOTIFICATION\n");
41 const Eep_ConfigType EepConfigData[] = {
44 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
45 .EepCmdSequence = SPI_SEQ_EEP_CMD,
46 .EepCmd2Sequence = SPI_SEQ_EEP_CMD2,
47 .EepReadSequence = SPI_SEQ_EEP_READ,
48 .EepWriteSequence = SPI_SEQ_EEP_WRITE,
51 .EepCmdChannel = SPI_CH_EEP_CMD,
52 .EepAddrChannel = SPI_CH_EEP_ADDR,
53 .EepWrenChannel = SPI_CH_EEP_WREN,
54 .EepDataChannel = SPI_CH_EEP_DATA,
57 .EepCmdJob = SPI_EEP_CMD_JOB,
58 .EepDataJob = SPI_EEP_DATA_JOB,
61 .EepCmdChannel = SPI_EEP_CMD_CH,
62 .EepAdrChannel = SPI_EEP_ADR_CH,
63 .EepDataChannel = SPI_EEP_DATA_CH,
65 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
66 .EepReadSequence = SPI_EEP_SEQ_READ,
67 .EepWriteSequence = SPI_EEP_SEQ_WRITE,
69 // number of bytes read within one job processing cycle in normal mode.
70 .EepInitConfiguration = 1,
73 // call cycle of the job processing function during write/erase operations. Unit: [s]
74 .EepJobCallCycle = 0.2,
76 // This parameter is the used size of EEPROM device in bytes.
79 // This parameter is a reference to a callback function for positive job result
80 .Eep_JobEndNotification = &_JobEndNotify,
82 // This parameter is the default EEPROM device mode after initialization.
83 .EepDefaultMode = MEMIF_MODE_FAST,
85 // This parameter is the number of bytes read within one job processing cycle in fast mode
86 .EepFastReadBlockSize = 64,
88 .EepNormalReadBlockSize = 4,
90 // Number of bytes written within one job processing cycle in normal mode.
91 .EepNormalWriteBlockSize = 1,
93 // This parameter is a reference to a callback function for negative job result
94 .Eep_JobErrorNotification = &_JobErrorNotify,
96 // This parameter is the number of bytes written within one job processing cycle in fast mode
97 .EepFastWriteBlockSize = 64,
99 // This parameter is the EEPROM device base address.