1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
23 #warning "This default file may only be used as an example!"
\r
27 #include "Spi_Cfg.h"
\r
29 //#define USE_LDEBUG_PRINTF 1
\r
31 #define DEBUG_LVL DEBUG_LOW
\r
34 static void _JobEndNotify(){
\r
35 DEBUG(DEBUG_LOW,"EEP JOB END NOTIFICATION\n");
\r
37 static void _JobErrorNotify(){
\r
38 DEBUG(DEBUG_LOW,"EEP JOB ERROR NOTIFICATION\n");
\r
41 const Eep_ConfigType EepConfigData[] = {
\r
44 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
\r
45 .EepCmdSequence = SPI_SEQ_EEP_CMD,
\r
46 .EepCmd2Sequence = SPI_SEQ_EEP_CMD2,
\r
47 .EepReadSequence = SPI_SEQ_EEP_READ,
\r
48 .EepWriteSequence = SPI_SEQ_EEP_WRITE,
\r
51 .EepCmdChannel = SPI_CH_EEP_CMD,
\r
52 .EepAddrChannel = SPI_CH_EEP_ADDR,
\r
53 .EepWrenChannel = SPI_CH_EEP_WREN,
\r
54 .EepDataChannel = SPI_CH_EEP_DATA,
\r
57 .EepCmdJob = SPI_EEP_CMD_JOB,
\r
58 .EepDataJob = SPI_EEP_DATA_JOB,
\r
61 .EepCmdChannel = SPI_EEP_CMD_CH,
\r
62 .EepAdrChannel = SPI_EEP_ADR_CH,
\r
63 .EepDataChannel = SPI_EEP_DATA_CH,
\r
65 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
\r
66 .EepReadSequence = SPI_EEP_SEQ_READ,
\r
67 .EepWriteSequence = SPI_EEP_SEQ_WRITE,
\r
69 // number of bytes read within one job processing cycle in normal mode.
\r
70 .EepInitConfiguration = 1,
\r
73 // call cycle of the job processing function during write/erase operations. Unit: [s]
\r
74 .EepJobCallCycle = 0.2,
\r
76 // This parameter is the used size of EEPROM device in bytes.
\r
77 // .EepSize = 0x8000,
\r
80 // This parameter is a reference to a callback function for positive job result
\r
81 .Eep_JobEndNotification = &_JobEndNotify,
\r
83 // This parameter is the default EEPROM device mode after initialization.
\r
84 .EepDefaultMode = MEMIF_MODE_FAST,
\r
86 // Number of bytes read within one job processing cycle in normal mode.
87 .EepNormalReadBlockSize = 4,
89 // This parameter is the number of bytes read within one job processing cycle in fast mode
\r
90 .EepFastReadBlockSize = 64,
\r
92 // Number of bytes written within one job processing cycle in normal mode.
\r
93 .EepNormalWriteBlockSize = 1,
\r
95 // This parameter is the number of bytes written within one job processing cycle in fast mode
96 .EepFastWriteBlockSize = 64,
98 // This parameter is a reference to a callback function for negative job result
\r
99 .Eep_JobErrorNotification = &_JobErrorNotify,
\r
101 // This parameter is the EEPROM page size, i.e. number of bytes.
104 // This parameter is the EEPROM device base address.
\r
105 .EepBaseAddress = 0
\r