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
24 #warning "This default file may only be used as an example!"
\r
28 #include "Spi_Cfg.h"
\r
30 //#define USE_LDEBUG_PRINTF 1
\r
32 #define DEBUG_LVL DEBUG_LOW
\r
35 static void _JobEndNotify(){
\r
36 DEBUG(DEBUG_LOW,"EEP JOB END NOTIFICATION\n");
\r
38 static void _JobErrorNotify(){
\r
39 DEBUG(DEBUG_LOW,"EEP JOB ERROR NOTIFICATION\n");
\r
42 const Eep_ConfigType EepConfigData[] = {
\r
45 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
\r
46 .EepCmdSequence = SPI_SEQ_EEP_CMD,
\r
47 .EepCmd2Sequence = SPI_SEQ_EEP_CMD2,
\r
48 .EepReadSequence = SPI_SEQ_EEP_READ,
\r
49 .EepWriteSequence = SPI_SEQ_EEP_WRITE,
\r
52 .EepCmdChannel = SPI_CH_EEP_CMD,
\r
53 .EepAddrChannel = SPI_CH_EEP_ADDR,
\r
54 .EepWrenChannel = SPI_CH_EEP_WREN,
\r
55 .EepDataChannel = SPI_CH_EEP_DATA,
\r
58 .EepCmdJob = SPI_EEP_CMD_JOB,
\r
59 .EepDataJob = SPI_EEP_DATA_JOB,
\r
62 .EepCmdChannel = SPI_EEP_CMD_CH,
\r
63 .EepAdrChannel = SPI_EEP_ADR_CH,
\r
64 .EepDataChannel = SPI_EEP_DATA_CH,
\r
66 // READ and WRITE sequences and ID's defined in Spi_Cfg.h
\r
67 .EepReadSequence = SPI_EEP_SEQ_READ,
\r
68 .EepWriteSequence = SPI_EEP_SEQ_WRITE,
\r
70 // number of bytes read within one job processing cycle in normal mode.
\r
71 .EepInitConfiguration = 1,
\r
74 // call cycle of the job processing function during write/erase operations. Unit: [s]
\r
75 .EepJobCallCycle = 0.2,
\r
77 // This parameter is the used size of EEPROM device in bytes.
\r
78 // .EepSize = 0x8000,
\r
81 // This parameter is a reference to a callback function for positive job result
\r
82 .Eep_JobEndNotification = &_JobEndNotify,
\r
84 // This parameter is the default EEPROM device mode after initialization.
\r
85 .EepDefaultMode = MEMIF_MODE_FAST,
\r
87 // Number of bytes read within one job processing cycle in normal mode.
88 .EepNormalReadBlockSize = 4,
90 // This parameter is the number of bytes read within one job processing cycle in fast mode
\r
91 .EepFastReadBlockSize = 64,
\r
93 // Number of bytes written within one job processing cycle in normal mode.
\r
94 .EepNormalWriteBlockSize = 1,
\r
96 // This parameter is the number of bytes written within one job processing cycle in fast mode
97 .EepFastWriteBlockSize = 64,
99 // This parameter is a reference to a callback function for negative job result
\r
100 .Eep_JobErrorNotification = &_JobErrorNotify,
\r
102 // This parameter is the EEPROM page size, i.e. number of bytes.
105 // This parameter is the EEPROM device base address.
\r
106 .EepBaseAddress = 0
\r