FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/serial/serialswitch.c @ 575:1d7a12925b8e
gsm-fw/L1/cfile: iramcode.o and xipcode.o built
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 11 Aug 2014 03:59:26 +0000 |
parents | afceeeb2cba1 |
children |
rev | line source |
---|---|
116
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * SERIALSWITCH.C |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 * This module allows managing the use of the serial ports of TI GSM Evaluation |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 * Boards. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 * An application may have to send several serial data flows. The board on which |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 * the application is running may have one or several devices. The purpose of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 * this module is to establish connections between the serial data flows and the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 * serial devices at runtime, when the application is started. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 * (C) Texas Instruments 1999 - 2003 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 #define __SERIALSWITCH_C__ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 #define __STANDARD_H__ /* Avoid to define UBYTE, SYS_UWORD16 and UINT32. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 #include "../include/config.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 #include "../include/sys_types.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 #include "../nucleus/nucleus.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 #include "serialswitch.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 #include "uart.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 #include "uartfax.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 #include "../bsp/mem.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 #include <string.h> /* needed for memcmp & memset */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 #include "ffs/ffs.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 #include "rvf/rvf_api.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 #include "inth/iq.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 #include "rvt/rvt_def_i.h" /* needed for Riviera/Layer1 Trace's callback function */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 #if defined(BTEMOBILE) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 #include "hci_ser.h" |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 #define DUMMY_DEVICE (0) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 #define IIR (0x02) /* UART interrupt ident. register - Read only */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 #define SCR (0x10) /* UART suppl. control register - Read/Write */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 #define SSR (0x11) /* UART suppl. status register - Read only */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 * Interrupt identification register. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 * Bit 0 is set to 0 if an IT is pending. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 * Bits 1 and 2 are used to identify the IT. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 #define IIR_BITS_USED (0x07) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 #define IT_NOT_PENDING (0x01) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 * Supplementary Control Register |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 #define RX_CTS_WAKE_UP_ENABLE_BIT (4) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 * Supplementary Status Register |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 #define RX_CTS_WAKE_UP_STS (0x02) /* Wake-up interrupt occurred */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 * This macro allows to read an UART register. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 #define READ_UART_REGISTER(UART,REG) \ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 *((volatile SYS_UWORD8 *) ((UART)->base_address + (REG))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 * This macro allows to disable the UART's wake-up interrupt. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 #define DISABLE_WAKE_UP_INTERRUPT(UART) \ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 *((volatile SYS_UWORD8 *) ((UART)->base_address + SCR)) &= \ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 ~(1 << (RX_CTS_WAKE_UP_ENABLE_BIT)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 * Wake-up time duration in seconds and in number of TDMAs. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 * 1 TDMA = (6 / 1300) s = 0.004615 s (= 4.615 ms). |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 #define WAKE_UP_TIME_DURATION (10) /* 10 seconds */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 #define WAKE_UP_TIME_IN_TDMA (WAKE_UP_TIME_DURATION * 1300 / 6) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 * Global uartswitch variable as read from FFS. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 * It is supposed that NUMBER_OF_TR_UART, NUMBER_OF_FD_UART |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 * and NUMBER_OF_BT_UART have the same values. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 #define DUMMY ('0') |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 #define G23_PANEL ('G') |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 #define RIVIERA_TRACE_MUX ('R') |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 #define FD_AT_COMMAND ('D') |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 #define BLUETOOTH_HCI ('B') |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 char ser_cfg_info[NUMBER_OF_TR_UART] = {DUMMY, DUMMY, DUMMY}; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 char ser_cfg_info[NUMBER_OF_TR_UART] = {DUMMY, DUMMY}; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 static SYS_UWORD16 serial_cfg = 0x0048; /* All dummies */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 * Global variables used for Dynamic Switch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 static char ser_new_cfg[NUMBER_OF_TR_UART] = {DUMMY, DUMMY}; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 const static char uart_config_file[] = "/sys/uartswitch"; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 static SYS_BOOL dynamic_switch = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 /* Import Serial Info structure. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 extern T_AppliSerialInfo appli_ser_cfg_info; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 * Types of flows supported. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 typedef enum { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 TRACE_FLOW, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 FAX_DATA_FLOW, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 BLUETOOTH_HCI_FLOW |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 } t_flow_type; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 * For each serial data flow, a set of function pointers allows calling the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 * functions associated to a serial device. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 typedef struct s_tr_functions { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 T_tr_UartId device; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 void (*tr_Init) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 T_tr_Baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 void (callback_function (void))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 SYS_UWORD32 (*tr_ReadNChars) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 SYS_UWORD32 chars_to_read); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 SYS_UWORD32 (*tr_ReadNBytes) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 SYS_UWORD32 chars_to_read, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 SYS_BOOL *eof_detected); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 SYS_UWORD32 (*tr_WriteNChars) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 SYS_UWORD32 chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 SYS_UWORD32 (*tr_EncapsulateNChars) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 SYS_UWORD32 chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 SYS_UWORD32 (*tr_WriteNBytes) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 SYS_UWORD8 *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 SYS_UWORD32 chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 void (*tr_WriteChar) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 char character); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 void (*tr_WriteString) (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 char *buffer); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 SYS_BOOL (*tr_EnterSleep) (T_tr_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 void (*tr_WakeUp) (T_tr_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 } t_tr_functions; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 * Set of function pointers for fax & data functions. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 typedef struct s_fd_functions { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 T_fd_UartId device; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 T_FDRET (*fd_Initialize) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 T_FDRET (*fd_Enable) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 SYS_BOOL enable); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 T_FDRET (*fd_SetComPar) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 T_baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 T_bitsPerCharacter bpc, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 T_stopBits sb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 T_parity parity); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 T_FDRET (*fd_SetBuffer) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 SYS_UWORD16 bufSize, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 SYS_UWORD16 rxThreshold, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 SYS_UWORD16 txThreshold); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 T_FDRET (*fd_SetFlowCtrl) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 T_flowCtrlMode fcMode, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 SYS_UWORD8 XON, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 SYS_UWORD8 XOFF); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 T_FDRET (*fd_SetEscape) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 SYS_UWORD8 escChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 SYS_UWORD16 guardPeriod); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 T_FDRET (*fd_InpAvail) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 T_FDRET (*fd_OutpAvail) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 T_FDRET (*fd_EnterSleep) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 T_FDRET (*fd_WakeUp) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 T_FDRET (*fd_ReadData) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
226 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 void (readOutFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 SYS_UWORD8 nsource, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 SYS_UWORD8 *source[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 SYS_UWORD16 size[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 SYS_UWORD32 state))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 T_FDRET (*fd_WriteData) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 void (writeInFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 SYS_UWORD8 ndest, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 SYS_UWORD8 *dest[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 SYS_UWORD16 size[]))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 T_FDRET (*fd_StopRec) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 T_FDRET (*fd_StartRec) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 T_FDRET (*fd_GetLineState) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 SYS_UWORD32 *state); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 T_FDRET (*fd_SetLineState) (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 SYS_UWORD32 state, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 SYS_UWORD32 mask); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 T_FDRET (*fd_CheckXEmpty) (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 } t_fd_functions; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 * Set of function pointers for Bluetooth HCI functions. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 typedef struct s_bt_functions { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 T_bt_UartId device; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 T_HCI_RET (*bt_Init) (T_bt_UartId uart_device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 T_HCI_RET (*bt_Start) (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 T_HCI_RET (*bt_Stop) (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 T_HCI_RET (*bt_Kill) (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 T_HCI_RET (*bt_SetBaudrate) (UINT8 baudrate); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 T_HCI_RET (*bt_TransmitPacket) (void *uart_tx_buffer); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 SYS_BOOL (*bt_EnterSleep) (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 void (*bt_WakeUp) (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 } t_bt_functions; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
284 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
285 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
286 * Prototypes of dummy functions. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
287 * Dummy functions for Trace. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
288 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
289 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
290 static void dummy_tr_Init (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
291 T_tr_Baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
292 void (callback_function (void))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
293 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
294 static SYS_UWORD32 dummy_tr_ReadNChars (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
295 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
296 SYS_UWORD32 chars_to_read); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
297 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
298 static SYS_UWORD32 dummy_tr_ReadNBytes (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
299 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
300 SYS_UWORD32 chars_to_read, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
301 SYS_BOOL *eof_detected); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
302 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
303 static SYS_UWORD32 dummy_tr_WriteNChars (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
304 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
305 SYS_UWORD32 chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
306 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
307 static SYS_UWORD32 dummy_tr_EncapsulateNChars (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
308 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
309 SYS_UWORD32 chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
310 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
311 static SYS_UWORD32 dummy_tr_WriteNBytes (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
312 SYS_UWORD8 *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
313 SYS_UWORD32 chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
314 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
315 static void dummy_tr_WriteChar (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
316 char character); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
317 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
318 static void dummy_tr_WriteString (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
319 char *buffer); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
320 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
321 static SYS_BOOL dummy_tr_EnterSleep (T_tr_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
322 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
323 static void dummy_tr_WakeUp (T_tr_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
324 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
325 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
326 * Dummy functions for Fax & Data. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
327 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
328 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
329 static T_FDRET dummy_fd_Init (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
330 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
331 static T_FDRET dummy_fd_Enable (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
332 SYS_BOOL enable); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
333 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
334 static T_FDRET dummy_fd_SetComPar (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
335 T_baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
336 T_bitsPerCharacter bpc, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
337 T_stopBits sb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
338 T_parity parity); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
339 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
340 static T_FDRET dummy_fd_SetBuffer (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
341 SYS_UWORD16 bufSize, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
342 SYS_UWORD16 rxThreshold, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
343 SYS_UWORD16 txThreshold); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
344 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
345 static T_FDRET dummy_fd_SetFlowCtrl (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
346 T_flowCtrlMode fcMode, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
347 SYS_UWORD8 XON, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
348 SYS_UWORD8 XOFF); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
349 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
350 static T_FDRET dummy_fd_SetEscape (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
351 SYS_UWORD8 escChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
352 SYS_UWORD16 guardPeriod); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
353 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
354 static T_FDRET dummy_fd_InpAvail (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
355 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
356 static T_FDRET dummy_fd_OutpAvail (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
357 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
358 static T_FDRET dummy_fd_EnterSleep (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
359 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
360 static T_FDRET dummy_fd_WakeUp (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
361 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
362 static T_FDRET dummy_fd_ReadData (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
363 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
364 void (readOutFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
365 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
366 SYS_UWORD8 nsource, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
367 SYS_UWORD8 *source[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
368 SYS_UWORD16 size[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
369 SYS_UWORD32 state))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
370 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
371 static T_FDRET dummy_fd_WriteData (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
372 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
373 void (writeInFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
374 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
375 SYS_UWORD8 ndest, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
376 SYS_UWORD8 *dest[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
377 SYS_UWORD16 size[]))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
378 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
379 static T_FDRET dummy_fd_StopRec (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
380 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
381 static T_FDRET dummy_fd_StartRec (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
382 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
383 static T_FDRET dummy_fd_GetLineState (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
384 SYS_UWORD32 *state); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
385 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
386 static T_FDRET dummy_fd_SetLineState (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
387 SYS_UWORD32 state, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
388 SYS_UWORD32 mask); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
389 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
390 static T_FDRET dummy_fd_CheckXEmpty (T_fd_UartId device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
391 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
392 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
393 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
394 * Dummy functions for Bluetooth HCI. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
395 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
396 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
397 static T_HCI_RET dummy_bt_Init (T_bt_UartId uart_device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
398 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
399 static T_HCI_RET dummy_bt_Start (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
400 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
401 static T_HCI_RET dummy_bt_Stop (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
402 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
403 static T_HCI_RET dummy_bt_Kill (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
404 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
405 static T_HCI_RET dummy_bt_SetBaudrate (UINT8 baudrate); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
406 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
407 static T_HCI_RET dummy_bt_TransmitPacket (void *uart_tx_buffer); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
408 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
409 static SYS_BOOL dummy_bt_EnterSleep (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
410 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
411 static void dummy_bt_WakeUp (void); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
412 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
413 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
414 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
415 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
416 * Constants tables representing the various possible configurations |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
417 * for Trace, Fax & Data and Bluetooth HCI according to the different devices. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
418 * Constant table for Trace using no device. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
419 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
420 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
421 static const t_tr_functions dummy_trace = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
422 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
423 DUMMY_DEVICE, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
424 dummy_tr_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
425 dummy_tr_ReadNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
426 dummy_tr_ReadNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
427 dummy_tr_WriteNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
428 dummy_tr_EncapsulateNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
429 dummy_tr_WriteNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
430 dummy_tr_WriteChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
431 dummy_tr_WriteString, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
432 dummy_tr_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
433 dummy_tr_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
434 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
435 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
436 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
437 * Constant table for Trace using UART IrDA. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
438 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
439 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
440 static const t_tr_functions uart_irda_trace = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
441 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
442 UA_UART_0, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
443 UA_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
444 UA_ReadNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
445 UA_ReadNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
446 UA_WriteNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
447 UA_EncapsulateNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
448 UA_WriteNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
449 UA_WriteChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
450 UA_WriteString, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
451 UA_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
452 UA_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
453 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
454 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
455 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
456 * Constant table for Trace using UART Modem. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
457 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
458 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
459 static const t_tr_functions uart_modem_trace = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
460 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
461 UA_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
462 UA_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
463 UA_ReadNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
464 UA_ReadNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
465 UA_WriteNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
466 UA_EncapsulateNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
467 UA_WriteNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
468 UA_WriteChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
469 UA_WriteString, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
470 UA_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
471 UA_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
472 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
473 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
474 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
475 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
476 * Constant table for Trace using UART Modem2. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
477 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
478 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
479 static const t_tr_functions uart_modem2_trace = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
480 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
481 UA_UART_2, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
482 UA_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
483 UA_ReadNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
484 UA_ReadNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
485 UA_WriteNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
486 UA_EncapsulateNChars, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
487 UA_WriteNBytes, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
488 UA_WriteChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
489 UA_WriteString, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
490 UA_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
491 UA_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
492 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
493 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
494 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
495 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
496 * Constant table for Fax & Data using no device. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
497 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
498 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
499 static const t_fd_functions dummy_fax_data = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
500 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
501 DUMMY_DEVICE, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
502 dummy_fd_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
503 dummy_fd_Enable, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
504 dummy_fd_SetComPar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
505 dummy_fd_SetBuffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
506 dummy_fd_SetFlowCtrl, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
507 dummy_fd_SetEscape, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
508 dummy_fd_InpAvail, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
509 dummy_fd_OutpAvail, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
510 dummy_fd_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
511 dummy_fd_WakeUp, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
512 dummy_fd_ReadData, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
513 dummy_fd_WriteData, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
514 dummy_fd_StopRec, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
515 dummy_fd_StartRec, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
516 dummy_fd_GetLineState, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
517 dummy_fd_SetLineState, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
518 dummy_fd_CheckXEmpty |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
519 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
520 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
521 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
522 * Constant table for Fax & Data using UART Modem. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
523 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
524 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
525 #if CONFIG_FDMODEM |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
526 static const t_fd_functions uart_modem_fax_data = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
527 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
528 UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
529 UAF_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
530 UAF_Enable, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
531 UAF_SetComPar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
532 UAF_SetBuffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
533 UAF_SetFlowCtrl, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
534 UAF_SetEscape, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
535 UAF_InpAvail, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
536 UAF_OutpAvail, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
537 UAF_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
538 UAF_WakeUp, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
539 UAF_ReadData, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
540 UAF_WriteData, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
541 UAF_StopRec, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
542 UAF_StartRec, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
543 UAF_GetLineState, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
544 UAF_SetLineState, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
545 UAF_CheckXEmpty |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
546 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
547 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
548 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
549 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
550 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
551 * Constant table for BT HCI using no device. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
552 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
553 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
554 static const t_bt_functions dummy_bt_hci = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
555 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
556 DUMMY_DEVICE, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
557 dummy_bt_Init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
558 dummy_bt_Start, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
559 dummy_bt_Stop, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
560 dummy_bt_Kill, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
561 dummy_bt_SetBaudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
562 dummy_bt_TransmitPacket, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
563 dummy_bt_EnterSleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
564 dummy_bt_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
565 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
566 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
567 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
568 * Constant table for BT HCI using UART IrDA. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
569 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
570 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
571 static const t_bt_functions uart_irda_bt_hci = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
572 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
573 UABT_UART_0, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
574 hciu_init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
575 hciu_start, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
576 hciu_stop, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
577 hciu_kill, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
578 hciu_set_baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
579 hciu_transmit_packet, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
580 hciu_enter_sleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
581 hciu_wakeup |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
582 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
583 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
584 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
585 * Constant table for BT HCI using UART Modem. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
586 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
587 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
588 static const t_bt_functions uart_modem_bt_hci = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
589 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
590 UABT_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
591 hciu_init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
592 hciu_start, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
593 hciu_stop, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
594 hciu_kill, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
595 hciu_set_baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
596 hciu_transmit_packet, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
597 hciu_enter_sleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
598 hciu_wakeup |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
599 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
600 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
601 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
602 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
603 * Constant table for BT HCI using UART Modem2. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
604 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
605 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
606 static const t_bt_functions uart_modem2_bt_hci = { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
607 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
608 UABT_UART_2, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
609 hciu_init, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
610 hciu_start, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
611 hciu_stop, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
612 hciu_kill, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
613 hciu_set_baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
614 hciu_transmit_packet, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
615 hciu_go_to_sleep, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
616 hciu_wakeup |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
617 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
618 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
619 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
620 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
621 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
622 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
623 * Structure used to store initialization parameters related to the AT-Cmd/F&D flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
624 * Numbers of paramaters (in case of multiple calls) have been figured out from |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
625 * Condat AT-Command/F&D flow initialization. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
626 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
627 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
628 typedef struct s_data_flow { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
629 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
630 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
631 * Parameters related to SER_fd_SetComPar (2 calls) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
632 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
633 T_baudrate baudrate[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
634 T_bitsPerCharacter bpc[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
635 T_stopBits sb[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
636 T_parity parity[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
637 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
638 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
639 * Parameters related to SER_fd_SetBuffer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
640 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
641 SYS_WORD16 bufSize; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
642 SYS_WORD16 rxThreshold; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
643 SYS_WORD16 txThreshold; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
644 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
645 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
646 * Parameters related to SER_fd_SetFlowCtrl (2 calls) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
647 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
648 T_flowCtrlMode fcMode[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
649 SYS_UWORD8 XON[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
650 SYS_UWORD8 XOFF[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
651 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
652 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
653 * Parameters related to SER_fd_SetEscape (2 calls) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
654 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
655 SYS_UWORD8 escChar[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
656 SYS_UWORD16 guardPeriod[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
657 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
658 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
659 * Parameters related to SER_fd_SetLineState (4 calls) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
660 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
661 SYS_UWORD32 state[4]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
662 SYS_UWORD32 mask[4]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
663 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
664 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
665 * Parameters related to SER_fd_ReadData |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
666 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
667 T_suspendMode suspend_rd; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
668 void (*readOutFunc) (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
669 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
670 SYS_UWORD8 nsource, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
671 SYS_UWORD8 *source[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
672 SYS_UWORD16 size[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
673 SYS_UWORD32 state); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
674 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
675 * Parameters related to SER_fd_WriteData |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
676 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
677 T_suspendMode suspend_wr; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
678 void (*writeInFunc) (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
679 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
680 SYS_UWORD8 ndest, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
681 SYS_UWORD8 *dest[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
682 SYS_UWORD16 size[]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
683 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
684 } t_data_flow; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
685 #endif /* (defined BTEMOBILE && (CHIPSET != 12)) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
686 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
687 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
688 * UART structure used for UARTs. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
689 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
690 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
691 typedef struct s_uart { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
692 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
693 SYS_UWORD32 base_address; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
694 SYS_BOOL device_used; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
695 SYS_BOOL deep_sleep_set_up; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
696 t_flow_type flow_type; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
697 SYS_WORD16 flow_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
698 void (*interrupt_handler) (int uart_id, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
699 SYS_UWORD8 interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
700 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
701 } t_uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
702 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
703 static const t_tr_functions *tr_functions[SER_MAX_NUMBER_OF_FLOWS]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
704 static const t_fd_functions *fd_functions; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
705 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
706 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
707 static const t_bt_functions *bt_functions; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
708 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
709 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
710 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
711 static SYS_BOOL uart_fd_initialized = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
712 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
713 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
714 static SYS_UWORD8 fd_buffer[FD_MAX_BUFFER_SIZE]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
715 static SYS_BOOL fd_driver_enabled; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
716 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
717 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
718 static t_data_flow data_flow_parameters; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
719 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
720 static SYS_WORD16 bufSize; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
721 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
722 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
723 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
724 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
725 * Variables used to count calls to SER_fd_XXX functions. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
726 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
727 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
728 static SYS_UWORD8 fd_UAF_SetBuffer = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
729 static SYS_UWORD8 fd_UAF_SetEscape = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
730 static SYS_UWORD8 fd_UAF_SetComPar = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
731 static SYS_UWORD8 fd_UAF_SetFlowCtrl = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
732 static SYS_UWORD8 fd_UAF_ReadData = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
733 static SYS_UWORD8 fd_UAF_SetLineState = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
734 static SYS_UWORD8 fd_UAF_WriteData = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
735 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
736 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
737 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
738 * Timer used for duration control when UARTs are waked up by an interrupt or |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
739 * each time any new incoming characters are received; This timer prevents the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
740 * system to enter deep sleep mode. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
741 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
742 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
743 static NU_TIMER uart_sleep_timer; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
744 SYS_BOOL uart_sleep_timer_enabled; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
745 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
746 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
747 * HISR used to reset and restart the sleep timer from an UART use by a Trace |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
748 * flow in case of incoming characters. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
749 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
750 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
751 #define TIMER_HISR_PRIORITY (2) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
752 #define TIMER_HISR_STACK_SIZE (512) /* Bytes. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
753 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
754 static NU_HISR timer_hisr_ctrl_block; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
755 static char timer_hisr_stack[TIMER_HISR_STACK_SIZE]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
756 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
757 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
758 * For next arrays, it is supposed that NUMBER_OF_TR_UART, NUMBER_OF_FD_UART |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
759 * and NUMBER_OF_BT_UART have the same values. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
760 * An index on an internal uart for trace, fax & data or bluetooth hci reffers |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
761 * to the same uart device. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
762 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
763 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
764 static t_uart int_uart[NUMBER_OF_TR_UART]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
765 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
766 #if ((CHIPSET == 2) || (CHIPSET == 3)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
767 static SYS_UWORD32 uart_spurious_interrupts; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
768 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
769 static SYS_UWORD32 uart_modem_spurious_interrupts; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
770 static SYS_UWORD32 uart_irda_spurious_interrupts; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
771 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
772 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
773 static SYS_UWORD32 uart_modem2_spurious_interrupts; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
774 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
775 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
776 static const SYS_UWORD32 uart_base_address[NUMBER_OF_TR_UART] = |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
777 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
778 MEM_UART_IRDA, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
779 MEM_UART_MODEM |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
780 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
781 , MEM_UART_MODEM2 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
782 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
783 }; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
784 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
785 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
786 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
787 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
788 * dummy_tr_Init |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
789 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
790 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
791 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
792 * Parameters: See SER_tr_Init. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
793 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
794 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
795 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
796 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
797 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
798 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
799 dummy_tr_Init (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
800 T_tr_Baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
801 void (callback_function (void))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
802 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
803 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
804 * No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
805 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
806 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
807 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
808 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
809 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
810 * dummy_tr_ReadNChars |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
811 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
812 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
813 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
814 * Parameters: See SER_tr_ReadNChars. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
815 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
816 * Return: 0 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
817 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
818 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
819 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
820 static SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
821 dummy_tr_ReadNChars (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
822 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
823 SYS_UWORD32 chars_to_read) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
824 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
825 return (0); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
826 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
827 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
828 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
829 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
830 * dummy_tr_ReadNBytes |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
831 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
832 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
833 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
834 * Parameters: See SER_tr_ReadNBytes. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
835 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
836 * Return: 0 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
837 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
838 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
839 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
840 static SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
841 dummy_tr_ReadNBytes (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
842 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
843 SYS_UWORD32 chars_to_read, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
844 SYS_BOOL *eof_detected) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
845 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
846 return (0); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
847 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
848 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
849 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
850 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
851 * dummy_tr_WriteNChars |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
852 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
853 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
854 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
855 * Parameters: See SER_tr_WriteNChars. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
856 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
857 * Return: The number of character to write. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
858 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
859 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
860 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
861 static SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
862 dummy_tr_WriteNChars (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
863 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
864 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
865 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
866 return (chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
867 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
868 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
869 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
870 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
871 * dummy_tr_EncapsulateNChars |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
872 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
873 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
874 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
875 * Parameters: See SER_tr_EncapsulateNChars. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
876 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
877 * Return: The number of character to write. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
878 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
879 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
880 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
881 static SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
882 dummy_tr_EncapsulateNChars (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
883 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
884 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
885 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
886 return (chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
887 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
888 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
889 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
890 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
891 * dummy_tr_WriteNBytes |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
892 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
893 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
894 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
895 * Parameters: See SER_tr_WriteNBytes. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
896 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
897 * Return: The number of byte to write. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
898 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
899 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
900 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
901 static SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
902 dummy_tr_WriteNBytes (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
903 SYS_UWORD8 *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
904 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
905 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
906 return (chars_to_write); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
907 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
908 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
909 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
910 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
911 * dummy_tr_WriteChar |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
912 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
913 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
914 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
915 * Parameters: See SER_tr_WriteChar. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
916 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
917 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
918 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
919 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
920 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
921 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
922 dummy_tr_WriteChar (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
923 char character) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
924 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
925 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
926 * No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
927 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
928 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
929 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
930 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
931 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
932 * dummy_tr_WriteString |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
933 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
934 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
935 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
936 * Parameters: See SER_tr_WriteString. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
937 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
938 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
939 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
940 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
941 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
942 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
943 dummy_tr_WriteString (T_tr_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
944 char *buffer) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
945 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
946 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
947 * No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
948 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
949 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
950 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
951 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
952 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
953 * dummy_tr_EnterSleep |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
954 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
955 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
956 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
957 * Parameters: See SER_tr_EnterSleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
958 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
959 * Return: 1 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
960 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
961 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
962 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
963 static SYS_BOOL |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
964 dummy_tr_EnterSleep (T_tr_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
965 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
966 return (1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
967 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
968 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
969 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
970 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
971 * dummy_tr_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
972 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
973 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
974 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
975 * Parameters: See SER_tr_WakeUp. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
976 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
977 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
978 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
979 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
980 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
981 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
982 dummy_tr_WakeUp (T_tr_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
983 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
984 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
985 * No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
986 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
987 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
988 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
989 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
990 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
991 * dummy_fd_Init |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
992 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
993 * Purpose: Sets the size of the circular buffer to the maximum value and the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
994 * state of the driver to 'disabled'. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
995 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
996 * Parameters: See SER_fd_Init. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
997 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
998 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
999 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1000 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1001 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1002 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1003 dummy_fd_Init (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1004 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1005 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1006 data_flow_parameters.bufSize = FD_MAX_BUFFER_SIZE; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1007 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1008 bufSize = FD_MAX_BUFFER_SIZE; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1009 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1010 fd_driver_enabled = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1011 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1012 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1013 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1014 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1015 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1016 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1017 * dummy_fd_Enable |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1018 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1019 * Purpose: Stores the state of the driver. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1020 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1021 * Parameters: See SER_fd_Enable. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1022 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1023 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1024 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1025 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1026 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1027 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1028 dummy_fd_Enable (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1029 SYS_BOOL enable) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1030 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1031 fd_driver_enabled = enable; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1032 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1033 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1034 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1035 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1036 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1037 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1038 * dummy_fd_SetComPar |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1039 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1040 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1041 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1042 * Parameters: See SER_fd_SetComPar. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1043 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1044 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1045 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1046 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1047 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1048 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1049 dummy_fd_SetComPar (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1050 T_baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1051 T_bitsPerCharacter bpc, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1052 T_stopBits sb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1053 T_parity parity) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1054 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1055 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1056 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1057 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1058 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1059 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1060 * dummy_fd_SetBuffer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1061 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1062 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1063 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1064 * Parameters: See SER_fd_SetBuffer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1065 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1066 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1067 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1068 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1069 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1070 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1071 dummy_fd_SetBuffer (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1072 SYS_UWORD16 bufSize, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1073 SYS_UWORD16 rxThreshold, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1074 SYS_UWORD16 txThreshold) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1075 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1076 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1077 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1078 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1079 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1080 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1081 * dummy_fd_SetFlowCtrl |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1082 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1083 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1084 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1085 * Parameters: See SER_fd_SetFlowCtrl. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1086 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1087 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1088 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1089 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1090 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1091 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1092 dummy_fd_SetFlowCtrl (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1093 T_flowCtrlMode fcMode, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1094 SYS_UWORD8 XON, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1095 SYS_UWORD8 XOFF) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1096 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1097 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1098 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1099 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1100 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1101 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1102 * dummy_fd_SetEscape |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1103 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1104 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1105 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1106 * Parameters: See SER_fd_SetEscape. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1107 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1108 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1109 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1110 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1111 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1112 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1113 dummy_fd_SetEscape (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1114 SYS_UWORD8 escChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1115 SYS_UWORD16 guardPeriod) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1116 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1117 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1118 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1119 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1120 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1121 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1122 * dummy_fd_InpAvail |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1123 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1124 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1125 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1126 * Parameters: See SER_fd_InpAvail. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1127 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1128 * Return: The size of the circular buffer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1129 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1130 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1131 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1132 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1133 dummy_fd_InpAvail (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1134 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1135 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1136 return (data_flow_parameters.bufSize); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1137 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1138 return (bufSize); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1139 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1140 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1141 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1142 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1143 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1144 * dummy_fd_OutpAvail |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1145 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1146 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1147 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1148 * Parameters: See SER_fd_OutpAvail. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1149 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1150 * Return: The size of the circular buffer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1151 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1152 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1153 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1154 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1155 dummy_fd_OutpAvail (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1156 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1157 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1158 return (data_flow_parameters.bufSize); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1159 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1160 return (bufSize); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1161 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1162 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1163 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1164 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1165 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1166 * dummy_fd_EnterSleep |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1167 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1168 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1169 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1170 * Parameters: See SER_tr_EnterSleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1171 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1172 * Return: 1 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1173 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1174 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1175 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1176 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1177 dummy_fd_EnterSleep (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1178 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1179 return (1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1180 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1181 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1182 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1183 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1184 * dummy_fd_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1185 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1186 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1187 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1188 * Parameters: See SER_tr_WakeUp. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1189 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1190 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1191 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1192 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1193 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1194 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1195 dummy_fd_WakeUp (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1196 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1197 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1198 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1199 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1200 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1201 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1202 * dummy_fd_ReadData |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1203 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1204 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1205 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1206 * Parameters: See SER_fd_ReadData. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1207 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1208 * Return: 0 if the suspend parameter is set to 'sm_noSuspend'. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1209 * FD_SUSPENDED if the suspend parameter is set to 'sm_suspend'. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1210 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1211 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1212 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1213 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1214 dummy_fd_ReadData (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1215 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1216 void (readOutFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1217 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1218 SYS_UWORD8 nsource, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1219 SYS_UWORD8 *source[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1220 SYS_UWORD16 size[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1221 SYS_UWORD32 state))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1222 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1223 T_FDRET result; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1224 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1225 if (suspend == sm_noSuspend) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1226 result = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1227 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1228 result = FD_SUSPENDED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1229 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1230 return (result); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1231 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1232 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1233 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1234 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1235 * dummy_fd_WriteData |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1236 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1237 * Purpose: The user's function is called with: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1238 * - cldFromIrq = 0 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1239 * - ndest = 1 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1240 * - dest[0] is a SYS_UWORD8 pointer on the beginning address of a local |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1241 * buffer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1242 * - size[0] is set to data_flow_parameters.bufSize. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1243 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1244 * Parameters: See SER_fd_WriteData. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1245 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1246 * Return: The number of bytes written in the local buffer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1247 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1248 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1249 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1250 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1251 dummy_fd_WriteData (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1252 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1253 void (writeInFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1254 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1255 SYS_UWORD8 ndest, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1256 SYS_UWORD8 *dest[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1257 SYS_UWORD16 size[]))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1258 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1259 T_reInstMode dummyInstall; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1260 SYS_UWORD8 *destination[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1261 SYS_UWORD16 buffer_size[2]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1262 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1263 destination[0] = &(fd_buffer[0]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1264 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1265 buffer_size[0] = data_flow_parameters.bufSize; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1266 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1267 buffer_size[0] = bufSize; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1268 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1269 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1270 (*writeInFunc) (0, &dummyInstall, 1, &(destination[0]), &(buffer_size[0])); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1271 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1272 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1273 return ((T_FDRET) (data_flow_parameters.bufSize - buffer_size[0])); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1274 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1275 return ((T_FDRET) (bufSize - buffer_size[0])); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1276 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1277 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1278 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1279 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1280 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1281 * dummy_fd_StopRec |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1282 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1283 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1284 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1285 * Parameters: See SER_fd_StopRec. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1286 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1287 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1288 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1289 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1290 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1291 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1292 dummy_fd_StopRec (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1293 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1294 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1295 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1296 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1297 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1298 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1299 * dummy_fd_StartRec |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1300 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1301 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1302 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1303 * Parameters: See SER_fd_StartRec. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1304 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1305 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1306 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1307 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1308 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1309 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1310 dummy_fd_StartRec (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1311 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1312 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1313 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1314 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1315 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1316 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1317 * dummy_fd_GetLineState |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1318 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1319 * Purpose: Sets the RXBLEV field to the bufSize value. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1320 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1321 * Parameters: See SER_fd_GetLineState. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1322 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1323 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1324 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1325 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1326 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1327 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1328 dummy_fd_GetLineState (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1329 SYS_UWORD32 *state) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1330 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1331 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1332 *state = data_flow_parameters.bufSize << RXBLEV; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1333 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1334 *state = bufSize << RXBLEV; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1335 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1336 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1337 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1338 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1339 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1340 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1341 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1342 * dummy_fd_SetLineState |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1343 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1344 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1345 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1346 * Parameters: See SER_fd_SetLineState. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1347 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1348 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1349 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1350 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1351 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1352 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1353 dummy_fd_SetLineState (T_fd_UartId device, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1354 SYS_UWORD32 state, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1355 SYS_UWORD32 mask) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1356 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1357 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1358 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1359 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1360 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1361 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1362 * dummy_fd_CheckXEmpty |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1363 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1364 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1365 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1366 * Parameters: See SER_fd_CheckXEmpty. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1367 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1368 * Return: FD_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1369 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1370 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1371 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1372 static T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1373 dummy_fd_CheckXEmpty (T_fd_UartId device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1374 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1375 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1376 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1377 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1378 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1379 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1380 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1381 * dummy_bt_Init |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1382 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1383 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1384 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1385 * Parameters: See SER_bt_Init. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1386 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1387 * Return: HCI_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1388 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1389 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1390 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1391 static T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1392 dummy_bt_Init (T_bt_UartId uart_device) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1393 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1394 return (HCI_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1395 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1396 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1397 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1398 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1399 * dummy_bt_Start |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1400 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1401 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1402 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1403 * Parameters: See SER_bt_Start. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1404 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1405 * Return: HCI_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1406 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1407 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1408 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1409 static T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1410 dummy_bt_Start (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1411 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1412 return (HCI_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1413 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1414 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1415 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1416 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1417 * dummy_bt_Stop |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1418 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1419 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1420 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1421 * Parameters: See SER_bt_Stop. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1422 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1423 * Return: HCI_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1424 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1425 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1426 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1427 static T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1428 dummy_bt_Stop (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1429 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1430 return (HCI_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1431 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1432 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1433 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1434 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1435 * dummy_bt_Kill |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1436 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1437 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1438 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1439 * Parameters: See SER_bt_Kill. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1440 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1441 * Return: HCI_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1442 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1443 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1444 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1445 static T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1446 dummy_bt_Kill (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1447 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1448 return (HCI_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1449 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1450 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1451 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1452 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1453 * dummy_bt_SetBaudrate |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1454 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1455 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1456 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1457 * Parameters: See SER_bt_SetBaudrate. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1458 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1459 * Return: HCI_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1460 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1461 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1462 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1463 static T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1464 dummy_bt_SetBaudrate (UINT8 baudrate) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1465 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1466 return (HCI_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1467 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1468 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1469 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1470 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1471 * dummy_bt_TransmitPacket |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1472 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1473 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1474 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1475 * Parameters: See SER_bt_TransmitPacket. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1476 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1477 * Return: HCI_OK: Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1478 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1479 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1480 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1481 static T_HCI_RET dummy_bt_TransmitPacket (void *uart_tx_buffer) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1482 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1483 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1484 return (HCI_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1485 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1486 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1487 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1488 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1489 * dummy_bt_EnterSleep |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1490 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1491 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1492 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1493 * Parameters: See SER_bt_EnterSleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1494 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1495 * Return: TRUE. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1496 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1497 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1498 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1499 static SYS_BOOL |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1500 dummy_bt_EnterSleep (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1501 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1502 return (TRUE); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1503 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1504 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1505 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1506 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1507 * dummy_bt_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1508 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1509 * Purpose: No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1510 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1511 * Parameters: See SER_bt_WakeUp |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1512 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1513 * Return: HCI_OK: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1514 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1515 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1516 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1517 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1518 dummy_bt_WakeUp (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1519 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1520 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1521 * No action. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1522 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1523 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1524 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1525 #endif /* BTEMOBILE */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1526 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1527 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1528 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1529 * analyze_uart_sleep_timer_expiration |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1530 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1531 * Purpose : The timer has just expired. If requested, UARTs can again be set |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1532 * up to enter Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1533 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1534 * Arguments: In : id: parameter not used. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1535 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1536 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1537 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1538 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1539 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1540 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1541 static VOID |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1542 analyze_uart_sleep_timer_expiration (UNSIGNED id) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1543 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1544 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1545 * Timer has expired. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1546 * UARTs can again be set up for Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1547 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1548 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1549 (void) NU_Control_Timer (&uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1550 NU_DISABLE_TIMER); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1551 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1552 uart_sleep_timer_enabled = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1553 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1554 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1555 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1556 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1557 * start_uart_sleep_timer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1558 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1559 * Purpose : Starts the sleep timer once UARTs have been waked-up by an |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1560 * interrupt or if new incoming characters have been received. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1561 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1562 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1563 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1564 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1565 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1566 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1567 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1568 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1569 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1570 start_uart_sleep_timer (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1571 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1572 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1573 * UART sleep timer is started. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1574 * UARTs can't no more be set up for Deep Sleep until the timer expires. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1575 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1576 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1577 (void) NU_Reset_Timer (&uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1578 &analyze_uart_sleep_timer_expiration, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1579 WAKE_UP_TIME_IN_TDMA, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1580 0, /* The timer expires once. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1581 NU_DISABLE_TIMER); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1582 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1583 (void) NU_Control_Timer (&uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1584 NU_ENABLE_TIMER); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1585 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1586 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1587 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1588 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1589 * set_flow_functions |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1590 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1591 * Purpose: Initializes a serial data flow functions set with the set of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1592 * functions of the selected device. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1593 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1594 * Parameters: In : flow : index of the serial data flow |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1595 * serial_driver: allows knowing which set of functions must |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1596 * be selected |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1597 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1598 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1599 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1600 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1601 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1602 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1603 static void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1604 set_flow_functions (int flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1605 T_SerialDriver serial_driver) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1606 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1607 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1608 switch (serial_driver) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1609 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1610 case UART_MODEM_FAX_DATA: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1611 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1612 #if CONFIG_FDMODEM |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1613 fd_functions = &uart_modem_fax_data; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1614 int_uart[fd_functions->device].device_used = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1615 int_uart[fd_functions->device].flow_type = FAX_DATA_FLOW; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1616 int_uart[fd_functions->device].flow_id = flow; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1617 int_uart[fd_functions->device].interrupt_handler = |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1618 UAF_InterruptHandler; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1619 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1620 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1621 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1622 case DUMMY_FAX_DATA: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1623 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1624 fd_functions = &dummy_fax_data; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1625 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1626 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1627 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1628 case UART_IRDA_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1629 case UART_MODEM_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1630 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1631 case UART_MODEM2_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1632 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1633 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1634 if (serial_driver == UART_IRDA_TRACE) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1635 tr_functions[flow] = &uart_irda_trace; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1636 else { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1637 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1638 if (serial_driver == UART_MODEM2_TRACE) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1639 tr_functions[flow] = &uart_modem2_trace; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1640 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1641 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1642 tr_functions[flow] = &uart_modem_trace; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1643 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1644 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1645 int_uart[tr_functions[flow]->device].device_used = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1646 int_uart[tr_functions[flow]->device].flow_type = TRACE_FLOW; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1647 int_uart[tr_functions[flow]->device].flow_id = flow; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1648 int_uart[tr_functions[flow]->device].interrupt_handler = |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1649 UA_InterruptHandler; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1650 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1651 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1652 case DUMMY_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1653 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1654 tr_functions[flow] = &dummy_trace; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1655 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1656 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1657 case DUMMY_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1658 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1659 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1660 * if serial_driver = DUMMY_BT_HCI & if BTEMOBILE is not defined |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1661 * no action is performed. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1662 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1663 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1664 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1665 bt_functions = &dummy_bt_hci; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1666 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1667 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1668 case UART_IRDA_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1669 case UART_MODEM_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1670 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1671 case UART_MODEM2_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1672 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1673 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1674 if (serial_driver == UART_IRDA_BT_HCI) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1675 bt_functions = &uart_irda_bt_hci; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1676 else { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1677 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1678 if (serial_driver == UART_MODEM2_BT_HCI) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1679 bt_functions = &uart_modem2_bt_hci; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1680 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1681 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1682 bt_functions = &uart_modem_bt_hci; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1683 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1684 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1685 int_uart[bt_functions->device].device_used = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1686 int_uart[bt_functions->device].flow_type = BLUETOOTH_HCI_FLOW; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1687 int_uart[bt_functions->device].flow_id = flow; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1688 int_uart[bt_functions->device].interrupt_handler = |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1689 hciu_interrupt_handler; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1690 #endif /* BTEMOBILE */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1691 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1692 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1693 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1694 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1695 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1696 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1697 * SER_InitSerialConfig |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1698 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1699 * Purpose: The parameter serial_info allows knowing all serial information |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1700 * necessary to set up the serial configuration of an application. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1701 * From this information, the function is able to determine if the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1702 * current serial configuration read out from the flash memory is |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1703 * valid. If it does not correspond to an allowed configuration, the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1704 * default configuration is selected. This function must be called at |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1705 * the application's initialization, but never after. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1706 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1707 * Parameters: In : serial_info: application serial information like the default |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1708 * configuration and all allowed configurations. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1709 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1710 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1711 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1712 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1713 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1714 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1715 void |
117
e40d8661ecab
nuc-fw: low-level serial code should be complete
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
116
diff
changeset
|
1716 SER_InitSerialConfig (const T_AppliSerialInfo *serial_info) |
116
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1717 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1718 int uart_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1719 int flow; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1720 SYS_UWORD16 serial_driver; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1721 SYS_UWORD16 *allowed_config; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1722 SYS_UWORD8 nb_allowed_config; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1723 SYS_BOOL valid_config_selected; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1724 SYS_BOOL uart_used; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1725 SYS_BOOL uart_used_for_trace; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1726 SYS_UWORD16 current_config; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1727 SYS_UWORD16 *pt_current_config = &(current_config); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1728 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1729 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1730 * Basic UARTs initializations. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1731 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1732 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1733 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1734 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1735 int_uart[uart_id].base_address = uart_base_address[uart_id]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1736 int_uart[uart_id].device_used = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1737 int_uart[uart_id].deep_sleep_set_up = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1738 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1739 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1740 #if ((CHIPSET == 2) || (CHIPSET == 3)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1741 uart_spurious_interrupts = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1742 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1743 uart_modem_spurious_interrupts = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1744 uart_irda_spurious_interrupts = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1745 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1746 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1747 uart_modem2_spurious_interrupts = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1748 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1749 uart_sleep_timer_enabled = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1750 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1751 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1752 * Compute the current serial configuration. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1753 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1754 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1755 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1756 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1757 switch (ser_cfg_info[uart_id]) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1758 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1759 case G23_PANEL: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1760 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1761 ((uart_id + 1) << (12 - (4 * SER_PROTOCOL_STACK))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1762 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1763 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1764 case RIVIERA_TRACE_MUX: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1765 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1766 ((uart_id + 1) << (12 - (4 * SER_LAYER_1))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1767 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1768 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1769 case FD_AT_COMMAND: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1770 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1771 ((uart_id + 1) << (12 - (4 * SER_FAX_DATA))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1772 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1773 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1774 case BLUETOOTH_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1775 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1776 ((uart_id + 1) << (12 - (4 * SER_BLUETOOTH_HCI))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1777 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1778 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1779 case DUMMY: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1780 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1781 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1782 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1783 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1784 current_config = serial_cfg; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1785 valid_config_selected = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1786 nb_allowed_config = serial_info->num_config; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1787 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1788 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1789 * Checks if the current serial config is one of the allowed. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1790 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1791 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1792 while ((nb_allowed_config > 0) && !valid_config_selected) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1793 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1794 nb_allowed_config--; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1795 allowed_config = (SYS_UWORD16 *) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1796 &(serial_info->allowed_config[nb_allowed_config]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1797 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1798 if (*pt_current_config == *allowed_config) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1799 valid_config_selected = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1800 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1801 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1802 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1803 * If not, the default configuration is selected. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1804 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1805 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1806 if (!valid_config_selected) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1807 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1808 pt_current_config = (SYS_UWORD16 *)&(serial_info->default_config); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1809 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1810 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1811 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1812 * Setup the global variable accordingly. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1813 * The following default value are identical to the ones defined at |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1814 * the application initialization in init.c. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1815 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1816 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1817 #ifdef BT_UART_USED_MODEM |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1818 memcpy (ser_cfg_info, "RB", NUMBER_OF_TR_UART); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1819 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1820 memcpy (ser_cfg_info, "BR", NUMBER_OF_TR_UART); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1821 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1822 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1823 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1824 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1825 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1826 * The serial data flow functions set is initialized. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1827 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1828 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1829 flow = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1830 while (flow < SER_MAX_NUMBER_OF_FLOWS) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1831 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1832 serial_driver = (T_SerialDriver) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1833 (((*pt_current_config) >> (12 - flow * 4)) & 0x000F); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1834 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1835 set_flow_functions (flow, serial_driver); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1836 flow++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1837 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1838 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1839 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1840 * Checks if both UARTs are used. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1841 * If not, performs minimum initialization including Sleep Mode. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1842 * Checks also if at least one UART is used by a Trace flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1843 * If so, create a HISR in order to reset and restart the sleep timer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1844 * in case of incoming characters. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1845 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1846 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1847 uart_used = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1848 uart_used_for_trace = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1849 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1850 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1851 if (!(int_uart[uart_id].device_used)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1852 initialize_uart_sleep (uart_id); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1853 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1854 else { /* if (int_uart[uart_id].device_used) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1855 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1856 uart_used = 1; /* At least one UART is used */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1857 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1858 if (int_uart[uart_id].flow_type == TRACE_FLOW) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1859 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1860 /* At least one UART used by a Trace flow */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1861 uart_used_for_trace = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1862 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1863 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1864 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1865 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1866 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1867 * If at least one uart is used, create a timer to figure out if the system |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1868 * can enter deep sleep mode regarding the UARTs. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1869 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1870 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1871 if (uart_used) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1872 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1873 (void) NU_Create_Timer ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1874 &uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1875 "Sleep", |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1876 &analyze_uart_sleep_timer_expiration, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1877 0, /* Parameter supplied to the routine: not used. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1878 WAKE_UP_TIME_IN_TDMA, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1879 0, /* The timer expires once. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1880 NU_DISABLE_TIMER); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1881 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1882 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1883 * If at least one uart is used by a Trace flow, create a HISR to reset |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1884 * and restart the sleep timer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1885 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1886 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1887 if (uart_used_for_trace) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1888 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1889 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1890 * The stack is entirely filled with the pattern 0xFE. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1891 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1892 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1893 memset (&(timer_hisr_stack[0]), 0xFE, TIMER_HISR_STACK_SIZE); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1894 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1895 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1896 * The HISR entry function is the same function than the one called |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1897 * by the Rx HISR of the UARTFAX, since the only aim is to reset |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1898 * and restart the sleep timer in case of incoming characters on |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1899 * the Trace UART. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1900 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1901 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1902 (void) NU_Create_HISR ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1903 &timer_hisr_ctrl_block, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1904 "Tim_HISR", |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1905 SER_restart_uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1906 TIMER_HISR_PRIORITY, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1907 &(timer_hisr_stack[0]), |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1908 TIMER_HISR_STACK_SIZE); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1909 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1910 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1911 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1912 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1913 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1914 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1915 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1916 * SER_WriteConfig |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1917 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1918 * Purpose: TBD |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1919 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1920 * Parameters: In : new_config: TBD |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1921 * write_to_flash: TBD |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1922 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1923 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1924 * Return: 0 (FALSE) : In case of error while trying to write file in FFS |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1925 * >= 1 (TRUE) : Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1926 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1927 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1928 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1929 SYS_BOOL |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1930 SER_WriteConfig (char *new_config, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1931 SYS_BOOL write_to_flash) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1932 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1933 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1934 int uart_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1935 SYS_BOOL status = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1936 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1937 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1938 ser_new_cfg[uart_id] = *new_config++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1939 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1940 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1941 * Write in flash the new serial configuration if requested. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1942 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1943 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1944 if (write_to_flash) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1945 if (ffs_fwrite (uart_config_file, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1946 ser_new_cfg, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1947 NUMBER_OF_TR_UART) < EFFS_OK) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1948 status = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1949 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1950 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1951 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1952 return (status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1953 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1954 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1955 * Real Dynamic Switch is only available with Bluetooth AND all chips but |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1956 * Calypso+. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1957 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1958 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1959 return (1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1960 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1961 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1962 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1963 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1964 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1965 * SER_ImmediateSwitch |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1966 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1967 * Purpose: TBD |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1968 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1969 * Parameters: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1970 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1971 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1972 * Return: 0 (FALSE) : In case of error. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1973 * >= 1 (TRUE) : Successful operation. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1974 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1975 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1976 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1977 SYS_BOOL |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1978 SER_ImmediateSwitch (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1979 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1980 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1981 int uart_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1982 SYS_BOOL valid_config = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1983 T_AppliSerialInfo *serial_info = &appli_ser_cfg_info; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1984 SYS_UWORD8 nb_allowed_config = serial_info->num_config; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1985 SYS_UWORD16 *allowed_config; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1986 int flow; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1987 T_SerialDriver serial_flows[SER_MAX_NUMBER_OF_FLOWS]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1988 T_tr_UartId uart_nb; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1989 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1990 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1991 * First check if the new serial configuration is actually different from |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1992 * the previous one. A return is used to simplify the code. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1993 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1994 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1995 if (!memcmp (ser_new_cfg, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1996 ser_cfg_info, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1997 NUMBER_OF_TR_UART)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1998 return (1); /* new config and old config are identical => nothing to do */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1999 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2000 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2001 * Then check if the new serial config is valid or not. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2002 * At that point, we assume that a serial config is valid if and only if the |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2003 * Bluetooth HCI flow is still enabled and still uses the same UART. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2004 * Reset the current serial config, and compute the new one. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2005 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2006 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2007 serial_cfg = 0x0048; /* All dummies */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2008 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2009 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2010 switch (ser_new_cfg[uart_id]) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2011 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2012 case G23_PANEL: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2013 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2014 ((uart_id + 1) << (12 - (4 * SER_PROTOCOL_STACK))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2015 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2016 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2017 case RIVIERA_TRACE_MUX: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2018 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2019 ((uart_id + 1) << (12 - (4 * SER_LAYER_1))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2020 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2021 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2022 case FD_AT_COMMAND: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2023 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2024 ((uart_id + 1) << (12 - (4 * SER_FAX_DATA))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2025 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2026 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2027 case BLUETOOTH_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2028 serial_cfg = serial_cfg + |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2029 ((uart_id + 1) << (12 - (4 * SER_BLUETOOTH_HCI))); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2030 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2031 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2032 * Check if the Bluetooth HCI flow is enabled on the same UART. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2033 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2034 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2035 if (ser_cfg_info[uart_id] == BLUETOOTH_HCI) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2036 valid_config = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2037 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2038 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2039 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2040 case DUMMY: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2041 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2042 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2043 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2044 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2045 if (!valid_config) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2046 return (0); /* Bluetooth HCI flow not enabled in the new serial config, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2047 or enabled but using a different UART. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2048 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2049 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2050 * Finally check if the new serial config is allowed by the application. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2051 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2052 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2053 valid_config = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2054 while ((nb_allowed_config > 0) && !valid_config) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2055 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2056 nb_allowed_config--; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2057 allowed_config = (SYS_UWORD16 *) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2058 &(serial_info->allowed_config[nb_allowed_config]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2059 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2060 if (serial_cfg == *allowed_config) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2061 valid_config = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2062 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2063 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2064 if (!valid_config) /* the new config is not allowed by the application */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2065 return (0); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2066 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2067 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2068 * From now on, Dynamic Switch is being processed. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2069 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2070 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2071 dynamic_switch = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2072 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2073 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2074 * Disable UART interrupts until new serial config setup is complete. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2075 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2076 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2077 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2078 IQ_Mask (IQ_UART_IRDA_IT); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2079 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2080 IQ_Mask (IQ_UART_IT); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2081 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2082 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2083 * Reset UARTs set-up. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2084 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2085 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2086 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2087 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2088 int_uart[uart_id].device_used = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2089 int_uart[uart_id].deep_sleep_set_up = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2090 int_uart[uart_id].interrupt_handler = NULL; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2091 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2092 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2093 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2094 * All function pointers are set to dummy functions. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2095 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2096 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2097 rvf_disable (21); /* beginning of the critical section */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2098 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2099 for (flow = 0; flow < SER_MAX_NUMBER_OF_FLOWS; flow++) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2100 tr_functions[flow] = &dummy_trace; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2101 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2102 fd_functions = &dummy_fax_data; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2103 bt_functions = &dummy_bt_hci; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2104 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2105 rvf_enable (); /* end of the critical section */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2106 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2107 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2108 * Calls the Exit function of the UARTFAX driver if it was previously used. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2109 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2110 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2111 if (uart_fd_initialized) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2112 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2113 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2114 * UART IrDA can't be used for F&D/AT-Cmd flow => UART Modem was used |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2115 * by the F&D/AT-Cmd flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2116 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2117 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2118 if (UAF_Exit (UAF_UART_1) == FD_OK) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2119 uart_fd_initialized = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2120 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2121 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2122 else { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2123 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2124 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2125 * AT that point, since the Bluetooth HCI flow already uses one UART, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2126 * and since the second UART was not used by the F&D/AT-Cmd flow, we |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2127 * assume it was used by a Trace flow. Therefore, the HISR used to |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2128 * reset and restart the sleep timer is deleted. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2129 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2130 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2131 (void) NU_Delete_HISR (&timer_hisr_ctrl_block); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2132 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2133 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2134 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2135 * Initialization of the new flows (Only AT-Cmd/F&D or Riviera/Layer1 Trace) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2136 * and their associated UARTs HW (Irda or Modem) & SW (Trace or Fax&Data). |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2137 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2138 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2139 for (flow = 0; flow < SER_MAX_NUMBER_OF_FLOWS; flow++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2140 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2141 serial_flows[flow] = (T_SerialDriver) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2142 ((serial_cfg >> (12 - flow * 4)) & 0x000F); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2143 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2144 switch (serial_flows[flow]) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2145 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2146 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2147 * For Riviera/Layer1 Trace flow, default baudrate is 115200 bps |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2148 * and callback function is defined in rvt_def_i.h. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2149 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2150 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2151 case UART_IRDA_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2152 case UART_MODEM_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2153 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2154 if (serial_flows[flow] == UART_IRDA_TRACE) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2155 uart_nb = UA_UART_0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2156 else /* if (serial_flows[flow] == UART_MODEM_TRACE) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2157 uart_nb = UA_UART_1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2158 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2159 if (flow == SER_LAYER_1) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2160 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2161 UA_Init (uart_nb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2162 TR_BAUD_CONFIG, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2163 rvt_activate_RX_HISR); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2164 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2165 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2166 * Create the HISR used to reset and restart the sleep |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2167 * timer in case of incoming characters on the Trace flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2168 * The stack is entirely filled with the pattern 0xFE. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2169 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2170 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2171 memset (&(timer_hisr_stack[0]), |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2172 0xFE, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2173 TIMER_HISR_STACK_SIZE); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2174 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2175 (void) NU_Create_HISR ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2176 &timer_hisr_ctrl_block, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2177 "Tim_HISR", |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2178 SER_restart_uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2179 TIMER_HISR_PRIORITY, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2180 &(timer_hisr_stack[0]), |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2181 TIMER_HISR_STACK_SIZE); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2182 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2183 else /* Other Trace flows are disabled */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2184 initialize_uart_sleep (uart_nb); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2185 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2186 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2187 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2188 * For At-Cmd/F&D flow, functions are called in the appropriate |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2189 * order with the saved parameters. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2190 * This has been figured out from the G23 initialization. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2191 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2192 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2193 case UART_MODEM_FAX_DATA: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2194 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2195 /* Global Initialization */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2196 if (UAF_Init (UAF_UART_1) == FD_OK) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2197 uart_fd_initialized = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2198 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2199 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2200 /* Disable the driver */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2201 UAF_Enable (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2202 0); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2203 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2204 /* Set the SW Buffers parameters */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2205 UAF_SetBuffer (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2206 data_flow_parameters.bufSize, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2207 data_flow_parameters.rxThreshold, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2208 data_flow_parameters.txThreshold); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2209 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2210 /* Set the Escape Sequence parameters (1st call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2211 UAF_SetEscape (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2212 data_flow_parameters.escChar[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2213 data_flow_parameters.guardPeriod[0]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2214 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2215 /* Set the Communication parameters (1st call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2216 UAF_SetComPar (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2217 data_flow_parameters.baudrate[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2218 data_flow_parameters.bpc[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2219 data_flow_parameters.sb[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2220 data_flow_parameters.parity[0]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2221 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2222 /* Set the Flow Control parameters (1st call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2223 UAF_SetFlowCtrl (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2224 data_flow_parameters.fcMode[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2225 data_flow_parameters.XON[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2226 data_flow_parameters.XOFF[0]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2227 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2228 /* Set the Communication parameters (2nd call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2229 UAF_SetComPar (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2230 data_flow_parameters.baudrate[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2231 data_flow_parameters.bpc[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2232 data_flow_parameters.sb[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2233 data_flow_parameters.parity[1]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2234 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2235 /* Set the Flow Control parameters (2nd call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2236 UAF_SetFlowCtrl (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2237 data_flow_parameters.fcMode[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2238 data_flow_parameters.XON[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2239 data_flow_parameters.XOFF[1]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2240 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2241 /* Set the Escape Sequence parameters (2nd call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2242 UAF_SetEscape (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2243 data_flow_parameters.escChar[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2244 data_flow_parameters.guardPeriod[1]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2245 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2246 /* Enable the driver */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2247 UAF_Enable (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2248 1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2249 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2250 /* Get the number of input bytes available */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2251 UAF_InpAvail (UAF_UART_1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2252 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2253 /* Set the readOutFunc and the suspend mode */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2254 UAF_ReadData (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2255 data_flow_parameters.suspend_rd, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2256 data_flow_parameters.readOutFunc); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2257 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2258 /* Get the number of output bytes available (1st call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2259 UAF_OutpAvail (UAF_UART_1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2260 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2261 /* Set the states of the V.24 status lines (1st call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2262 UAF_SetLineState (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2263 data_flow_parameters.state[0], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2264 data_flow_parameters.mask[0]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2265 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2266 /* Set the states of the V.24 status lines (2nd call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2267 UAF_SetLineState (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2268 data_flow_parameters.state[1], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2269 data_flow_parameters.mask[1]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2270 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2271 /* Set the states of the V.24 status lines (3rd call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2272 UAF_SetLineState (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2273 data_flow_parameters.state[2], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2274 data_flow_parameters.mask[2]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2275 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2276 /* Set the states of the V.24 status lines (4th call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2277 UAF_SetLineState (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2278 data_flow_parameters.state[3], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2279 data_flow_parameters.mask[3]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2280 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2281 /* Set the writeInFunc and the suspend mode */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2282 UAF_WriteData (UAF_UART_1, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2283 data_flow_parameters.suspend_wr, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2284 data_flow_parameters.writeInFunc); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2285 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2286 /* Get the number of output bytes available (2nd call) */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2287 UAF_OutpAvail (UAF_UART_1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2288 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2289 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2290 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2291 case UART_IRDA_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2292 case UART_MODEM_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2293 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2294 * Nothing to initialize for Bluetooth HCI flow since it does |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2295 * use the same UART. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2296 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2297 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2298 case DUMMY_TRACE: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2299 case DUMMY_FAX_DATA: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2300 case DUMMY_BT_HCI: |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2301 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2302 * Of course nothing to perform for Dummy flows. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2303 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2304 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2305 break; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2306 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2307 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2308 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2309 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2310 * All function pointers are set to the appropriate functions set. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2311 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2312 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2313 for (flow = 0; flow < SER_MAX_NUMBER_OF_FLOWS; flow++){ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2314 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2315 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2316 * For Dummy flows, pointers to dummy functions are already set. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2317 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2318 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2319 if ((serial_flows[flow] != DUMMY_TRACE) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2320 (serial_flows[flow] != DUMMY_FAX_DATA) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2321 (serial_flows[flow] != DUMMY_BT_HCI)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2322 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2323 rvf_disable (21); /* beginning of the critical section */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2324 set_flow_functions (flow, serial_flows[flow]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2325 rvf_enable (); /* end of the critical section */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2326 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2327 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2328 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2329 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2330 * Dynamic Switch has been processed. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2331 * The new serial config is actually stored. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2332 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2333 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2334 dynamic_switch = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2335 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2336 ser_cfg_info[uart_id] = ser_new_cfg[uart_id]; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2337 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2338 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2339 * Re-enable UART interrupts. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2340 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2341 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2342 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2343 IQ_Unmask (IQ_UART_IRDA_IT); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2344 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2345 IQ_Unmask (IQ_UART_IT); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2346 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2347 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2348 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2349 * Real Dynamic Switch is only available with Bluetooth AND all chips but |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2350 * Calypso+. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2351 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2352 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2353 return (1); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2354 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2355 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2356 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2357 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2358 * All functions SER_tr_xxx and SER_fd_xxx call a function of the UART trace |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2359 * driver or the UART fax & data driver. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2360 * All functions SER_bt_xxx call a function of the UART Bluetooth HCI driver. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2361 * See the function call for parameters and return values. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2362 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2363 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2364 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2365 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2366 SER_tr_Init (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2367 T_tr_Baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2368 void (callback_function (void))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2369 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2370 tr_functions[serial_data_flow]->tr_Init ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2371 tr_functions[serial_data_flow]->device, baudrate, callback_function); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2372 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2373 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2374 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2375 SER_tr_ReadNChars (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2376 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2377 SYS_UWORD32 chars_to_read) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2378 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2379 return (tr_functions[serial_data_flow]->tr_ReadNChars ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2380 tr_functions[serial_data_flow]->device, buffer, chars_to_read)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2381 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2382 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2383 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2384 SER_tr_ReadNBytes (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2385 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2386 SYS_UWORD32 chars_to_read, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2387 SYS_BOOL *eof_detected) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2388 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2389 return (tr_functions[serial_data_flow]->tr_ReadNBytes ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2390 tr_functions[serial_data_flow]->device, buffer, chars_to_read, eof_detected)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2391 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2392 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2393 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2394 SER_tr_WriteNChars (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2395 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2396 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2397 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2398 return (tr_functions[serial_data_flow]->tr_WriteNChars ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2399 tr_functions[serial_data_flow]->device, buffer, chars_to_write)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2400 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2401 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2402 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2403 SER_tr_EncapsulateNChars (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2404 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2405 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2406 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2407 return (tr_functions[serial_data_flow]->tr_EncapsulateNChars ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2408 tr_functions[serial_data_flow]->device, buffer, chars_to_write)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2409 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2410 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2411 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2412 SER_tr_WriteNBytes (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2413 SYS_UWORD8 *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2414 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2415 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2416 return (tr_functions[serial_data_flow]->tr_WriteNBytes ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2417 tr_functions[serial_data_flow]->device, buffer, chars_to_write)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2418 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2419 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2420 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2421 SER_tr_WriteChar (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2422 char character) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2423 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2424 tr_functions[serial_data_flow]->tr_WriteChar ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2425 tr_functions[serial_data_flow]->device, character); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2426 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2427 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2428 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2429 SER_tr_WriteString (int serial_data_flow, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2430 char *buffer) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2431 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2432 tr_functions[serial_data_flow]->tr_WriteString ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2433 tr_functions[serial_data_flow]->device, buffer); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2434 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2435 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2436 SYS_BOOL |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2437 SER_tr_EnterSleep (int serial_data_flow) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2438 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2439 return (tr_functions[serial_data_flow]->tr_EnterSleep ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2440 tr_functions[serial_data_flow]->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2441 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2442 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2443 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2444 SER_tr_WakeUp (int serial_data_flow) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2445 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2446 tr_functions[serial_data_flow]->tr_WakeUp ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2447 tr_functions[serial_data_flow]->device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2448 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2449 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2450 /* Dummy function for backward compatibility. */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2451 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2452 SER_fd_Init (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2453 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2454 return (FD_OK); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2455 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2456 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2457 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2458 SER_fd_Initialize (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2459 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2460 T_FDRET status; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2461 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2462 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2463 data_flow_parameters.bufSize = FD_MAX_BUFFER_SIZE; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2464 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2465 bufSize = FD_MAX_BUFFER_SIZE; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2466 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2467 status = fd_functions->fd_Initialize (fd_functions->device); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2468 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2469 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2470 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2471 * Check if the UARTFAX driver has actually been initialized. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2472 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2473 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2474 if ((fd_functions->fd_Initialize == UAF_Init) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2475 (status = FD_OK)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2476 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2477 uart_fd_initialized = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2478 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2479 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2480 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2481 return (status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2482 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2483 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2484 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2485 SER_fd_Enable (SYS_BOOL enable) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2486 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2487 return (fd_functions->fd_Enable (fd_functions->device, enable)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2488 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2489 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2490 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2491 SER_fd_SetComPar (T_baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2492 T_bitsPerCharacter bpc, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2493 T_stopBits sb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2494 T_parity parity) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2495 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2496 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2497 if (fd_UAF_SetComPar < 2) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2498 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2499 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2500 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2501 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2502 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2503 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2504 data_flow_parameters.baudrate[fd_UAF_SetComPar] = baudrate; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2505 data_flow_parameters.bpc[fd_UAF_SetComPar] = bpc; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2506 data_flow_parameters.sb[fd_UAF_SetComPar] = sb; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2507 data_flow_parameters.parity[fd_UAF_SetComPar] = parity; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2508 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2509 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2510 * Number of calls to SER_fd_SetComPar. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2511 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2512 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2513 fd_UAF_SetComPar++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2514 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2515 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2516 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2517 return (fd_functions->fd_SetComPar ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2518 fd_functions->device, baudrate, bpc, sb, parity)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2519 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2520 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2521 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2522 SER_fd_SetBuffer (SYS_UWORD16 bufSize, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2523 SYS_UWORD16 rxThreshold, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2524 SYS_UWORD16 txThreshold) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2525 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2526 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2527 if (fd_UAF_SetBuffer < 1) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2528 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2529 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2530 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2531 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2532 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2533 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2534 data_flow_parameters.bufSize = bufSize; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2535 data_flow_parameters.rxThreshold = rxThreshold; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2536 data_flow_parameters.txThreshold = txThreshold; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2537 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2538 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2539 * Number of calls to SER_fd_SetBuffer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2540 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2541 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2542 fd_UAF_SetBuffer++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2543 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2544 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2545 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2546 return (fd_functions->fd_SetBuffer ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2547 fd_functions->device, bufSize, rxThreshold, txThreshold)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2548 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2549 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2550 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2551 SER_fd_SetFlowCtrl (T_flowCtrlMode fcMode, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2552 SYS_UWORD8 XON, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2553 SYS_UWORD8 XOFF) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2554 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2555 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2556 if (fd_UAF_SetFlowCtrl < 2) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2557 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2558 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2559 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2560 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2561 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2562 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2563 data_flow_parameters.fcMode[fd_UAF_SetFlowCtrl] = fcMode; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2564 data_flow_parameters.XON[fd_UAF_SetFlowCtrl] = XON; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2565 data_flow_parameters.XOFF[fd_UAF_SetFlowCtrl] = XOFF; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2566 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2567 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2568 * Number of calls to SER_fd_SetFlowCtrl. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2569 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2570 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2571 fd_UAF_SetFlowCtrl++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2572 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2573 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2574 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2575 return (fd_functions->fd_SetFlowCtrl ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2576 fd_functions->device, fcMode, XON, XOFF)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2577 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2578 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2579 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2580 SER_fd_SetEscape (char escChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2581 SYS_UWORD16 guardPeriod) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2582 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2583 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2584 if (fd_UAF_SetEscape < 2) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2585 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2586 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2587 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2588 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2589 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2590 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2591 data_flow_parameters.escChar[fd_UAF_SetEscape] = escChar; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2592 data_flow_parameters.guardPeriod[fd_UAF_SetEscape] = guardPeriod; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2593 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2594 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2595 * Number of calls to SER_fd_SetEscape. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2596 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2597 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2598 fd_UAF_SetEscape++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2599 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2600 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2601 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2602 return (fd_functions->fd_SetEscape ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2603 fd_functions->device, escChar, guardPeriod)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2604 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2605 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2606 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2607 SER_fd_InpAvail (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2608 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2609 return (fd_functions->fd_InpAvail (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2610 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2611 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2612 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2613 SER_fd_OutpAvail (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2614 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2615 return (fd_functions->fd_OutpAvail (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2616 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2617 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2618 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2619 SER_fd_EnterSleep (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2620 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2621 return (fd_functions->fd_EnterSleep (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2622 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2623 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2624 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2625 SER_fd_WakeUp (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2626 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2627 return (fd_functions->fd_WakeUp (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2628 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2629 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2630 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2631 SER_fd_ReadData (T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2632 void (readOutFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2633 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2634 SYS_UWORD8 nsource, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2635 SYS_UWORD8 *source[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2636 SYS_UWORD16 size[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2637 SYS_UWORD32 state))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2638 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2639 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2640 if (fd_UAF_ReadData < 1) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2641 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2642 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2643 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2644 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2645 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2646 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2647 data_flow_parameters.suspend_rd = suspend; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2648 data_flow_parameters.readOutFunc = readOutFunc; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2649 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2650 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2651 * Number of calls to SER_fd_ReadData. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2652 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2653 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2654 fd_UAF_ReadData++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2655 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2656 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2657 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2658 return (fd_functions->fd_ReadData ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2659 fd_functions->device, suspend, readOutFunc)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2660 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2661 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2662 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2663 SER_fd_WriteData (T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2664 void (writeInFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2665 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2666 SYS_UWORD8 ndest, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2667 SYS_UWORD8 *dest[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2668 SYS_UWORD16 size[]))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2669 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2670 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2671 if (fd_UAF_WriteData < 1) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2672 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2673 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2674 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2675 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2676 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2677 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2678 data_flow_parameters.suspend_wr = suspend; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2679 data_flow_parameters.writeInFunc = writeInFunc; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2680 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2681 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2682 * Number of calls to SER_fd_WriteData. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2683 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2684 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2685 fd_UAF_WriteData++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2686 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2687 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2688 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2689 return (fd_functions->fd_WriteData ( |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2690 fd_functions->device, suspend, writeInFunc)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2691 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2692 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2693 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2694 SER_fd_StopRec (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2695 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2696 return (fd_functions->fd_StopRec (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2697 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2698 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2699 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2700 SER_fd_StartRec (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2701 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2702 return (fd_functions->fd_StartRec (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2703 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2704 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2705 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2706 SER_fd_GetLineState (SYS_UWORD32 *state) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2707 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2708 return (fd_functions->fd_GetLineState (fd_functions->device, state)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2709 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2710 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2711 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2712 SER_fd_SetLineState (SYS_UWORD32 state, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2713 SYS_UWORD32 mask) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2714 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2715 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2716 if (fd_UAF_SetLineState < 4) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2717 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2718 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2719 * Stores the parameters in order to be able to retrieve them in case of |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2720 * Dynamic Sitch. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2721 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2722 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2723 data_flow_parameters.state[fd_UAF_SetLineState] = state; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2724 data_flow_parameters.mask[fd_UAF_SetLineState] = mask; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2725 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2726 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2727 * Number of calls to SER_fd_SetLineState. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2728 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2729 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2730 fd_UAF_SetLineState++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2731 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2732 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2733 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2734 return (fd_functions->fd_SetLineState (fd_functions->device, state, mask)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2735 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2736 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2737 T_FDRET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2738 SER_fd_CheckXEmpty (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2739 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2740 return (fd_functions->fd_CheckXEmpty (fd_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2741 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2742 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2743 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2744 T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2745 SER_bt_Init (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2746 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2747 return (bt_functions->bt_Init (bt_functions->device)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2748 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2749 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2750 T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2751 SER_bt_Start (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2752 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2753 return (bt_functions->bt_Start ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2754 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2755 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2756 T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2757 SER_bt_Stop (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2758 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2759 return (bt_functions->bt_Stop ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2760 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2761 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2762 T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2763 SER_bt_Kill (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2764 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2765 return (bt_functions->bt_Kill ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2766 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2767 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2768 T_HCI_RET |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2769 SER_bt_SetBaudrate (UINT8 baudrate) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2770 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2771 return (bt_functions->bt_SetBaudrate (baudrate)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2772 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2773 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2774 T_HCI_RET SER_bt_TransmitPacket (void *uart_tx_buffer) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2775 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2776 return (bt_functions->bt_TransmitPacket (uart_tx_buffer)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2777 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2778 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2779 SYS_BOOL SER_bt_EnterSleep (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2780 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2781 return (bt_functions->bt_EnterSleep()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2782 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2783 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2784 void SER_bt_WakeUp (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2785 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2786 bt_functions->bt_WakeUp(); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2787 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2788 #endif /* BTEMOBILE */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2789 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2790 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2791 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2792 * SER_UartSleepStatus |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2793 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2794 * Purpose: This function checks if both UARTs are ready to enter Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2795 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2796 * Parameters: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2797 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2798 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2799 * Return: 0 : Deep Sleep is not possible. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2800 * >= 1 : Deep Sleep is possible. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2801 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2802 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2803 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2804 SYS_BOOL |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2805 SER_UartSleepStatus (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2806 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2807 t_uart *uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2808 int uart_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2809 SYS_BOOL status; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2810 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2811 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2812 * Check first if the sleep timer is active or if a Dynamic Switch is |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2813 * being processed. A return is used to simplify the code. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2814 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2815 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2816 #if SERIAL_DYNAMIC_SWITCH |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2817 if (uart_sleep_timer_enabled || dynamic_switch) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2818 #else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2819 if (uart_sleep_timer_enabled) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2820 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2821 return (0); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2822 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2823 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2824 * Check if both UARTs are ready to enter Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2825 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2826 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2827 status = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2828 uart_id = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2829 while ((uart_id < NUMBER_OF_TR_UART) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2830 (status)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2831 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2832 uart = &(int_uart[uart_id]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2833 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2834 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2835 * Check if the specified UART is actually used. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2836 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2837 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2838 if (uart->device_used) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2839 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2840 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2841 * Check if the specified UART is used by a Trace or |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2842 * by a Fax & Data flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2843 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2844 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2845 if (uart->flow_type == TRACE_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2846 status = SER_tr_EnterSleep (uart->flow_id); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2847 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2848 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2849 if (uart->flow_type == FAX_DATA_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2850 status = (SYS_BOOL) SER_fd_EnterSleep (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2851 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2852 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2853 if (uart->flow_type == BLUETOOTH_HCI_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2854 status = SER_bt_EnterSleep(); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2855 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2856 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2857 status = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2858 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2859 if (status) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2860 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2861 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2862 * The specified UART is now set up for Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2863 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2864 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2865 uart->deep_sleep_set_up = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2866 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2867 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2868 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2869 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2870 uart_id++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2871 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2872 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2873 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2874 * Check if Deep Sleep is finally possible. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2875 * If not revert eventual Deep Sleep settings. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2876 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2877 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2878 if (!status) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2879 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2880 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2881 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2882 uart = &(int_uart[uart_id]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2883 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2884 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2885 * If the specified used UART has already been set up for |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2886 * Deep Sleep, revert these settings. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2887 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2888 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2889 if ((uart->device_used) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2890 (uart->deep_sleep_set_up)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2891 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2892 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2893 * Check if the specified UART is used by a Trace or |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2894 * by a Fax & Data flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2895 * Bluetooth HCI can not yet handled Deep Sleep Mode. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2896 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2897 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2898 if (uart->flow_type == TRACE_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2899 SER_tr_WakeUp (uart->flow_id); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2900 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2901 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2902 if (uart->flow_type == FAX_DATA_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2903 SER_fd_WakeUp (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2904 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2905 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2906 if (uart->flow_type == BLUETOOTH_HCI_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2907 SER_bt_WakeUp (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2908 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2909 uart->deep_sleep_set_up = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2910 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2911 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2912 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2913 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2914 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2915 return (status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2916 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2917 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2918 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2919 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2920 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2921 * SER_WakeUpUarts |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2922 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2923 * Purpose: This function wakes up used UARTs after Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2924 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2925 * Parameters: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2926 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2927 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2928 * Return: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2929 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2930 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2931 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2932 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2933 SER_WakeUpUarts (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2934 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2935 t_uart *uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2936 int uart_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2937 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2938 if (uart_sleep_timer_enabled) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2939 start_uart_sleep_timer (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2940 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2941 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2942 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2943 uart = &(int_uart[uart_id]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2944 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2945 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2946 * Check if the specified UART is actually used, and has not yet |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2947 * been waked up. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2948 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2949 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2950 if ((uart->device_used) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2951 (uart->deep_sleep_set_up)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2952 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2953 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2954 * Check if the specified UART is used by a Trace or |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2955 * by a Fax & Data flow. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2956 * Bluetooth HCI can not yet handled Deep Sleep Mode. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2957 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2958 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2959 if (uart->flow_type == TRACE_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2960 SER_tr_WakeUp (uart->flow_id); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2961 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2962 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2963 if (uart->flow_type == FAX_DATA_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2964 SER_fd_WakeUp (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2965 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2966 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2967 if (uart->flow_type == BLUETOOTH_HCI_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2968 SER_bt_WakeUp (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2969 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2970 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2971 * The specified UART is no more set up for Deep Sleep. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2972 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2973 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2974 uart->deep_sleep_set_up = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2975 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2976 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2977 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2978 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2979 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2980 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2981 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2982 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2983 * SER_restart_uart_sleep_timer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2984 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2985 * Purpose : Resets and restarts the sleep timer each time some characters are |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2986 * received. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2987 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2988 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2989 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2990 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2991 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2992 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2993 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2994 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2995 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2996 SER_restart_uart_sleep_timer (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2997 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2998 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2999 * First disable the timer. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3000 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3001 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3002 (void) NU_Control_Timer (&uart_sleep_timer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3003 NU_DISABLE_TIMER); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3004 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3005 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3006 * Then start again this timer for a new period. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3007 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3008 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3009 start_uart_sleep_timer (); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3010 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3011 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3012 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3013 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3014 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3015 * SER_activate_timer_hisr |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3016 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3017 * Purpose : Activates the timer HISR to reset and restart the sleep timer |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3018 * each time some characters are received. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3019 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3020 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3021 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3022 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3023 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3024 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3025 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3026 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3027 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3028 SER_activate_timer_hisr (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3029 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3030 (void) NU_Activate_HISR (&timer_hisr_ctrl_block); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3031 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3032 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3033 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3034 #if ((CHIPSET == 2) || (CHIPSET == 3)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3035 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3036 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3037 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3038 * SER_uart_handler |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3039 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3040 * Purpose : UART interrupt handler. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3041 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3042 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3043 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3044 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3045 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3046 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3047 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3048 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3049 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3050 SER_uart_handler (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3051 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3052 SYS_UWORD8 interrupt_status; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3053 t_uart *uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3054 int uart_id; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3055 SYS_BOOL it_identified; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3056 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3057 it_identified = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3058 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3059 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3060 * Check first for a wake-up interrupt. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3061 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3062 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3063 uart_id = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3064 while ((uart_id < NUMBER_OF_TR_UART) && |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3065 (!it_identified)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3066 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3067 uart = &(int_uart[uart_id]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3068 interrupt_status = READ_UART_REGISTER (uart, SSR); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3069 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3070 if (interrupt_status & RX_CTS_WAKE_UP_STS) { /* Wake-up IT has occurred */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3071 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3072 it_identified = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3073 uart_sleep_timer_enabled = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3074 DISABLE_WAKE_UP_INTERRUPT (uart); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3075 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3076 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3077 uart_id++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3078 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3079 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3080 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3081 * If no wake-up interrupt has been detected, check then systematically |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3082 * both UARTs for other interrupt causes. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3083 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3084 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3085 if (!it_identified) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3086 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3087 for (uart_id = 0; uart_id < NUMBER_OF_TR_UART; uart_id++) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3088 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3089 uart = &(int_uart[uart_id]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3090 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3091 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3092 if (!(interrupt_status & IT_NOT_PENDING)) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3093 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3094 it_identified = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3095 (*(uart->interrupt_handler)) (uart_id, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3096 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3097 } else { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3098 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3099 if ((uart_id == UA_UART_1) && (!it_identified)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3100 uart_spurious_interrupts++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3101 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3102 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3103 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3104 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3105 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3106 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3107 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3108 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3109 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3110 * SER_uart_modem_handler |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3111 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3112 * Purpose : UART MODEM interrupt handler. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3113 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3114 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3115 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3116 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3117 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3118 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3119 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3120 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3121 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3122 SER_uart_modem_handler (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3123 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3124 SYS_UWORD8 interrupt_status; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3125 t_uart *uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3126 SYS_BOOL it_wakeup_identified; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3127 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3128 it_wakeup_identified = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3129 uart = &(int_uart[UA_UART_1]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3130 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3131 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3132 * Check first for a wake-up interrupt. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3133 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3134 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3135 interrupt_status = READ_UART_REGISTER (uart, SSR); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3136 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3137 if (interrupt_status & RX_CTS_WAKE_UP_STS) { /* Wake-up IT has occurred */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3138 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3139 it_wakeup_identified = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3140 uart_sleep_timer_enabled = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3141 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3142 if (uart->flow_type == BLUETOOTH_HCI_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3143 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3144 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3145 (*(uart->interrupt_handler)) (UA_UART_1, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3146 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3147 #endif /* BTEMOBILE */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3148 DISABLE_WAKE_UP_INTERRUPT (uart); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3149 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3150 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3151 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3152 * If no wake-up interrupt has been detected, check UART for other |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3153 * interrupt causes. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3154 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3155 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3156 if (!it_wakeup_identified) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3157 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3158 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3159 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3160 if (!(interrupt_status & IT_NOT_PENDING)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3161 (*(uart->interrupt_handler)) (UA_UART_1, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3162 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3163 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3164 uart_modem_spurious_interrupts++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3165 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3166 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3167 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3168 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3169 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3170 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3171 * SER_uart_irda_handler |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3172 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3173 * Purpose : UART IrDA interrupt handler. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3174 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3175 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3176 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3177 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3178 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3179 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3180 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3181 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3182 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3183 SER_uart_irda_handler (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3184 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3185 SYS_UWORD8 interrupt_status; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3186 t_uart *uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3187 SYS_BOOL it_wakeup_identified; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3188 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3189 it_wakeup_identified = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3190 uart = &(int_uart[UA_UART_0]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3191 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3192 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3193 * Check first for a wake-up interrupt. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3194 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3195 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3196 interrupt_status = READ_UART_REGISTER (uart, SSR); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3197 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3198 if (interrupt_status & RX_CTS_WAKE_UP_STS) { /* Wake-up IT has occurred */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3199 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3200 it_wakeup_identified = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3201 uart_sleep_timer_enabled = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3202 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3203 if (uart->flow_type == BLUETOOTH_HCI_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3204 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3205 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3206 (*(uart->interrupt_handler)) (UA_UART_0, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3207 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3208 #endif /* BTEMOBILE */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3209 DISABLE_WAKE_UP_INTERRUPT (uart); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3210 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3211 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3212 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3213 * If no wake-up interrupt has been detected, check UART for other |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3214 * interrupt causes. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3215 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3216 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3217 if (!it_wakeup_identified) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3218 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3219 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3220 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3221 if (!(interrupt_status & IT_NOT_PENDING)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3222 (*(uart->interrupt_handler)) (UA_UART_0, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3223 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3224 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3225 uart_irda_spurious_interrupts++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3226 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3227 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3228 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3229 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3230 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3231 #if (CHIPSET == 12) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3232 /******************************************************************************* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3233 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3234 * SER_uart_modem2_handler |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3235 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3236 * Purpose : UART IrDA interrupt handler. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3237 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3238 * Arguments: In : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3239 * Out: none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3240 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3241 * Returns : none |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3242 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3243 ******************************************************************************/ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3244 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3245 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3246 SER_uart_modem2_handler (void) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3247 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3248 SYS_UWORD8 interrupt_status; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3249 t_uart *uart; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3250 SYS_BOOL it_wakeup_identified; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3251 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3252 it_wakeup_identified = 0; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3253 uart = &(int_uart[UA_UART_2]); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3254 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3255 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3256 * Check first for a wake-up interrupt. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3257 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3258 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3259 interrupt_status = READ_UART_REGISTER (uart, SSR); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3260 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3261 if (interrupt_status & RX_CTS_WAKE_UP_STS) { /* Wake-up IT has occurred */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3262 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3263 it_wakeup_identified = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3264 uart_sleep_timer_enabled = 1; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3265 #ifdef BTEMOBILE |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3266 if (uart->flow_type == BLUETOOTH_HCI_FLOW) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3267 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3268 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3269 (*(uart->interrupt_handler)) (UA_UART_2, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3270 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3271 #endif /* BTEMOBILE */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3272 DISABLE_WAKE_UP_INTERRUPT (uart); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3273 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3274 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3275 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3276 * If no wake-up interrupt has been detected, check UART for other |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3277 * interrupt causes. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3278 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3279 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3280 if (!it_wakeup_identified) { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3281 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3282 interrupt_status = READ_UART_REGISTER (uart, IIR) & IIR_BITS_USED; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3283 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3284 if (!(interrupt_status & IT_NOT_PENDING)) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3285 (*(uart->interrupt_handler)) (UA_UART_2, interrupt_status); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3286 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3287 else |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3288 uart_modem2_spurious_interrupts++; |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3289 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3290 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3291 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3292 #endif |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3293 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3294 /* |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3295 * Temporary functions. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3296 * |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3297 * FreeCalypso note: I'll put them back in if they are actually needed. |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3298 */ |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3299 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3300 #if 0 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3301 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3302 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3303 UT_Init (int device_id, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3304 int baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3305 void (callback_function (void))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3306 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3307 SER_tr_Init (SER_PROTOCOL_STACK, baudrate, callback_function); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3308 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3309 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3310 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3311 UT_ReadNChars (int device_id, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3312 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3313 SYS_UWORD32 chars_to_read) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3314 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3315 return (SER_tr_ReadNChars (SER_PROTOCOL_STACK, buffer, chars_to_read)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3316 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3317 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3318 SYS_UWORD32 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3319 UT_WriteNChars (int device_id, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3320 char *buffer, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3321 SYS_UWORD32 chars_to_write) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3322 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3323 return (SER_tr_WriteNChars (SER_PROTOCOL_STACK, buffer, chars_to_write)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3324 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3325 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3326 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3327 UT_WriteChar (int device_id, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3328 char character) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3329 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3330 SER_tr_WriteChar (SER_PROTOCOL_STACK, character); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3331 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3332 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3333 void |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3334 UT_WriteString (int device_id, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3335 char *buffer) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3336 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3337 SER_tr_WriteString (SER_PROTOCOL_STACK, buffer); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3338 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3339 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3340 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3341 UF_Init (SYS_UWORD8 deviceNo) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3342 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3343 return (SER_fd_Init ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3344 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3345 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3346 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3347 UF_Enable (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3348 SYS_BOOL enable) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3349 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3350 return (SER_fd_Enable (enable)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3351 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3352 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3353 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3354 UF_SetComPar (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3355 T_baudrate baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3356 T_bitsPerCharacter bpc, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3357 T_stopBits sb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3358 T_parity parity) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3359 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3360 return (SER_fd_SetComPar (baudrate, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3361 bpc, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3362 sb, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3363 parity)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3364 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3365 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3366 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3367 UF_SetBuffer (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3368 SYS_UWORD16 bufSize, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3369 SYS_UWORD16 rxThreshold, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3370 SYS_UWORD16 txThreshold) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3371 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3372 return (SER_fd_SetBuffer (bufSize, rxThreshold, txThreshold)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3373 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3374 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3375 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3376 UF_SetFlowCtrl (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3377 T_flowCtrlMode fcMode, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3378 SYS_UWORD8 XON, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3379 SYS_UWORD8 XOFF) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3380 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3381 return (SER_fd_SetFlowCtrl (fcMode, XON, XOFF)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3382 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3383 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3384 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3385 UF_SetEscape (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3386 SYS_UWORD8 escChar, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3387 SYS_UWORD16 guardPeriod) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3388 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3389 return (SER_fd_SetEscape (escChar, guardPeriod)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3390 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3391 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3392 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3393 UF_InpAvail (SYS_UWORD8 deviceNo) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3394 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3395 return (SER_fd_InpAvail ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3396 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3397 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3398 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3399 UF_OutpAvail (SYS_UWORD8 deviceNo) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3400 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3401 return (SER_fd_OutpAvail ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3402 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3403 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3404 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3405 UF_ReadData (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3406 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3407 void (readOutFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3408 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3409 SYS_UWORD8 nsource, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3410 SYS_UWORD8 *source[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3411 SYS_UWORD16 size[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3412 SYS_UWORD32 state))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3413 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3414 return (SER_fd_ReadData (suspend, readOutFunc)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3415 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3416 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3417 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3418 UF_WriteData (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3419 T_suspendMode suspend, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3420 void (writeInFunc (SYS_BOOL cldFromIrq, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3421 T_reInstMode *reInstall, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3422 SYS_UWORD8 ndest, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3423 SYS_UWORD8 *dest[], |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3424 SYS_UWORD16 size[]))) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3425 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3426 return (SER_fd_WriteData (suspend, writeInFunc)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3427 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3428 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3429 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3430 UF_StopRec (SYS_UWORD8 deviceNo) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3431 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3432 return (SER_fd_StopRec ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3433 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3434 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3435 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3436 UF_StartRec (SYS_UWORD8 deviceNo) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3437 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3438 return (SER_fd_StartRec ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3439 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3440 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3441 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3442 UF_GetLineState (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3443 SYS_UWORD32 *state) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3444 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3445 return (SER_fd_GetLineState (state)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3446 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3447 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3448 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3449 UF_SetLineState (SYS_UWORD8 deviceNo, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3450 SYS_UWORD32 state, |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3451 SYS_UWORD32 mask) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3452 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3453 return (SER_fd_SetLineState (state, mask)); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3454 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3455 |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3456 short |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3457 UF_CheckXEmpty (SYS_UWORD8 deviceNo) |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3458 { |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3459 return (SER_fd_CheckXEmpty ()); |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3460 } |
22c8199e08af
started integrating TI's serial code
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3461 #endif |