baseport/src/cedar/generic/base/syborg/serial/syborg_serial.h
changeset 0 ffa851df0825
equal deleted inserted replaced
-1:000000000000 0:ffa851df0825
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Minimalistic serial driver
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef _SYBORG_SERIAL_H
       
    19 #define _SYBORG_SERIAL_H
       
    20 
       
    21 #include <comm.h>
       
    22 #include <e32hal.h>
       
    23 #include "system.h"
       
    24 
       
    25 const TInt KMinimumLddMajorVersion=1;
       
    26 const TInt KMinimumLddMinorVersion=1;
       
    27 const TInt KMinimumLddBuild=1;
       
    28 
       
    29 class DDriverSyborgComm : public DPhysicalDevice
       
    30 {
       
    31 public:
       
    32   DDriverSyborgComm();
       
    33   virtual TInt Install();
       
    34   virtual void GetCaps(TDes8 &aDes) const;
       
    35   virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
       
    36   virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
       
    37 };
       
    38 
       
    39 class DCommSyborgSoc : public DComm
       
    40 {
       
    41 public:
       
    42   DCommSyborgSoc();
       
    43   ~DCommSyborgSoc();
       
    44   TInt DoCreate(TInt aUnit, const TDesC8* anInfo);
       
    45 public:
       
    46   virtual TInt Start();
       
    47   virtual void Stop(TStopMode aMode);
       
    48   virtual void Break(TBool aState);
       
    49   virtual void EnableTransmit();
       
    50   virtual TUint Signals() const;
       
    51   virtual void SetSignals(TUint aSetMask, TUint aClearMask);
       
    52   virtual TInt ValidateConfig(const TCommConfigV01 &aConfig) const;
       
    53   virtual void Configure(TCommConfigV01 &aConfig);
       
    54   virtual void Caps(TDes8 &aCaps) const;
       
    55   virtual TInt DisableIrqs();
       
    56   virtual void RestoreIrqs(TInt aIrq);
       
    57   virtual TDfcQue* DfcQ(TInt aUnit);
       
    58   virtual void CheckConfig(TCommConfigV01& aConfig);  
       
    59   static void Isr(TAny* aPtr);
       
    60 
       
    61 public:
       
    62   TLinAddr iPortAddr;
       
    63   TInt iIrq;
       
    64 
       
    65   enum {
       
    66     SERIAL_ID           = 0,
       
    67     SERIAL_DATA         = 1,
       
    68     SERIAL_FIFO_COUNT   = 2,
       
    69     SERIAL_INT_ENABLE   = 3,
       
    70     SERIAL_DMA_TX_ADDR  = 4,
       
    71     SERIAL_DMA_TX_COUNT = 5, /* triggers dma */
       
    72     SERIAL_DMA_RX_ADDR  = 6,
       
    73     SERIAL_DMA_RX_COUNT = 7 /* triggers dma */
       
    74   };
       
    75 };
       
    76 
       
    77 #endif