]> rtime.felk.cvut.cz Git - arc.git/blob - boards/mpc5516it/config/Spi_Cfg.h
At least MPC5516IT test for SPI and EEP works
[arc.git] / boards / mpc5516it / config / Spi_Cfg.h
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 #ifndef SPI_CFG_H_
18 #define SPI_CFG_H_
19
20 #include "Dma.h"
21 #include "mpc55xx.h"
22 #include "Mcu.h"
23
24 #define DSPI_CTRL_A     0
25 #define DSPI_CTRL_B     1
26 #define DSPI_CTRL_C     2
27 #define DSPI_CTRL_D     3
28
29 /*
30  * General configuration
31  */
32
33 // Maximum amount of data that can be written/read in one go.
34 #define SPI_EB_MAX_LENGTH                                       64
35
36 // Switches the Spi_Cancel function ON or OFF.
37 #define SPI_CANCEL_API                                          STD_OFF
38
39 // Selects the SPI Handler/Driver Channel Buffers usage allowed and delivered.
40 // LEVEL 0 - Only Internal buffers
41 // LEVEL 1 - Only external buffers
42 // LEVEL 2 - Both internal/external buffers
43 #define SPI_CHANNEL_BUFFERS_ALLOWED     1
44
45 #define SPI_DEV_ERROR_DETECT                    STD_ON
46 // Switches the Spi_GetHWUnitStatus function ON or OFF.
47 #define SPI_HW_STATUS_API                                       STD_ON
48 // Switches the Interruptible Sequences handling functionality ON or OFF.
49 #define SPI_INTERRUPTIBLE_SEQ_ALLOWED           STD_OFF
50
51 // LEVEL 0 - Simple sync
52 // LEVEL 1 - Basic async
53 // LEVEL 2 - Enhanced mode
54 #define SPI_LEVEL_DELIVERED                             2
55
56 #define SPI_VERSION_INFO_API                            STD_ON
57
58 #if 0
59 #if SPI_LEVEL_DELIVERED>=1
60 #define SPI_INTERRUPTIBLE_SEQ_ALLOWED   STD_ON
61 #endif
62 #endif
63
64 typedef enum {
65         SPI_EXT_DEVICE_A_E2,
66 } Spi_ExternalDeviceTypeType;
67
68 #define SPI_CH_E2_CMD           0
69 #define SPI_CH_E2_ADDR          1
70 #define SPI_CH_E2_WREN          2
71 #define SPI_CH_E2_DATA          3
72
73 #define SPI_JOB_E2_CMD          0
74 #define SPI_JOB_E2_CMD2         1
75 #define SPI_JOB_E2_DATA         2
76 #define SPI_JOB_E2_WREN         3
77
78 #define SPI_SEQ_E2_CMD          0
79 #define SPI_SEQ_E2_CMD2         1
80 #define SPI_SEQ_E2_READ         2
81 #define SPI_SEQ_E2_WRITE        3
82
83 #define SPI_MAX_JOB                     4
84 #define SPI_MAX_CHANNEL         4
85 #define SPI_MAX_SEQUENCE        4
86
87
88 #endif /*SPI_CFG_H_*/