-
Notifications
You must be signed in to change notification settings - Fork 317
99 Instructions
Geo edited this page Jul 10, 2025
·
6 revisions
The instruction system follows the Bus Pirate syntax and is partially supported.
Instructions are sequences enclosed in brackets (e.g., [0xAA r:8]) and parsed into byte-level actions called ByteCodes.
They allow you to directly express sequences of read/write/start/stop/delay in a compact and flexible form.
| Syntax | Meaning |
|---|---|
[0xAA 0xBB] |
Write two bytes |
[r:4] |
Read 4 bytes |
[s 0xA1 r S] |
Start → Write 0xA1 → Read → Stop |
['A'] |
Write ASCII 'A' (char literal) |
["ABC"] |
Write ASCII string ABC |
[d:10] |
Delay 10 microseconds |
[D:1] |
Delay 1 millisecond |
[hhhlll] |
Set AUX high 3 times, low 3 times |
[s r:2 S] |
Start → Read 2 bytes → Stop |
- Loops and nested brackets
- Inline macros or expressions
- Bit-level operations (like
.1,.0) - Block
{}and macro>prefixes
- Hex values (
0xAA) and decimal numbers (123) are supported. - Repeats like
r:10,hhh,lllllare parsed correctly. - Strings in
"quotes"are written as ASCII. - Characters in
'A'are written as their byte value.
- Anything inside
[]is considered an instruction. - Special characters like
s,S,r,d,D,h,lmap to specific bytecode actions. - ByteCode enums are generated per token.
-
[0xA0 r:1 0xB1 r:1]→ Write 0xA0, Read, Write 0xB1, Read -
[s 'X' r S]→ Start, write'X', read, Stop -
[d:100 D:2]→ Delay 100µs then 2ms
⚠️ This syntax is parsed but not all instructions are currently executed in all modes.
⚠️ Voltage Warning: Devices should only operate at 3.3V or 5V.
Do not connect peripherals using other voltage levels — doing so may damage your ESP32.