24 |
25 |
25 const TInt KMinimumLddMajorVersion=1; |
26 const TInt KMinimumLddMajorVersion=1; |
26 const TInt KMinimumLddMinorVersion=1; |
27 const TInt KMinimumLddMinorVersion=1; |
27 const TInt KMinimumLddBuild=1; |
28 const TInt KMinimumLddBuild=1; |
28 |
29 |
|
30 /** |
|
31 * Serial Ports Device Driver |
|
32 * |
|
33 * |
|
34 **/ |
29 class DDriverSyborgComm : public DPhysicalDevice |
35 class DDriverSyborgComm : public DPhysicalDevice |
30 { |
36 { |
31 public: |
37 public: |
32 DDriverSyborgComm(); |
38 DDriverSyborgComm(); |
|
39 ~DDriverSyborgComm(); |
33 virtual TInt Install(); |
40 virtual TInt Install(); |
34 virtual void GetCaps(TDes8 &aDes) const; |
41 virtual void GetCaps(TDes8 &aDes) const; |
35 virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion &aVer); |
42 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); |
43 virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion &aVer); |
37 }; |
|
38 |
44 |
|
45 // interface for single comm port. |
|
46 public: |
|
47 TInt OpenDfcQueue(); |
|
48 void CloseDfcQueue(); |
|
49 TDfcQue* DfcQueue(); |
|
50 |
|
51 private: |
|
52 TDynamicDfcQue* iDfcQueue; // single Dfc queue for all comm ports |
|
53 TUint8 iDfcQRefCount; // reference count for dfc queue |
|
54 }; |
|
55 |
|
56 |
|
57 |
|
58 /** |
|
59 * Driver for a single Comm port |
|
60 **/ |
39 class DCommSyborgSoc : public DComm |
61 class DCommSyborgSoc : public DComm |
40 { |
62 { |
41 public: |
63 public: |
42 DCommSyborgSoc(); |
64 DCommSyborgSoc(DDriverSyborgComm* aDriverSyborgComm); |
43 ~DCommSyborgSoc(); |
65 ~DCommSyborgSoc(); |
44 TInt DoCreate(TInt aUnit, const TDesC8* anInfo); |
66 TInt DoCreate(TInt aUnit, const TDesC8* anInfo); |
45 public: |
67 public: |
46 virtual TInt Start(); |
68 virtual TInt Start(); |
47 virtual void Stop(TStopMode aMode); |
69 virtual void Stop(TStopMode aMode); |
48 virtual void Break(TBool aState); |
70 virtual void Break(TBool aState); |
49 virtual void EnableTransmit(); |
71 virtual void EnableTransmit(); |
50 virtual TUint Signals() const; |
72 virtual TUint Signals() const; |
51 virtual void SetSignals(TUint aSetMask, TUint aClearMask); |
73 virtual void SetSignals(TUint aSetMask, TUint aClearMask); |
52 virtual TInt ValidateConfig(const TCommConfigV01 &aConfig) const; |
74 virtual TInt ValidateConfig(const TCommConfigV01 &aConfig) const; |
53 virtual void Configure(TCommConfigV01 &aConfig); |
75 virtual void Configure(TCommConfigV01 &aConfig); |
54 virtual void Caps(TDes8 &aCaps) const; |
76 virtual void Caps(TDes8 &aCaps) const; |
55 virtual TInt DisableIrqs(); |
77 virtual TInt DisableIrqs(); |
56 virtual void RestoreIrqs(TInt aIrq); |
78 virtual void RestoreIrqs(TInt aIrq); |
57 virtual TDfcQue* DfcQ(TInt aUnit); |
79 virtual TDfcQue* DfcQ(TInt aUnit); |
58 virtual void CheckConfig(TCommConfigV01& aConfig); |
80 virtual void CheckConfig(TCommConfigV01& aConfig); |
59 static void Isr(TAny* aPtr); |
81 static void Isr(TAny* aPtr); |
60 |
82 |
61 public: |
83 public: |
62 TLinAddr iPortAddr; |
84 DDriverSyborgComm* iDriverSyborgComm; |
63 TInt iIrq; |
85 TLinAddr iPortAddr; |
|
86 TInt iIrq; |
|
87 TBool iDfcQueueOpened; |
64 |
88 |
65 enum { |
89 enum { |
66 SERIAL_ID = 0, |
90 SERIAL_ID = 0, |
67 SERIAL_DATA = 1, |
91 SERIAL_DATA = 1, |
68 SERIAL_FIFO_COUNT = 2, |
92 SERIAL_FIFO_COUNT = 2, |
69 SERIAL_INT_ENABLE = 3, |
93 SERIAL_INT_ENABLE = 3, |
70 SERIAL_DMA_TX_ADDR = 4, |
94 SERIAL_DMA_TX_ADDR = 4, |
71 SERIAL_DMA_TX_COUNT = 5, /* triggers dma */ |
95 SERIAL_DMA_TX_COUNT = 5, /* triggers dma */ |
72 SERIAL_DMA_RX_ADDR = 6, |
96 SERIAL_DMA_RX_ADDR = 6, |
73 SERIAL_DMA_RX_COUNT = 7 /* triggers dma */ |
97 SERIAL_DMA_RX_COUNT = 7 /* triggers dma */ |
74 }; |
98 }; |
75 }; |
99 }; |
76 |
100 |
77 #endif |
101 #endif |