FreeCalypso > hg > freecalypso-reveng
annotate frbl/reconst/inc/serial.h @ 320:20feaf83c661
frbl/reconst/convert.c: better match to original object
still not perfect though
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 05 Mar 2020 05:01:14 +0000 |
parents | 6cba849e3332 |
children |
rev | line source |
---|---|
312
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /******************************************************************************* |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * SERIAL.H |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * This module contains functions to send or receive commands on the USART 8251. |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * Only polled mode is used. |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 * (C) Texas Instruments 1998 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 ******************************************************************************/ |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #ifndef __SERIAL_H__ |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #define __SERIAL_H__ |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "main/sys_types.h" |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 /* |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 * ser_receive_command and ser_receive_char have 2 modes: |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 * SER_INFINITE : Waits until a command is received. |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 * SER_IMMEDIATE: Returns imediately even if no character is received. |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 */ |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 enum { |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 SER_INFINITE, |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 SER_IMMEDIATE |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 }; |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 /* |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 * Return values of ser_receive_data_for_flash. |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 */ |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 enum { |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 SER_DATA_READY, |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 SER_DATA_ERROR, |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 SER_END_OF_FILE |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 }; |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 extern void ser_wait_no_activity (SYS_UWORD8 device_id); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 extern long ser_send_command (SYS_UWORD8 *command, SYS_UWORD8 device_id); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 extern SYS_UWORD8 ser_receive_command (SYS_UWORD8 *command, int mode); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 extern long ser_receive_data_for_flash (SYS_UWORD32 *address, SYS_UWORD16 *data, SYS_UWORD8 device_id); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 extern void ser_initialize_flash_data_detection (void); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 extern void ser_initialize_serial_link (void); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 extern void ser_wait_last_character_sent (SYS_UWORD8 device_id); |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
6cba849e3332
frbl/reconst/inc: import from TCS211 surviving source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #endif /* __SERIAL_H__ */ |