Adding BLE Serial, fix docs.
This commit is contained in:
@ -8,6 +8,7 @@
|
|||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
#include "SPIFFS.h"
|
#include "SPIFFS.h"
|
||||||
#include "SD_MMC.h"
|
#include "SD_MMC.h"
|
||||||
|
#include "BluetoothSerial.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -40,6 +41,30 @@
|
|||||||
X("Serial.available", SERIAL_AVAILABLE, DUP; tos = Serial.available()) \
|
X("Serial.available", SERIAL_AVAILABLE, DUP; tos = Serial.available()) \
|
||||||
X("Serial.readBytes", SERIAL_READ_BYTES, tos = Serial.readBytes((uint8_t *) *sp, tos); --sp) \
|
X("Serial.readBytes", SERIAL_READ_BYTES, tos = Serial.readBytes((uint8_t *) *sp, tos); --sp) \
|
||||||
X("Serial.write", SERIAL_WRITE, tos = Serial.write((const uint8_t *) *sp, tos); --sp) \
|
X("Serial.write", SERIAL_WRITE, tos = Serial.write((const uint8_t *) *sp, tos); --sp) \
|
||||||
|
X("Serial.flush", SERIAL_FLUSH, Serial.flush()) \
|
||||||
|
/* SerialBT */ \
|
||||||
|
X("SerialBT.new", SERIALBT_NEW, DUP; tos = (cell_t) new BluetoothSerial()) \
|
||||||
|
X("SerialBT.delete", SERIALBT_DELETE, delete (BluetoothSerial *) tos; DROP) \
|
||||||
|
X("SerialBT.begin", SERIALBT_BEGIN, \
|
||||||
|
tos = ((BluetoothSerial *) tos)->begin((const char *) sp[-1], *sp); sp -= 2) \
|
||||||
|
X("SerialBT.end", SERIALBT_END, ((BluetoothSerial *) tos)->end(); DROP) \
|
||||||
|
X("SerialBT.available", SERIALBT_AVAILABLE, tos = ((BluetoothSerial *) tos)->available()) \
|
||||||
|
X("SerialBT.readBytes", SERIALBT_READ_BYTES, \
|
||||||
|
tos = ((BluetoothSerial *) tos)->readBytes((uint8_t *) sp[-1], *sp); sp -= 2) \
|
||||||
|
X("SerialBT.write", SERIALBT_WRITE, \
|
||||||
|
tos = ((BluetoothSerial *) tos)->write((const uint8_t *) sp[-1], *sp); sp -= 2) \
|
||||||
|
X("SerialBT.flush", SERIALBT_FLUSH, ((BluetoothSerial *) tos)->flush(); DROP) \
|
||||||
|
X("SerialBT.hasClient", SERIALBT_HAS_CLIENT, tos = ((BluetoothSerial *) tos)->hasClient()) \
|
||||||
|
X("SerialBT.enableSSP", SERIALBT_ENABLE_SSP, ((BluetoothSerial *) tos)->enableSSP(); DROP) \
|
||||||
|
X("SerialBT.setPin", SERIALBT_SET_PIN, tos = ((BluetoothSerial *) tos)->setPin((const char *) *sp); --sp) \
|
||||||
|
X("SerialBT.unpairDevice", SERIALBT_UNPAIR_DEVICE, \
|
||||||
|
tos = ((BluetoothSerial *) tos)->unpairDevice((uint8_t *) *sp); --sp) \
|
||||||
|
X("SerialBT.connect", SERIALBT_CONNECT, tos = ((BluetoothSerial *) tos)->connect((const char *) *sp); --sp) \
|
||||||
|
X("SerialBT.connectAddr", SERIALBT_CONNECT_ADDR, \
|
||||||
|
tos = ((BluetoothSerial *) tos)->connect((uint8_t *) *sp); --sp) \
|
||||||
|
X("SerialBT.disconnect", SERIALBT_DISCONNECT, tos = ((BluetoothSerial *) tos)->disconnect()) \
|
||||||
|
X("SerialBT.connected", SERIALBT_CONNECTED, tos = ((BluetoothSerial *) tos)->connected(*sp); --sp) \
|
||||||
|
X("SerialBT.isReady", SERIALBT_IS_READY, tos = ((BluetoothSerial *) tos)->isReady(sp[-1], *sp); sp -= 2) \
|
||||||
/* Pins and PWM */ \
|
/* Pins and PWM */ \
|
||||||
X("pinMode", PIN_MODE, pinMode(*sp, tos); --sp; DROP) \
|
X("pinMode", PIN_MODE, pinMode(*sp, tos); --sp; DROP) \
|
||||||
X("digitalWrite", DIGITAL_WRITE, digitalWrite(*sp, tos); --sp; DROP) \
|
X("digitalWrite", DIGITAL_WRITE, digitalWrite(*sp, tos); --sp; DROP) \
|
||||||
@ -173,6 +198,7 @@
|
|||||||
esp_camera_fb_return((camera_fb_t *) tos); DROP) \
|
esp_camera_fb_return((camera_fb_t *) tos); DROP) \
|
||||||
X("esp_camera_sensor_get", ESP_CAMERA_SENSOR_GET, \
|
X("esp_camera_sensor_get", ESP_CAMERA_SENSOR_GET, \
|
||||||
DUP; tos = (cell_t) esp_camera_sensor_get()) \
|
DUP; tos = (cell_t) esp_camera_sensor_get()) \
|
||||||
|
/* SD_MMC */ \
|
||||||
X("SD_MMC.begin", SD_MMC_BEGIN, \
|
X("SD_MMC.begin", SD_MMC_BEGIN, \
|
||||||
tos = SD_MMC.begin((const char *) *sp, tos); --sp) \
|
tos = SD_MMC.begin((const char *) *sp, tos); --sp) \
|
||||||
X("SD_MMC.end", SD_MMC_END, SD_MMC.end()) \
|
X("SD_MMC.end", SD_MMC_END, SD_MMC.end()) \
|
||||||
|
|||||||
@ -170,6 +170,28 @@ Serial.end ( -- ) End serial port
|
|||||||
Serial.available ( -- f ) Is serial data available
|
Serial.available ( -- f ) Is serial data available
|
||||||
Serial.readBytes ( a n -- n ) Read serial bytes, return number gotten
|
Serial.readBytes ( a n -- n ) Read serial bytes, return number gotten
|
||||||
Serial.write ( a n -- ) Write serial bytes
|
Serial.write ( a n -- ) Write serial bytes
|
||||||
|
Serial.flush ( -- ) Flush serial buffer
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h5>Serial Bluetooth</h5>
|
||||||
|
<pre>
|
||||||
|
SerialBT.new ( -- bt ) Allocate new BT object
|
||||||
|
SerialBT.delete ( bt -- ) Free BT object
|
||||||
|
SerialBT.begin ( localname ismaster bt -- f )
|
||||||
|
SerialBT.end ( bt -- )
|
||||||
|
SerialBT.available ( bt -- f )
|
||||||
|
SerialBT.readBytes ( a n bt -- n )
|
||||||
|
SerialBT.write ( a n bt -- )
|
||||||
|
SerialBT.flush ( bt -- )
|
||||||
|
SerialBT.hasClient ( bt -- f )
|
||||||
|
SerialBT.enableSSP ( bt -- )
|
||||||
|
SerialBT.setPin ( z bt -- f )
|
||||||
|
SerialBT.unpairDevice ( addr bt -- f )
|
||||||
|
SerialBT.connect ( remotename bt -- f )
|
||||||
|
SerialBT.connectAddr ( addr bt -- f )
|
||||||
|
SerialBT.disconnect ( bt -- f )
|
||||||
|
SerialBT.connected ( timeout bt -- f )
|
||||||
|
SerialBT.isReady ( checkMaster timeout -- f ) Default checkMaster=false, timeout=0
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h5>GPIO</h5>
|
<h5>GPIO</h5>
|
||||||
@ -280,6 +302,24 @@ Wire.busy ( -- f )
|
|||||||
Wire.flush ( -- )
|
Wire.flush ( -- )
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<h5>Camera</h5>
|
||||||
|
<pre>
|
||||||
|
esp_camera_init ( config -- f )
|
||||||
|
esp_camera_deinit ( -- f )
|
||||||
|
esp_camera_fb_get ( -- fb )
|
||||||
|
esp_camera_fb_return ( fb -- )
|
||||||
|
esp_camera_sensor_get ( -- sensor )
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h5>SD_MMC</h5>
|
||||||
|
<pre>
|
||||||
|
SD_MMC.begin ( mount mode1bit ) default mode1bit=false
|
||||||
|
SD_MMC.end ( -- )
|
||||||
|
SD_MMC.cardType ( -- n )
|
||||||
|
SD_MMC.totalBytes ( -- n )
|
||||||
|
SD_MMC.usedBytes ( -- n )
|
||||||
|
</pre>
|
||||||
|
|
||||||
<h4>Arduino ESP32 WebUI</h4>
|
<h4>Arduino ESP32 WebUI</h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user