source: svn/newcon3bcm2_21bu/dst/dhl/src/DHL_COM.c @ 45

Last change on this file since 45 was 45, checked in by megakiss, 11 years ago
  • Property svn:executable set to *
File size: 2.7 KB
Line 
1/*
2        DHL_COM.c
3       
4        BU2 HAL library
5
6        Communication module API
7
8        Copyright 2006~2010 Digital STREAM Technology, Inc.
9        All Rights Reserved
10*/
11
12
13#include "DHL_OSAL.h"
14#include "DHL_DBG.h"
15
16#include "DHL_COM.h"
17
18
19//DHL_MODULE("*COM", 0);
20
21
22#if COMMENT
23____Notes____(){}
24#endif
25
26/*
27        Åë½Å port´Â ÀϹÝÀûÀ¸·Î Çϳª¸¸ Áö¿øÇϹǷΠ¹«½ÃÇØµµ ÁÁÀ½..
28
29        EMMA3 SLPÀÇ °æ¿ì UART Æ÷Æ®´Â µÎ°³¸¸ Áö¿øµÈ´Ù.
30        #if ((EMMA_DEVICE == EMMA_DEVICE_EMMA3SLLP)||(EMMA_DEVICE == EMMA_DEVICE_EMMA3SLP))
31                #define DSI_CHANNEL_MAX 2
32        ...
33
34*/
35
36
37#if COMMENT
38____Config____(){}
39#endif
40
41/*
42        ÀÌ ¸ðµâ ³»ºÎ¿¡¼­ »ç¿ëµÇ´Â °¢Á¾ configuration Á¤ÀÇ.
43*/
44
45
46#if COMMENT
47____Types____(){}
48#endif
49
50/*
51        ÀÌ ¸ðµâ ³»ºÎ¿¡¼­ »ç¿ëµÇ´Â structure ¹× enumerations.
52*/
53
54
55
56#if COMMENT
57____Variables____(){}
58#endif
59
60/*
61        global·Î Àû¿ëµÇ´Â variable Á¤ÀÇ.
62        °¢ function º°·Î Ư¼öÇÑ ¿ëµµÀÇ variableÀº °¢ functionX block ¿¡¼­ Á¤ÀÇ °¡´É.
63*/
64
65static BOOL s_com_isinit = FALSE;
66
67static int s_com_uart_id = 1;  // 0, 1, 2, ...
68        // EMMA3 SL/P´Â UART¸¦ µÎ°³¸¸ Áö¿øÇϹǷÎ, 0 ¾Æ´Ï¸é 1À» »ç¿ëÇÒ ¼ö ÀÖ´Ù.
69        // ±×·¯³ª µð¹ö±× ·Î±× Ãâ·ÂÀ¸·Î 0À» »ç¿ëÇϹǷΠÅë½Å¿ëÀ¸·Î´Â 1¸¸ »ç¿ë °¡´ÉÇÏ´Ù.
70
71static tDHL_COM_RX_CB s_com_rxcb;
72
73
74
75
76#if COMMENT
77____Thread____(){}
78#endif
79
80
81#if COMMENT
82____MUART____(){}
83#endif
84
85
86#if COMMENT
87____QUE____(){}
88#endif
89
90
91#if COMMENT
92____DUART____(){}
93#endif
94
95
96#if COMMENT
97____API____(){}
98#endif
99
100
101void DHL_COM_Init(void)
102{
103        if(s_com_isinit) return;       
104       
105        //dprint(2, "uart init ok\n");
106        s_com_isinit=TRUE;
107}
108
109BOOL DHL_COM_IsTxReady(tDHL_COM_ID port)
110{
111        return TRUE;
112}
113
114DHL_RESULT DHL_COM_StartTx(tDHL_COM_ID port, UINT8 *pData, UINT32 size)
115{
116        // blocking (synchronous) or unblocking (asynchronous) ?
117       
118        return DHL_OK;
119}
120
121void DHL_COM_AbortTx(tDHL_COM_ID port)
122{
123        // blocking ¸ðµå¿¡¼­´Â abort ±â´É Áö¿øÇÏÁö ¾ÊÀ½.
124
125}
126
127BOOL DHL_COM_IsRxReady(tDHL_COM_ID port)
128{
129        return TRUE;
130}
131
132void DHL_COM_Receive(tDHL_COM_ID port, UINT8 *pBuf, UINT32 nBufSize, UINT32 *pReadSize)
133{
134        // ÀÐÀ» µ¥ÀÌÅͰ¡ ¾øÀ¸¸é 0 ¸®ÅÏ.
135        // ÀÐÀº ¹ÙÀÌÆ® Å©±â ¸¸Å­¸¸ ¸®ÅÏ.
136        *pReadSize = 0;
137}
138
139
140void DHL_COM_RegisterRxCallback(tDHL_COM_ID port, tDHL_COM_RX_CB callback)
141{
142        // ±âÁ¸ callbackÀº ¾î¶»°Ô??
143
144        s_com_rxcb = callback;
145}
146
147void DHL_COM_Config(tDHL_COM_ID port, tDHL_COM_ConfigType type, void *data)
148{
149        if (type == eDHL_COM_CT_Baudrate)
150        {
151
152        }
153        else if (type == eDHL_COM_CT_AsyncTxMode)
154        {
155
156        }
157}
158
159void DHL_COM_Status(void)
160{
161
162}
163
164
165void DHL_COM_Uninit(void)
166{
167        if(!s_com_isinit) return;       
168
169        //dprint(2, "uart uninit ok\n");
170        s_com_isinit = FALSE;
171}
172
173
174//void test_com_rx(void)
175//{
176//      unsigned char ch;
177//      UINT32 rd;
178//     
179//      while (1)
180//      {
181//              DHL_COM_Receive(1, &ch, sizeof(ch), &rd);
182//             
183//              printf("0x%x : %c\n", ch, ch);         
184//      }
185//}
186
Note: See TracBrowser for help on using the repository browser.