author | arunabha |
Fri, 08 Oct 2010 13:00:25 +0100 | |
branch | BYD_LCD_Integration |
changeset 86 | 56c9b613f311 |
parent 85 | d93b485c1325 |
permissions | -rw-r--r-- |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
1 |
// This component and the accompanying materials are made available |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
2 |
// under the terms of the License "Eclipse Public License v1.0" |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
3 |
// which accompanies this distribution, and is available |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
4 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
5 |
// |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
6 |
// Initial Contributors: |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
7 |
// lukasz.forynski@gmail.com |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
8 |
// |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
9 |
// Contributors: |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
10 |
// |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
11 |
// |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
12 |
// Description: |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
13 |
// omap3530/omap3530_drivers/spi/omap3530_spi.h |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
14 |
// |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
15 |
// This file contains definitions to internal SPI implementation and register definitions |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
16 |
// It is not intended to be exported - SPI registers must not be modified from outside of |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
17 |
// the driver! |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
18 |
// |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
19 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
20 |
#ifndef __OMAP3530_SPI_H__ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
21 |
#define __OMAP3530_SPI_H__ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
22 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
23 |
#include <assp/omap3530_assp/omap3530_scm.h> |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
24 |
#include <assp/omap3530_assp/omap3530_gpio.h> |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
25 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
26 |
#define BIT_MASK(shift,len) (((1u << (len)) - 1) << (shift)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
27 |
#define GET_BITS(w,shift,len) (((w) >> (shift)) & ((1 << (len)) - 1)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
28 |
#define SET_BITS(w,set,shift,len) ((w) &= ~BIT_MASK(shift, len), (w) |= ((set) << (shift))) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
29 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
30 |
// Device Instance Summary |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
31 |
const TUint MCSPI1_phys = 0x48098000; // 4Kbytes |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
32 |
const TUint MCSPI2_phys = 0x4809A000; // 4Kbytes |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
33 |
const TUint MCSPI3_phys = 0x480B8000; // 4Kbytes |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
34 |
const TUint MCSPI4_phys = 0x480BA000; // 4Kbytes |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
35 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
36 |
const TUint MCSPI1 = Omap3530HwBase::TVirtual<MCSPI1_phys>::Value; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
37 |
const TUint MCSPI2 = Omap3530HwBase::TVirtual<MCSPI2_phys>::Value; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
38 |
const TUint MCSPI3 = Omap3530HwBase::TVirtual<MCSPI3_phys>::Value; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
39 |
const TUint MCSPI4 = Omap3530HwBase::TVirtual<MCSPI4_phys>::Value; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
40 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
41 |
// map of SPI base addresses.. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
42 |
const TUint KMcSpiRegBase[] = |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
43 |
{ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
44 |
Omap3530HwBase::TVirtual<MCSPI1_phys>::Value, //McSPI module 1 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
45 |
Omap3530HwBase::TVirtual<MCSPI2_phys>::Value, //McSPI module 2 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
46 |
Omap3530HwBase::TVirtual<MCSPI3_phys>::Value, //McSPI module 3 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
47 |
Omap3530HwBase::TVirtual<MCSPI4_phys>::Value //McSPI module 4 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
48 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
49 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
50 |
//.. and IRQ lines for SPI channels |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
51 |
const TUint KMcSpiIrqId[] = |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
52 |
{ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
53 |
EOmap3530_IRQ65_SPI1_IRQ, //McSPI module 1 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
54 |
EOmap3530_IRQ66_SPI2_IRQ, //McSPI module 2 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
55 |
EOmap3530_IRQ91_SPI3_IRQ, //McSPI module 3 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
56 |
EOmap3530_IRQ48_SPI4_IRQ //McSPI module 4 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
57 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
58 |
|
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
59 |
// available channels per module i.e. number of 'slave select' inputs/outpus signals / addresses |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
60 |
// per module. |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
61 |
const TUint KMcSpiNumSupportedSlaves[] = |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
62 |
{ |
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
63 |
4, // slave address range: 0 - 3 |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
64 |
2, // slave address range: 0 - 1 |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
65 |
6, // slave address range: 0 - 5 (0,1: pin option 0; 2,3: pin option 1; 4,5: pin option 2) |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
66 |
1 // slave address range: 0 only |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
67 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
68 |
|
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
69 |
|
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
70 |
//--------------------------------------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
71 |
// MCSPI Registers offsets and bits definitions |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
72 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
73 |
// MCSPI_REVISION |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
74 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
75 |
const TUint MCSPI_REVISION = 0x00; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
76 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
77 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
78 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
79 |
// MCSPI_SYSCONFIG |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
80 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
81 |
const TUint MCSPI_SYSCONFIG = 0x10; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
82 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
83 |
// 9:8 CLOCKACTIVITY Clocks activity during wake up mode period |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
84 |
//0x0: Interface and Functional clocks may be switched off. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
85 |
//0x1: Interface clock is maintained. Functional clock may be switched off. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
86 |
//0x2: Functional clock is maintained. Interface clock may be switched off. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
87 |
//0x3: Interface and Functional clocks are maintained. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
88 |
const TUint MCSPI_SYSCONFIG_CLOCKACTIVITY_ALL_OFF = 0 << 8; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
89 |
const TUint MCSPI_SYSCONFIG_CLOCKACTIVITY_INT_ON_FUN_OFF = 1 << 8; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
90 |
const TUint MCSPI_SYSCONFIG_CLOCKACTIVITY_INT_OFF_FUN_ON = 2 << 8; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
91 |
const TUint MCSPI_SYSCONFIG_CLOCKACTIVITY_ALL_ON = 3 << 8; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
92 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
93 |
// 4:3 SIDLEMODE Power management |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
94 |
const TUint MCSPI_SYSCONFIG_SIDLEMODE_ALWAYS = 0 << 3; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
95 |
const TUint MCSPI_SYSCONFIG_SIDLEMODE_IGNORE = 1 << 3; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
96 |
const TUint MCSPI_SYSCONFIG_SIDLEMODE_COND = 2 << 3; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
97 |
const TUint MCSPI_SYSCONFIG_ENAWAKEUP = 1 << 2; // 0x1: Wake-up capability enabled |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
98 |
const TUint MCSPI_SYSCONFIG_SOFTRESET = 1 << 1; // Software reset. Read always returns 0. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
99 |
const TUint MCSPI_SYSCONFIG_AUTOIDLE = 1 << 0; // Internal interface Clock gating strategy |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
100 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
101 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
102 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
103 |
// MCSPI_SYSSTATUS |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
104 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
105 |
const TUint MCSPI_SYSSTATUS = 0x14; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
106 |
const TUint MCSPI_SYSSTATUS_RESETDONE = 1 << 0; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
107 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
108 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
109 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
110 |
// MCSPI_IRQSTATUS |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
111 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
112 |
const TUint MCSPI_IRQSTATUS = 0x18; // for each bit- write 0x1: reset status, Read 0x1: Event is pending. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
113 |
const TUint MCSPI_IRQSTATUS_EOW = 1 << 17; // End of word count event when a channel is enabled using |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
114 |
const TUint MCSPI_IRQSTATUS_WKS = 1 << 16; // Wake-up event in slave mode when an active control signal is detected |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
115 |
const TUint MCSPI_IRQSTATUS_RX3_FULL = 1 << 14; // MCSPI_RX3 register is full (only when channel 3 is enabled) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
116 |
const TUint MCSPI_IRQSTATUS_TX3_UDERFLOW = 1 << 13; // MCSPI_TX3 register underflow (only when channel 3 is enabled)(1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
117 |
const TUint MCSPI_IRQSTATUS_TX3_EMPTY = 1 << 12; // MCSPI_TX3 register is empty (only when channel 3 is enabled)(2) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
118 |
const TUint MCSPI_IRQSTATUS_RX2_FULL = 1 << 10; // MCSPI_RX2 register full (only when channel 2 is enabled) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
119 |
const TUint MCSPI_IRQSTATUS_TX2_UNDERFLOW = 1 << 9; // MCSPI_TX2 register underflow (only when channel 2 is enabled)(1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
120 |
const TUint MCSPI_IRQSTATUS_TX2_EMPTY = 1 << 8; // MCSPI_TX2 register empty (only when channel 2 is enabled)(2) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
121 |
const TUint MCSPI_IRQSTATUS_RX1_FULL = 1 << 6; // MCSPI_RX1 register full (only when channel 1 is enabled) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
122 |
const TUint MCSPI_IRQSTATUS_TX1_UNDERFLOW = 1 << 5; // MCSPI_TX1 register underflow (only when channel 1 is enabled)(1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
123 |
const TUint MCSPI_IRQSTATUS_TX1_EMPTY = 1 << 4; // MCSPI_TX1 register empty (only when channel 1 is enabled)(3) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
124 |
const TUint MCSPI_IRQSTATUS_RX0_OVERFLOW = 1 << 3; // MCSPI_RX0 register overflow (only in slave mode) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
125 |
const TUint MCSPI_IRQSTATUS_RX0_FULL = 1 << 2; // MCSPI_RX0 register full (only when channel 0 is enabled) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
126 |
const TUint MCSPI_IRQSTATUS_TX0_UNDERFLOW = 1 << 1; // MCSPI_TX0 register underflow (only when channel 0 is |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
127 |
const TUint MCSPI_IRQSTATUS_TX0_EMPTY = 1 << 0; // MCSPI_TX0 register empty (only when channel 0 is enabled)(3) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
128 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
129 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
130 |
// MCSPI_IRQENABLE |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
131 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
132 |
//0x0: Interrupt disabled |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
133 |
//0x1: Interrupt enabled |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
134 |
const TUint MCSPI_IRQENABLE = 0x1C; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
135 |
const TUint MCSPI_IRQENABLE_EOWKE = 1 << 17; // End of Word count Interrupt Enable. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
136 |
const TUint MCSPI_IRQENABLE_WKE = 1 << 16; // Wake-up event interrupt enable in slave mode when an |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
137 |
const TUint MCSPI_IRQENABLE_RX3_FULL = 1 << 14; // MCSPI_RX3 register full interrupt enable (channel 3) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
138 |
const TUint MCSPI_IRQENABLE_TX3_UNDERFLOW = 1 << 13; // MCSPI_TX3 register underflow interrupt enable (channel 3) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
139 |
const TUint MCSPI_IRQENABLE_TX3_EMPTY = 1 << 12; // MCSPI_TX3 register empty interrupt enable (channel 3) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
140 |
const TUint MCSPI_IRQENABLE_RX2_FULL = 1 << 10; // MCSPI_RX2 register full interrupt enable (channel 2) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
141 |
const TUint MCSPI_IRQENABLE_TX2_UNDERFLOW = 1 << 9; // MCSPI_TX2 register underflow interrupt enable (channel 2) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
142 |
const TUint MCSPI_IRQENABLE_TX2_EMPTY = 1 << 8; // MCSPI_TX2 register empty interrupt enable (channel 2) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
143 |
const TUint MCSPI_IRQENABLE_RX1_FULL = 1 << 6; // MCSPI_RX1 register full interrupt enable (channel 1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
144 |
const TUint MCSPI_IRQENABLE_TX1_UNDERFLOW = 1 << 5; // MCSPI_TX1 register underflow interrupt enable (channel 1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
145 |
const TUint MCSPI_IRQENABLE_TX1_EMPTY = 1 << 4; // MCSPI_TX1 register empty interrupt enable (channel 1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
146 |
const TUint MCSPI_IRQENABLE_RX0_OVERFLOW = 1 << 3; // MCSPI_RX0 register overflow interrupt enable (channel 0) (only Slave) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
147 |
const TUint MCSPI_IRQENABLE_RX0_FULL = 1 << 2; // MCSPI_RX0 register full interrupt enable (channel 0) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
148 |
const TUint MCSPI_IRQENABLE_TX0_UNDERFLOW = 1 << 1; // MCSPI_TX0 register underflow interrupt enable (channel 0) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
149 |
const TUint MCSPI_IRQENABLE_TX0_EMPTY = 1 << 0; // MCSPI_TX0 register empty interrupt enable (channel 0) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
150 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
151 |
// macros to get these flags depending on the channel number..and ommited ENABLE |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
152 |
// - as they are the same for MCSPI_IRQSTATUS register |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
153 |
#define MCSPI_IRQ_RX_OVERFLOW MCSPI_IRQENABLE_RX0_OVERFLOW // Channel 0 only / slave mode only |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
154 |
#define MCSPI_IRQ_RX_FULL(chan) (MCSPI_IRQENABLE_RX0_FULL << ((chan)*4)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
155 |
#define MCSPI_IRQ_TX_UNDERFLOW(chan) (MCSPI_IRQENABLE_TX0_UNDERFLOW << ((chan)*4)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
156 |
#define MCSPI_IRQ_TX_EMPTY(chan) (MCSPI_IRQENABLE_TX0_EMPTY << ((chan)*4)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
157 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
158 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
159 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
160 |
// MCSPI_WAKEUPENABL |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
161 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
162 |
const TUint MCSPI_WAKEUPENABL = 0x20; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
163 |
const TUint MCSPI_WAKEUPENABL_WKEN = 1 << 0; //0x1: The event is allowed to wake-up the system |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
164 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
165 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
166 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
167 |
// MCSPI_SYST |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
168 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
169 |
const TUint MCSPI_SYST = 0x24; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
170 |
const TUint MCSPI_SYST_SSB = 1 << 11; // Set status bit: 0x1: Force to 1 all status bits of MCSPI_ IRQSTATUS |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
171 |
const TUint MCSPI_SYST_SPIENDIR = 1 << 10; // spim_cs and spim_clk direction: 0x0: Output (as in master mode), 0x1: Input (as in slave mode) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
172 |
const TUint MCSPI_SYST_SPIDATDIR1 = 1 << 9; // SPIDAT[1] (spim_simo) direction- 0x0: Output, 0x1: Input |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
173 |
const TUint MCSPI_SYST_SPIDATDIR0 = 1 << 8; // Set the direction of the SPIDAT[0] (spim_somi) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
174 |
const TUint MCSPI_SYST_WAKD = 1 << 7; // SWAKEUP output 0x0: The pin is driven low, 0x1: The pin is driven high. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
175 |
const TUint MCSPI_SYST_SPICLK = 1 << 6; // spim_clk line (signal data value) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
176 |
const TUint MCSPI_SYST_SPIDAT_1 = 1 << 5; // spim_somi line (signal data value) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
177 |
const TUint MCSPI_SYST_SPIDAT_0 = 1 << 4; // spim_simo line (signal data value) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
178 |
const TUint MCSPI_SYST_SPIEN_3 = 1 << 3; // spim_cs3 line (signal data value) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
179 |
const TUint MCSPI_SYST_SPIEN_2 = 1 << 2; // spim_cs2 line (signal data value) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
180 |
const TUint MCSPI_SYST_SPIEN_1 = 1 << 1; // spim_cs1 line (signal data value) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
181 |
const TUint MCSPI_SYST_SPIEN_0 = 1 << 0; // spim_cs0 line (signal data value) RW 0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
182 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
183 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
184 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
185 |
// MCSPI_MODULCTRL |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
186 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
187 |
const TUint MCSPI_MODULCTRL = 0x28; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
188 |
const TUint MCSPI_MODULCTRL_SYSTEM_TEST = 1 << 3; // 0x0: Functional mode, 0x1: System test mode (SYSTEST) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
189 |
const TUint MCSPI_MODULCTRL_MS_SLAVE = 1 << 2; // Master / Slave mode 0x0: Master, 0x1: Slave |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
190 |
const TUint MCSPI_MODULCTRL_MS_MASTER = 0; // this is spurious definition -> not to write '0' magic number -defined this.. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
191 |
const TUint MCSPI_MODULCTRL_SINGLE = 1 << 0; // Single forced channel/multichannel (master mode only) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
192 |
// MCSPI_CHxCONF_FORCE bit has to be set in this mode, TURBO cleared (recomended) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
193 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
194 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
195 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
196 |
// MCSPI_CHxCONF - channel config |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
197 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
198 |
// x = 0 to 3 for MCSPI1. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
199 |
// x = 0 to 1 for MCSPI2 and MCSPI3. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
200 |
// x = 0 for MCSPI4. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
201 |
#define MCSPI_CHxCONF(x) (0x2C + 0x14 * (x)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
202 |
const TUint MCSPI_CHxCONF_CLKG = 1 << 29; // Clock divider granularity. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
203 |
const TUint MCSPI_CHxCONF_FFER = 1 << 28; // FIFO enabled for Receive. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
204 |
const TUint MCSPI_CHxCONF_FFEW = 1 << 27; // FIFO enabled for Transmit. Only one channel can have this bit field set. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
205 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
206 |
// [26:25] TCS Chip select time control |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
207 |
// Defines the number of interface clock cycles between CS toggling and first (or last) edge of SPI clock. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
208 |
const TUint MCSPI_CHxCONF_TCS_0_5 = 0 << 25; // 0x0: 0.5 clock cycle |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
209 |
const TUint MCSPI_CHxCONF_TCS_1_5 = 1 << 25; // 0x1: 1.5 clock cycles |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
210 |
const TUint MCSPI_CHxCONF_TCS_2_5 = 2 << 25; // 0x2: 2.5 clock cycles |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
211 |
const TUint MCSPI_CHxCONF_TCS_3_5 = 3 << 25; // 0x3: 3.5 clock cycles |
85
d93b485c1325
updated SPI. Added template touch (byd_touch) -WORKING version,does not work-needs update as I missunderstood how the touchcontroller(chip) works. Submitting in order to share whatever there was-prior to going for holiday
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
84
diff
changeset
|
212 |
const TUint MCSPI_CHxCONF_TCS_SHIFT = 25; |
d93b485c1325
updated SPI. Added template touch (byd_touch) -WORKING version,does not work-needs update as I missunderstood how the touchcontroller(chip) works. Submitting in order to share whatever there was-prior to going for holiday
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
84
diff
changeset
|
213 |
const TUint KMaxTransactionWaitTime = 3; |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
214 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
215 |
const TUint MCSPI_CHxCONF_SBPOL = 1 << 24; // Start bit polarity (0: spi word is command, 1: spi word is data) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
216 |
const TUint MCSPI_CHxCONF_SBE = 1 << 23; // Start bit enable - 0x1: Start bit D/CX added before transfer. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
217 |
const TUint MCSPI_CHxCONF_FORCE = 1 << 20; // Manual spim_csx assertion to keep spim_csx active between SPI words. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
218 |
// (single channel master mode only)- MCSPI_MODULCTRL_SINGLE has to be set |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
219 |
const TUint MCSPI_CHxCONF_TURBO = 1 << 19; // Turbo mode |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
220 |
const TUint MCSPI_CHxCONF_IS = 1 << 18; // Input select- 0x0: (spim_somi), 0x1: (spim_simo) selected for reception |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
221 |
const TUint MCSPI_CHxCONF_DPE1 = 1 << 17; // Transmission enable for data line 1 (spim_simo) RW 0x1 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
222 |
const TUint MCSPI_CHxCONF_DPE0 = 1 << 16; // Transmission enable for data line 0 (spim_somi) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
223 |
const TUint MCSPI_CHxCONF_DMAR = 1 << 15; // DMA Read request |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
224 |
const TUint MCSPI_CHxCONF_DMAW = 1 << 14; // DMA Write request. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
225 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
226 |
// 13:12 TRM Transmit/receive modes |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
227 |
const TUint MCSPI_CHxCONF_TRM_TRANSMIT_RECEIVE = 0 << 12; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
228 |
const TUint MCSPI_CHxCONF_TRM_RECEIVE_ONLY = 1 << 12; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
229 |
const TUint MCSPI_CHxCONF_TRM_TRANSMIT_ONLY = 2 << 12; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
230 |
// these are to be cleared in the register |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
231 |
const TUint MCSPI_CHxCONF_TRM_NO_TRANSMIT = 1 << 12; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
232 |
const TUint MCSPI_CHxCONF_TRM_NO_RECEIVE = 2 << 12; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
233 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
234 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
235 |
// 11:7 WL SPI word length0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
236 |
// values:<0-3> reserved, allowed:<4-31> => word_size = value + 1 (i.e. for 4: word size = 5) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
237 |
const TInt KMinSpiWordWidth = 5; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
238 |
const TUint MCSPI_CHxCONF_WL_OFFSET = 7; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
239 |
#define MCSPI_CHxCONF_WL(x) ( (((x) - 1) & BIT_MASK(0, 5)) << MCSPI_CHxCONF_WL_OFFSET ) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
240 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
241 |
const TUint MCSPI_CHxCONF_EPOL_LOW = 1 << 6; // spim_csx polarity 0x0: active high, 0x1: active low |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
242 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
243 |
// A programmable clock divider divides the SPI reference clock |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
244 |
//5:2 CLKD Frequency divider for spim_clk (for master device only) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
245 |
const TUint MCSPI_CHxCONF_CLKD_48M = 0x0 << 2; //0x0: 1 = 48 MHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
246 |
const TUint MCSPI_CHxCONF_CLKD_24M = 0x1 << 2; //0x1: 2 = 24 MHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
247 |
const TUint MCSPI_CHxCONF_CLKD_12M = 0x2 << 2; //0x2: 4 = 12 MHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
248 |
const TUint MCSPI_CHxCONF_CLKD_6M = 0x3 << 2; //0x3: 8 = 6 MHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
249 |
const TUint MCSPI_CHxCONF_CLKD_3M = 0x4 << 2; //0x4: 16 = 3 MHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
250 |
const TUint MCSPI_CHxCONF_CLKD_1500k = 0x5 << 2; //0x5: 32 = 1.5 MHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
251 |
const TUint MCSPI_CHxCONF_CLKD_750k = 0x6 << 2; //0x6: 64 = 750 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
252 |
const TUint MCSPI_CHxCONF_CLKD_375k = 0x7 << 2; //0x7: 128 = 375 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
253 |
const TUint MCSPI_CHxCONF_CLKD_187k = 0x8 << 2; //0x8: 256 = 187.5 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
254 |
const TUint MCSPI_CHxCONF_CLKD_93k = 0x9 << 2; //0x9: 512 = 93.75 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
255 |
const TUint MCSPI_CHxCONF_CLKD_46k = 0xA << 2; //0xA: 1024 = 46.875 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
256 |
const TUint MCSPI_CHxCONF_CLKD_23k = 0xB << 2; //0xB: 2048 = 23.437,5 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
257 |
const TUint MCSPI_CHxCONF_CLKD_11k = 0xC << 2; //0xC: 4096 = 11.718,75 kHz |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
258 |
const TUint MCSPI_K48MHz = 48000000; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
259 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
260 |
const TUint MCSPI_CHxCONF_POL = 1 << 1; // spim_clk polarity 0x0: active high, 0x1: active low |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
261 |
const TUint MCSPI_CHxCONF_PHA = 1 << 0; // spim_clk phase |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
262 |
// 0x0: Data are latched on odd-numbered edges of spim_clk. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
263 |
// 0x1: Data are latched on even-numbered edges of spim_clk. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
264 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
265 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
266 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
267 |
// MCSPI_CHxSTAT |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
268 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
269 |
// x = 0 to 3 for MCSPI1. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
270 |
// x = 0 to 1 for MCSPI2 and MCSPI3. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
271 |
// x = 0 for MCSPI4. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
272 |
#define MCSPI_CHxSTAT(x) (0x30 + 0x14 * (x)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
273 |
const TUint MCSPI_CHxSTAT_RXFFF = 1 << 6; // Channel x FIFO Receive Buffer Full |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
274 |
const TUint MCSPI_CHxSTAT_RXFFE = 1 << 5; // Channel x FIFO Receive Buffer Empty |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
275 |
const TUint MCSPI_CHxSTAT_TXFFF = 1 << 4; // Channel x FIFO Transmit Buffer Full |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
276 |
const TUint MCSPI_CHxSTAT_TXFFE = 1 << 3; // Channel x FIFO Transmit Buffer Empty |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
277 |
const TUint MCSPI_CHxSTAT_EOT = 1 << 2; // Channel x end-of-transfer status. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
278 |
const TUint MCSPI_CHxSTAT_TXS = 1 << 1; // Channel x MCSPI_TXx register status R 0x0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
279 |
const TUint MCSPI_CHxSTAT_RXS = 1 << 0; // Channel x MCSPI_RXx register status R 0x0 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
280 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
281 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
282 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
283 |
// MCSPI_CHxCTRL |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
284 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
285 |
// x = 0 to 3 for MCSPI1. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
286 |
// x = 0 to 1 for MCSPI2 and MCSPI3. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
287 |
// x = 0 for MCSPI4. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
288 |
#define MCSPI_CHxCTRL(x) (0x34 + 0x14 * (x)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
289 |
//15:8 EXTCLK Clock ratio extension: This register is used to concatenate with RW 0x00 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
290 |
const TUint MCSPI_CHxCTRL_EXTCLK_1 = 0x00 << 8; //0x0: Clock ratio is CLKD + 1 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
291 |
const TUint MCSPI_CHxCTRL_EXTCLK_1_16 = 0x01 << 8; //0x1: Clock ratio is CLKD + 1 + 16 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
292 |
const TUint MCSPI_CHxCTRL_EXTCLK_1_4080 = 0xff << 8; //0xFF: Clock ratio is CLKD + 1 + 4080 |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
293 |
const TUint MCSPI_CHxCTRL_EN = 0x01 << 0; // Channel enable |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
294 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
295 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
296 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
297 |
// MCSPI_TXx - Channel x Data to transmit |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
298 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
299 |
// x = 0 to 3 for MCSPI1. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
300 |
// x = 0 to 1 for MCSPI2 and MCSPI3. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
301 |
// x = 0 for MCSPI4. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
302 |
#define MCSPI_TXx(x) (0x38 + 0x14 * (x)) // Channel x Data to transmit |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
303 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
304 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
305 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
306 |
// MCSPI_RXx - Channel x Received Data |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
307 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
308 |
// x = 0 to 3 for MCSPI1. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
309 |
// x = 0 to 1 for MCSPI2 and MCSPI3. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
310 |
// x = 0 for MCSPI4. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
311 |
#define MCSPI_RXx(x) (0x3C + 0x14 * (x)) // Channel x Received Data |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
312 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
313 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
314 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
315 |
// MCSPI_XFERLEVEL |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
316 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
317 |
const TUint MCSPI_XFERLEVEL = 0x7C; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
318 |
const TUint MCSPI_XFERLEVEL_WCNT_OFFSET = 16; // [31:16] WCNT Spi word counter -> how many bytes are transfered to FIFO before tx is enabled |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
319 |
const TUint MCSPI_XFERLEVEL_AFL_OFFSET = 8; // 13:8 AFL Buffer Almost Full. 0x0: One byte , 0x1: 2 bytes, x3E: 63 bytes.. etc |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
320 |
const TUint MCSPI_XFERLEVEL_AEL_OFFSET = 0; // 5:0 AEL Buffer Almost Empty (threshold?) 0x0: One byte. 0x1: 2 bytes.. |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
321 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
322 |
#define MCSPI_XFERLEVEL_WCNT(x) ((x) << MCSPI_XFERLEVEL_WCNT_OFFSET) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
323 |
#define MCSPI_XFERLEVEL_AFL(x) (((x) << MCSPI_XFERLEVEL_AFL_OFFSET)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
324 |
#define MCSPI_XFERLEVEL_AEL(x) (((x) << MCSPI_XFERLEVEL_AEL_OFFSET)) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
325 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
326 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
327 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
328 |
// PAD (PIN) configuration for SPI |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
329 |
//---------------------------------- |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
330 |
const TUint KMaxSpiChannelsPerModule = 4; // there are max 4 channels (McSPI 1) |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
331 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
332 |
struct TPinConfig |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
333 |
{ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
334 |
TLinAddr iAddress; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
335 |
SCM::TLowerHigherWord iMswLsw; |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
336 |
TUint8 iPinNumber; |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
337 |
TUint16 iFlags; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
338 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
339 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
340 |
struct TSpiPinConfig |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
341 |
{ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
342 |
TPinConfig iClk; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
343 |
TPinConfig iSimo; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
344 |
TPinConfig iSomi; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
345 |
TPinConfig iCs[KMaxSpiChannelsPerModule]; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
346 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
347 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
348 |
const TSpiPinConfig TSpiPinConfigMcSpi1 = |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
349 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
350 |
{CONTROL_PADCONF_MCSPI1_CLK, SCM::ELsw, 171, SCM::EMode0 | SCM::EInputEnable}, // mcspi1_clk |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
351 |
{CONTROL_PADCONF_MCSPI1_CLK, SCM::EMsw, 172, SCM::EMode0 | SCM::EInputEnable}, // mcspi1_simo |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
352 |
{CONTROL_PADCONF_MCSPI1_SOMI, SCM::ELsw, 173, SCM::EMode0 | SCM::EInputEnable}, // mcspi1_somi |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
353 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
354 |
{CONTROL_PADCONF_MCSPI1_SOMI, SCM::EMsw, 174, SCM::EMode0}, // mcspi1_cs0 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
355 |
{CONTROL_PADCONF_MCSPI1_CS1, SCM::ELsw, 175, SCM::EMode0}, // mcspi1_cs1 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
356 |
{CONTROL_PADCONF_MCSPI1_CS1, SCM::EMsw, 176, SCM::EMode0}, // mcspi1_cs2 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
357 |
{CONTROL_PADCONF_MCSPI1_CS3, SCM::ELsw, 177, SCM::EMode0}, // mcspi1_cs3 |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
358 |
} |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
359 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
360 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
361 |
const TSpiPinConfig TSpiPinConfigMcSpi2 = |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
362 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
363 |
{CONTROL_PADCONF_MCSPI1_CS3, SCM::EMsw, 178, SCM::EMode0 | SCM::EInputEnable}, // mcspi2_clk |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
364 |
{CONTROL_PADCONF_MCSPI2_SIMO, SCM::ELsw, 179, SCM::EMode0 | SCM::EInputEnable}, // mcspi2_simo |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
365 |
{CONTROL_PADCONF_MCSPI2_SIMO, SCM::EMsw, 180, SCM::EMode0 | SCM::EInputEnable}, // mcspi2_somi |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
366 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
367 |
{CONTROL_PADCONF_MCSPI2_CS0, SCM::ELsw, 181, SCM::EMode0}, // mcspi2_cs0 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
368 |
{CONTROL_PADCONF_MCSPI2_CS0, SCM::EMsw, 182, SCM::EMode0}, // mcspi2_cs1 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
369 |
{0, SCM::ELsw, 0, 0}, // not supported |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
370 |
{0, SCM::ELsw, 0, 0}, // not supported |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
371 |
} |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
372 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
373 |
|
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
374 |
// McSPI3 supports 3 different pin routing settings |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
375 |
const TSpiPinConfig TSpiPinConfigMcSpi3_0 = |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
376 |
{ |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
377 |
{CONTROL_PADCONF_MMC2_CLK, SCM::ELsw, 130, SCM::EMode1 | SCM::EInputEnable}, // mcspi3_clk |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
378 |
{CONTROL_PADCONF_MMC2_CLK, SCM::EMsw, 131, SCM::EMode1 | SCM::EInputEnable}, // mcspi3_simo |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
379 |
{CONTROL_PADCONF_MMC2_DAT0, SCM::ELsw, 132, SCM::EMode1 | SCM::EInputEnable}, // mcspi3_somi |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
380 |
{ |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
381 |
{CONTROL_PADCONF_MMC2_DAT2, SCM::EMsw, 135, SCM::EMode1}, // mcspi3_cs0 |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
382 |
{CONTROL_PADCONF_MMC2_DAT2, SCM::ELsw, 134, SCM::EMode1}, // mcspi3_cs1 |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
383 |
{0, SCM::ELsw, 0, 0}, // not supported |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
384 |
{0, SCM::ELsw, 0, 0}, // not supported |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
385 |
} |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
386 |
}; |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
387 |
|
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
388 |
const TSpiPinConfig TSpiPinConfigMcSpi3_1 = |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
389 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
390 |
{CONTROL_PADCONF_DSS_DATA18, SCM::ELsw, 88, SCM::EMode2 | SCM::EInputEnable}, // mcspi3_clk |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
391 |
{CONTROL_PADCONF_DSS_DATA18, SCM::EMsw, 89, SCM::EMode2 | SCM::EInputEnable}, // mcspi3_simo |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
392 |
{CONTROL_PADCONF_DSS_DATA20, SCM::ELsw, 90, SCM::EMode2 | SCM::EInputEnable}, // mcspi3_somi |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
393 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
394 |
{CONTROL_PADCONF_DSS_DATA20, SCM::EMsw, 91, SCM::EMode2}, // mcspi3_cs0 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
395 |
{CONTROL_PADCONF_DSS_DATA22, SCM::ELsw, 92, SCM::EMode2}, // mcspi3_cs1 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
396 |
{0, SCM::ELsw, 0, 0}, // not supported |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
397 |
{0, SCM::ELsw, 0, 0}, // not supported |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
398 |
} |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
399 |
}; |
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
400 |
|
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
401 |
const TSpiPinConfig TSpiPinConfigMcSpi3_2 = |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
402 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
403 |
{CONTROL_PADCONF_ETK_D2, SCM::EMsw, 17, SCM::EMode1 | SCM::EInputEnable}, // mcspi3_clk |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
404 |
{CONTROL_PADCONF_ETK_D0, SCM::ELsw, 14, SCM::EMode1 | SCM::EInputEnable}, // mcspi3_simo |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
405 |
{CONTROL_PADCONF_ETK_D0, SCM::EMsw, 15, SCM::EMode1 | SCM::EInputEnable}, // mcspi3_somi |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
406 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
407 |
{CONTROL_PADCONF_ETK_D2, SCM::ELsw, 16, SCM::EMode1}, // mcspi3_cs0 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
408 |
{CONTROL_PADCONF_ETK_D6, SCM::EMsw, 21, SCM::EMode1}, // mcspi3_cs1 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
409 |
{0, SCM::ELsw, 0, 0}, // not supported |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
410 |
{0, SCM::ELsw, 0, 0}, // not supported |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
411 |
} |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
412 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
413 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
414 |
const TSpiPinConfig TSpiPinConfigMcSpi4 = |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
415 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
416 |
{CONTROL_PADCONF_MCBSP1_CLKR, SCM::ELsw, 156, SCM::EMode1 | SCM::EInputEnable}, // mcspi4_clk |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
417 |
{CONTROL_PADCONF_MCBSP1_DX, SCM::ELsw, 158, SCM::EMode1 | SCM::EInputEnable}, // mcspi4_simo |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
418 |
{CONTROL_PADCONF_MCBSP1_DX, SCM::EMsw, 159, SCM::EMode1 | SCM::EInputEnable}, // mcspi4_somi |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
419 |
{ |
82
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
420 |
{CONTROL_PADCONF_MCBSP_CLKS, SCM::EMsw, 161, SCM::EMode1}, // mcspi3_cs0 |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
421 |
{0, SCM::ELsw, 0, 0}, // not supported |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
422 |
{0, SCM::ELsw, 0, 0}, // not supported |
65b40f262685
updated cs pin handling
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
77
diff
changeset
|
423 |
{0, SCM::ELsw, 0, 0}, // not supported |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
424 |
} |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
425 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
426 |
|
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
427 |
const TSpiPinConfig ModulePinConfig[] = |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
428 |
{ |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
429 |
TSpiPinConfigMcSpi1, |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
430 |
TSpiPinConfigMcSpi2, |
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
431 |
TSpiPinConfigMcSpi3_0, // (default mode for McSPI3 - SPI addresses: 0 and 1) |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
432 |
TSpiPinConfigMcSpi4, |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
433 |
TSpiPinConfigMcSpi3_1, // other pin mode for McSPI3.. (spi addresses: 2 and 3) |
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
434 |
TSpiPinConfigMcSpi3_2 // other pin mode for McSPI3.. (spi addresses: 4 and 5) |
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
435 |
}; |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
436 |
|
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
437 |
|
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
438 |
#include "omap3530_spi.inl" |
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
439 |
|
84
09e266454dcf
Update SPI master pin handling: added dynamic pin configuration for McSPI3 (needed if want to use multiple device on this interface. Now following number of Slave devices is available: McSPI1: 4, McSPI2: 2, McSPI3: 6 (2 per each pin configuration), McSPI4: 1. Only McSPI3 and McSPI4 are available now -there are issues with McSPI1 & 2 due to register access (something wrong with mapping? There is Fault Category: Exception Fault Reason: 10000000
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
82
diff
changeset
|
440 |
|
77
e5fd00cbb70a
Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff
changeset
|
441 |
#endif /* __OMAP3530_SPI_H__ */ |