omap3530/omap3530_drivers/spi/psl_init.h
author arunabha
Fri, 08 Oct 2010 13:00:25 +0100
branchBYD_LCD_Integration
changeset 86 56c9b613f311
parent 84 09e266454dcf
permissions -rw-r--r--
Merge SPI and Touch driver template to BYD_LCD branch for integration.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
77
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
     2
// All rights reserved.
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
     3
// 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
     4
// 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
     5
// 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
     6
// 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
     7
//
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
     8
// Initial Contributors:
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
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
// Contributors:
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    12
// lukasz.forynski@gmail.com
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    13
//
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    14
// Description:
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    15
// omap3530/omap3530_drivers/spi/psl_init.h
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    16
//
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    17
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
#ifndef __OMAP3530_SPI_PSL_H__
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    20
#define __OMAP3530_SPI_PSL_H__
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    21
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: 77
diff changeset
    22
const TInt KIicPslNumOfChannels = 2; // Number of channels supported // TODO only two 3 and 4 for now..
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: 77
diff changeset
    23
// FIXME - there is a crash when using channels 1 and 2 - when accesing registers at e.g. 0xc609a000
77
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    24
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    25
struct TIicOperationType
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    26
    {
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    27
    enum TOperation
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    28
        {
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    29
        ENop             = 0x00,
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    30
        ETransmitOnly    = 0x01,
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    31
        EReceiveOnly     = 0x02,
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    32
        ETransmitReceive = 0x03
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    33
        };
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    34
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    35
    struct TOp
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    36
        {
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    37
        TUint8 iIsTransmitting : 1;
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    38
        TUint8 iIsReceiving    : 1;
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    39
        TUint8 iRest           : 6;
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
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    42
    union
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
        TOp iOp;
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    45
        TUint8 iValue;
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    46
        };
e5fd00cbb70a Added IIC SPI implementation / tests (Master channel only)
Lukasz Forynski <lukasz.forynski@gmail.com>
parents:
diff changeset
    47
    };
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
#endif /*__OMAP3530_SPI_PSL_H__*/