-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserial2.txt
92 lines (71 loc) · 2.59 KB
/
serial2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
\ *********************************************************************
\ Add Serial2 UART 2 for ESP32Forth
\ Filename: serial2.txt
\ Date: 10 jan 2022
\ Updated: 10 jan 2022
\ File Version: 1.0
\ MCU: ESP32-WROOM-32
\ Forth: ESP32forth all versions 7.x++
\ Copyright: Marc PETREMANN
\ Author: Marc PETREMANN
\ GNU General Public License
\ *********************************************************************
\ in C language:
\ in file: ESP32......ino, you can replace this lines:
#define REQUIRED_SERIAL_SUPPORT \
X("Serial.begin", SERIAL_BEGIN, Serial.begin(tos); DROP) \
X("Serial.end", SERIAL_END, Serial.end()) \
X("Serial.available", SERIAL_AVAILABLE, PUSH Serial.available()) \
X("Serial.readBytes", SERIAL_READ_BYTES, n0 = Serial.readBytes(b1, n0); NIP) \
X("Serial.write", SERIAL_WRITE, n0 = Serial.write(b1, n0); NIP) \
X("Serial.flush", SERIAL_FLUSH, Serial.flush())
\ with this lines:
#define REQUIRED_SERIAL_SUPPORT \
X("Serial.begin", SERIAL_BEGIN, Serial.begin(tos); DROP) \
X("Serial.end", SERIAL_END, Serial.end()) \
X("Serial.available", SERIAL_AVAILABLE, PUSH Serial.available()) \
X("Serial.readBytes", SERIAL_READ_BYTES, n0 = Serial.readBytes(b1, n0); NIP) \
X("Serial.write", SERIAL_WRITE, n0 = Serial.write(b1, n0); NIP) \
X("Serial.flush", SERIAL_FLUSH, Serial.flush()) \
X("Serial2.begin", SERIAL2_BEGIN, Serial2.begin(tos); DROP) \
X("Serial2.end", SERIAL2_END, Serial2.end()) \
X("Serial2.available", SERIAL2_AVAILABLE, PUSH Serial2.available()) \
X("Serial2.readBytes", SERIAL2_READ_BYTES, n0 = Serial2.readBytes(b1, n0); NIP) \
X("Serial2.write", SERIAL2_WRITE, n0 = Serial2.write(b1, n0); NIP) \
X("Serial2.flush", SERIAL2_FLUSH, Serial2.flush())
\ and replace this lines:
"vocabulary Serial Serial definitions\\n"
"transfer{\\n"
" Serial.begin Serial.end\\n"
" Serial.available Serial.readBytes\\n"
" Serial.write Serial.flush\\n"
"}transfer\\n"
\ with this lines:
"vocabulary Serial Serial definitions\\n"
"transfer{\\n"
" Serial.begin Serial.end\\n"
" Serial.available Serial.readBytes\\n"
" Serial.write Serial.flush\\n"
" Serial2.begin Serial2.end\\n"
" Serial2.available Serial2.readBytes\\n"
" Serial2.write Serial2.flush\\n"
"}transfer\\n"
\ *** otherwise, attempt at definition in FORTH ********************************
\ in development
: Serial2.begin
;
\ in development
: Serial2.end
;
\ in development
: Serial2.available
;
\ in development
: Serial2.readBytes
;
\ in development
: Serial2.write
;
\ in development
: Serial2.flush
;