Skip to content

Commit 5dff151

Browse files
authored
Merge pull request #1446 from mi-hol/patch-2
add "hidden" features to TOC
2 parents b9b060d + 03cbb19 commit 5dff151

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

docs/Scripting-Language.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,16 @@ If a Tasmota `SENSOR` or `STATUS` or `RESULT` message is not generated or a `Var
584584
`sf(F)` = sets the CPU Frequency (ESP32) to 80,160,240 Mhz, returns current Freq.
585585
`s(x)` = explicit conversion from number x to string may be preceded by precision digits e.g. s(2.2x) = use 2 digits before and after decimal point
586586

587-
I2C support #define USE_SCRIPT_I2C
587+
### I2C support
588+
589+
`#define USE_SCRIPT_I2C`
588590
`ia(AA)`, `ia2(AA)` test and set I2C device with address AA (on BUS 1 or 2), returns 1 if device is present
589591
`iw(aa val)` , `iw1(aa val)`, `iw2(aa val)`, `iw3(aa val) `write val to register aa (1..3 bytes), if in aa bit 15 is set no destination register is transfered (needed for some devices), if bit 14 is set byte order is reversed
590592
`ir(aa)`, `ir1(aa)`, `ir2(aa)`, `ir3(aa)` read 1..3 bytes from register aa
591593

592-
Onewire support #define USE_SCRIPT_ONEWIRE
594+
### Onewire support
595+
596+
`#define USE_SCRIPT_ONEWIRE`
593597
support for onewire either directly or via serial port with onewire bus driver DS2480B
594598
`ow(SEL <opt PAR>)`
595599
SEL 0 = init bus with pin number N (if bit 15 ist set, select serial DS2480B, lsb = rec pin, msb = trx pin)
@@ -605,7 +609,9 @@ support for onewire either directly or via serial port with onewire bus driver D
605609
SEL 10-18 = get byte (1-8) of adress from index PAR
606610
SEL 99 = delete bus driver
607611

608-
Serial IO support #define USE_SCRIPT_SERIAL
612+
### Serial IO support
613+
614+
`#define USE_SCRIPT_SERIAL `
609615
`so(RXPIN TXPIN BR)` open serial port with RXPIN, TXPIN and baud rate BR with 8N1 serial mode (-1 for pin means don't use)
610616
`so(RXPIN TXPIN BR MMM)` open serial port with RXPIN, TXPIN and baud rate BR and serial mode e.g 7E2 (all 3 modechars must be specified)
611617
`so(RXPIN TXPIN BR MMM BSIZ)` open serial port with RXPIN, TXPIN and baud rate BR and serial mode e.g 7E2 (all 3 modechars must be specified) and serial IRW buffer size
@@ -623,14 +629,18 @@ Serial IO support #define USE_SCRIPT_SERIAL
623629
`swa(ARRAY len (flags))` send len bytes of an array to serial port, if flags is set Modbus cmd is assumed and cksum is calculated, 0 = standard Modbus, 1 = Rec BMA mode
624630
`smw(ADDR MODE NUMBER)` send a value with checksum to MODBUS Address, MODE 0 = uint16, 1 = uint32, 3 = float
625631

626-
SPI IO support #define `USE_SCRIPT_SPI`
632+
### SPI IO support
633+
634+
`#define USE_SCRIPT_SPI`
627635
`spi(0 SCLK MOSI MISO)` defines a software SPI port with pin numbers used for SCLK, MOSI, MISO.
628636
`spi(0 -1 freq)` defines a hardware SPI port with pin numbers defined by Tasmota GPIO definition with bus frequency in Mhz.
629637
`spi(0 -2 freq)` defines a hardware SPI port 2 on ESP32 with pin numbers defined by Tasmota GPIO definition.
630638
`spi(1 N GPIO)` sets the CS pin with index N (1..4) to pin Nr GPIO.
631639
`spi(2 N ARRAY LEN S)` sends and receives an ARRAY with LEN values with S (1..3) (8,16,24 bits) if N==-1 CS is ignored. If S=4, CS is raised after each byte.
632640

633-
TCP server support #define `USE_SCRIPT_TCP_SERVER`
641+
### TCP server support
642+
643+
`#define USE_SCRIPT_TCP_SERVER`
634644
`wso(port)` start a tcp stream server at port
635645
`wsc()` close tcp stream server
636646
`wsa()` return bytes available on tcp stream
@@ -710,7 +720,7 @@ The following variables are cleared after reading true:
710720
`wific` = true on Wi-Fi connect
711721
`wifid` = true on Wi-Fi disconnect
712722

713-
**System variables** (for debugging)
723+
### System variables (for debugging)
714724
`stack` = stack size
715725
`heap` = free heap size
716726
`pheap` = PSRAM free heap size (ESP32)

0 commit comments

Comments
 (0)