Pull RMT into an optional module, refactor.

This commit is contained in:
Brad Nelson
2023-07-08 10:21:13 -07:00
parent 8d72804378
commit fc7175d488
15 changed files with 141 additions and 103 deletions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
VERSION=7.0.7.14 VERSION=7.0.7.15
STABLE_VERSION=7.0.6.19 STABLE_VERSION=7.0.6.19
OLD_STABLE_VERSION=7.0.5.4 OLD_STABLE_VERSION=7.0.5.4
REVISION=$(shell git rev-parse HEAD | head -c 20) REVISION=$(shell git rev-parse HEAD | head -c 20)
@ -165,6 +165,18 @@ tests: $(TESTS)
clean-esp32: clean-esp32:
rm -rf $(ESP32)/esp32*_build $(ESP32)/esp32*_cache rm -rf $(ESP32)/esp32*_build $(ESP32)/esp32*_cache
vet:
$(MAKE) clean
$(MAKE) all
$(MAKE) esp32-build
$(MAKE) esp32s2-build
$(MAKE) esp32c3-build
$(MAKE) clean-esp32
$(MAKE) add-optional
$(MAKE) esp32-build
$(MAKE) clean
$(MAKE) all
clean: clean:
rm -rf $(OUT) rm -rf $(OUT)
@ -335,6 +347,7 @@ OPTIONAL_MODULES = \
$(ESP32)/ESP32forth/assemblers.h \ $(ESP32)/ESP32forth/assemblers.h \
$(ESP32)/ESP32forth/camera.h \ $(ESP32)/ESP32forth/camera.h \
$(ESP32)/ESP32forth/oled.h \ $(ESP32)/ESP32forth/oled.h \
$(ESP32)/ESP32forth/rmt.h \
$(ESP32)/ESP32forth/serial-bluetooth.h \ $(ESP32)/ESP32forth/serial-bluetooth.h \
$(ESP32)/ESP32forth/spi-flash.h $(ESP32)/ESP32forth/spi-flash.h
@ -646,6 +659,13 @@ $(ESP32)/ESP32forth/optional/oled.h: \
oled=@$(GEN)/esp32_oled.h \ oled=@$(GEN)/esp32_oled.h \
>$@ >$@
$(ESP32)/ESP32forth/optional/rmt.h: \
esp32/optional/rmt.h | $(ESP32)/ESP32forth/optional
cat esp32/optional/rmt.h | tools/replace.js \
VERSION=$(VERSION) \
REVISION=$(REVISION) \
>$@
$(ESP32)/ESP32forth/optional/serial-bluetooth.h: \ $(ESP32)/ESP32forth/optional/serial-bluetooth.h: \
esp32/optional/serial-bluetooth/serial-bluetooth.h \ esp32/optional/serial-bluetooth/serial-bluetooth.h \
$(GEN)/esp32_serial-bluetooth.h | $(ESP32)/ESP32forth/optional $(GEN)/esp32_serial-bluetooth.h | $(ESP32)/ESP32forth/optional
@ -764,6 +784,7 @@ $(ESP32)/ESP32forth.zip: \
$(ESP32)/ESP32forth/optional/assemblers.h \ $(ESP32)/ESP32forth/optional/assemblers.h \
$(ESP32)/ESP32forth/optional/camera.h \ $(ESP32)/ESP32forth/optional/camera.h \
$(ESP32)/ESP32forth/optional/oled.h \ $(ESP32)/ESP32forth/optional/oled.h \
$(ESP32)/ESP32forth/optional/rmt.h \
$(ESP32)/ESP32forth/optional/serial-bluetooth.h \ $(ESP32)/ESP32forth/optional/serial-bluetooth.h \
$(ESP32)/ESP32forth/optional/spi-flash.h $(ESP32)/ESP32forth/optional/spi-flash.h
cd $(ESP32) && rm -f ESP32forth.zip && zip -r ESP32forth.zip ESP32forth cd $(ESP32) && rm -f ESP32forth.zip && zip -r ESP32forth.zip ESP32forth

View File

@ -623,7 +623,6 @@ e: test-esp32-forth-voclist
out: streams out: streams
out: tasks out: tasks
out: rtos out: rtos
out: rmt
out: interrupts out: interrupts
out: sockets out: sockets
out: Serial out: Serial
@ -683,7 +682,6 @@ e: check-esp32-builtins
e: check-esp32-bindings e: check-esp32-bindings
out: rtos out: rtos
out: rmt
out: interrupts out: interrupts
out: sockets out: sockets
out: Serial out: Serial

View File

@ -103,10 +103,6 @@ ESP_INTR_FLAG_DEFAULT gpio_install_isr_service drop
[THEN] [THEN]
forth definitions forth definitions
vocabulary rmt rmt definitions
transfer rmt-builtins
forth definitions
vocabulary rtos rtos definitions vocabulary rtos rtos definitions
transfer rtos-builtins transfer rtos-builtins
forth definitions forth definitions

View File

@ -36,7 +36,7 @@
# define OPTIONAL_ASSEMBLERS_SUPPORT # define OPTIONAL_ASSEMBLERS_SUPPORT
# endif # endif
// Hook to pull in words from optional Oled support. // Hook to pull in optional Oled support.
# if __has_include("oled.h") # if __has_include("oled.h")
# include "oled.h" # include "oled.h"
# else # else
@ -44,7 +44,7 @@
# define OPTIONAL_OLED_SUPPORT # define OPTIONAL_OLED_SUPPORT
# endif # endif
// Hook to pull in words from optional ESP32-CAM camera support. // Hook to pull in optional ESP32-CAM camera support.
# if __has_include("camera.h") # if __has_include("camera.h")
# include "camera.h" # include "camera.h"
# else # else
@ -52,20 +52,28 @@
# define OPTIONAL_CAMERA_SUPPORT # define OPTIONAL_CAMERA_SUPPORT
# endif # endif
// Hook to pull in words from optional serial bluetooth support. // Hook to pull in optional RMT (Remote Control) support.
# if __has_include("rmt.h")
# include "rmt.h"
# else
# define OPTIONAL_RMT_VOCABULARY
# define OPTIONAL_RMT_SUPPORT
# endif
// Hook to pull in optional serial bluetooth support.
# if __has_include("serial-bluetooth.h") # if __has_include("serial-bluetooth.h")
# include "serial-bluetooth.h" # include "serial-bluetooth.h"
# else # else
# define OPTIONAL_SERIAL_BLUETOOTH_SUPPORT
# define OPTIONAL_BLUETOOTH_VOCABULARY # define OPTIONAL_BLUETOOTH_VOCABULARY
# define OPTIONAL_SERIAL_BLUETOOTH_SUPPORT
# endif # endif
// Hook to pull in words from optional SPI flash support. // Hook to pull in optional SPI flash support.
# if __has_include("spi-flash.h") # if __has_include("spi-flash.h")
# include "spi-flash.h" # include "spi-flash.h"
# else # else
# define OPTIONAL_SPI_FLASH_SUPPORT
# define OPTIONAL_SPI_FLASH_VOCABULARY # define OPTIONAL_SPI_FLASH_VOCABULARY
# define OPTIONAL_SPI_FLASH_SUPPORT
# endif # endif
static cell_t ResizeFile(cell_t fd, cell_t size); static cell_t ResizeFile(cell_t fd, cell_t size);
@ -94,16 +102,16 @@ static cell_t ResizeFile(cell_t fd, cell_t size);
OPTIONAL_SOCKETS_SUPPORT \ OPTIONAL_SOCKETS_SUPPORT \
OPTIONAL_FREERTOS_SUPPORT \ OPTIONAL_FREERTOS_SUPPORT \
OPTIONAL_INTERRUPTS_SUPPORT \ OPTIONAL_INTERRUPTS_SUPPORT \
OPTIONAL_RMT_SUPPORT \
CALLING_OPCODE_LIST \ CALLING_OPCODE_LIST \
FLOATING_POINT_LIST FLOATING_POINT_LIST
#define EXTERNAL_OPTIONAL_MODULE_SUPPORT \ #define EXTERNAL_OPTIONAL_MODULE_SUPPORT \
OPTIONAL_ASSEMBLERS_SUPPORT \ OPTIONAL_ASSEMBLERS_SUPPORT \
OPTIONAL_CAMERA_SUPPORT \ OPTIONAL_CAMERA_SUPPORT \
OPTIONAL_SPI_FLASH_SUPPORT \
OPTIONAL_SERIAL_BLUETOOTH_SUPPORT \
OPTIONAL_OLED_SUPPORT \ OPTIONAL_OLED_SUPPORT \
OPTIONAL_RMT_SUPPORT \
OPTIONAL_SERIAL_BLUETOOTH_SUPPORT \
OPTIONAL_SPI_FLASH_SUPPORT
#define REQUIRED_MEMORY_SUPPORT \ #define REQUIRED_MEMORY_SUPPORT \
YV(internals, MALLOC, SET malloc(n0)) \ YV(internals, MALLOC, SET malloc(n0)) \
@ -349,66 +357,6 @@ static void TimerInitNull(cell_t group, cell_t timer);
#endif #endif
#ifndef ENABLE_RMT_SUPPORT
# define OPTIONAL_RMT_SUPPORT
#else
# ifndef SIM_PRINT_ONLY
# include "driver/rmt.h"
# endif
# define OPTIONAL_RMT_SUPPORT \
YV(rmt, rmt_set_clk_div, n0 = rmt_set_clk_div((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_clk_div, n0 = rmt_get_clk_div((rmt_channel_t) n1, b0); NIP) \
YV(rmt, rmt_set_rx_idle_thresh, n0 = rmt_set_rx_idle_thresh((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_rx_idle_thresh, \
n0 = rmt_get_rx_idle_thresh((rmt_channel_t) n1, (uint16_t *) a0); NIP) \
YV(rmt, rmt_set_mem_block_num, n0 = rmt_set_mem_block_num((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_mem_block_num, n0 = rmt_get_mem_block_num((rmt_channel_t) n1, b0); NIP) \
YV(rmt, rmt_set_tx_carrier, n0 = rmt_set_tx_carrier((rmt_channel_t) n4, n3, n2, n1, \
(rmt_carrier_level_t) n0); NIPn(4)) \
YV(rmt, rmt_set_mem_pd, n0 = rmt_set_mem_pd((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_mem_pd, n0 = rmt_get_mem_pd((rmt_channel_t) n1, (bool *) a0); NIP) \
YV(rmt, rmt_tx_start, n0 = rmt_tx_start((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_tx_stop, n0 = rmt_tx_stop((rmt_channel_t) n0)) \
YV(rmt, rmt_rx_start, n0 = rmt_rx_start((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_rx_stop, n0 = rmt_rx_stop((rmt_channel_t) n0)) \
YV(rmt, rmt_tx_memory_reset, n0 = rmt_tx_memory_reset((rmt_channel_t) n0)) \
YV(rmt, rmt_rx_memory_reset, n0 = rmt_rx_memory_reset((rmt_channel_t) n0)) \
YV(rmt, rmt_set_memory_owner, n0 = rmt_set_memory_owner((rmt_channel_t) n1, (rmt_mem_owner_t) n0); NIP) \
YV(rmt, rmt_get_memory_owner, n0 = rmt_get_memory_owner((rmt_channel_t) n1, (rmt_mem_owner_t *) a0); NIP) \
YV(rmt, rmt_set_tx_loop_mode, n0 = rmt_set_tx_loop_mode((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_tx_loop_mode, n0 = rmt_get_tx_loop_mode((rmt_channel_t) n1, (bool *) a0); NIP) \
YV(rmt, rmt_set_rx_filter, n0 = rmt_set_rx_filter((rmt_channel_t) n2, n1, n0); NIPn(2)) \
YV(rmt, rmt_set_source_clk, n0 = rmt_set_source_clk((rmt_channel_t) n1, (rmt_source_clk_t) n0); NIP) \
YV(rmt, rmt_get_source_clk, n0 = rmt_get_source_clk((rmt_channel_t) n1, (rmt_source_clk_t * ) a0); NIP) \
YV(rmt, rmt_set_idle_level, n0 = rmt_set_idle_level((rmt_channel_t) n2, n1, \
(rmt_idle_level_t) n0); NIPn(2)) \
YV(rmt, rmt_get_idle_level, n0 = rmt_get_idle_level((rmt_channel_t) n2, \
(bool *) a1, (rmt_idle_level_t *) a0); NIPn(2)) \
YV(rmt, rmt_get_status, n0 = rmt_get_status((rmt_channel_t) n1, (uint32_t *) a0); NIP) \
YV(rmt, rmt_set_rx_intr_en, n0 = rmt_set_rx_intr_en((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_set_err_intr_en, n0 = rmt_set_err_intr_en((rmt_channel_t) n1, (rmt_mode_t) n0); NIP) \
YV(rmt, rmt_set_tx_intr_en, n0 = rmt_set_tx_intr_en((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_set_tx_thr_intr_en, n0 = rmt_set_tx_thr_intr_en((rmt_channel_t) n2, n1, n0); NIPn(2)) \
YV(rmt, rmt_set_gpio, n0 = rmt_set_gpio((rmt_channel_t) n3, (rmt_mode_t) n2, (gpio_num_t) n1, n0); NIPn(3)) \
YV(rmt, rmt_config, n0 = rmt_config((const rmt_config_t *) a0)) \
YV(rmt, rmt_isr_register, n0 = rmt_isr_register((void (*)(void*)) a3, a2, n1, \
(rmt_isr_handle_t *) a0); NIPn(3)) \
YV(rmt, rmt_isr_deregister, n0 = rmt_isr_deregister((rmt_isr_handle_t) n0)) \
YV(rmt, rmt_fill_tx_items, n0 = rmt_fill_tx_items((rmt_channel_t) n3, \
(rmt_item32_t *) a2, n1, n0); NIPn(3)) \
YV(rmt, rmt_driver_install, n0 = rmt_driver_install((rmt_channel_t) n2, n1, n0); NIPn(2)) \
YV(rmt, rmt_driver_uinstall, n0 = rmt_driver_uninstall((rmt_channel_t) n0)) \
YV(rmt, rmt_get_channel_status, n0 = rmt_get_channel_status((rmt_channel_status_result_t *) a0)) \
YV(rmt, rmt_get_counter_clock, n0 = rmt_get_counter_clock((rmt_channel_t) n1, (uint32_t *) a0); NIP) \
YV(rmt, rmt_write_items, n0 = rmt_write_items((rmt_channel_t) n3, (rmt_item32_t *) a2, n1, n0); NIPn(3)) \
YV(rmt, rmt_wait_tx_done, n0 = rmt_wait_tx_done((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_ringbuf_handle, n0 = rmt_get_ringbuf_handle((rmt_channel_t) n1, (RingbufHandle_t *) a0); NIP) \
YV(rmt, rmt_translator_init, n0 = rmt_translator_init((rmt_channel_t) n1, (sample_to_rmt_t) n0); NIP) \
YV(rmt, rmt_translator_set_context, n0 = rmt_translator_set_context((rmt_channel_t) n1, a0); NIP) \
YV(rmt, rmt_translator_get_context, n0 = rmt_translator_get_context((const size_t *) a1, (void **) a0); NIP) \
YV(rmt, rmt_write_sample, n0 = rmt_write_sample((rmt_channel_t) n3, b2, n1, n0); NIPn(3))
#endif
#ifndef ENABLE_SOCKETS_SUPPORT #ifndef ENABLE_SOCKETS_SUPPORT
# define OPTIONAL_SOCKETS_SUPPORT # define OPTIONAL_SOCKETS_SUPPORT
#else #else

View File

@ -12,6 +12,10 @@ These are the current optional modules:
* assemblers.h - Assemblers for ESP32 Xtensa and ESP32 RISC-V * assemblers.h - Assemblers for ESP32 Xtensa and ESP32 RISC-V
* camera.h - Support for the ESP32-CAM camera * camera.h - Support for the ESP32-CAM camera
* oled.h - Support for the SSD1306 Oled * oled.h - Support for the SSD1306 Oled
* rmt.h - Support for RMT (Remote Control)
* serial-bluetooth.h - Support for Bluetooth serial and
bterm a Bluetooth serial redirector for the terminal
* spi-flash.h - Support for low level SPI Flash partition access
Initially ESP32forth focused on a minimal C kernel, with most functionality Initially ESP32forth focused on a minimal C kernel, with most functionality
built in Forth code loaded at boot. Eventually, as support for more capabilities built in Forth code loaded at boot. Eventually, as support for more capabilities

View File

@ -17,9 +17,8 @@
* Revision: {{REVISION}} * Revision: {{REVISION}}
*/ */
#ifndef SIM_PRINT_ONLY
#include "esp_camera.h" #include "esp_camera.h"
#endif
#define OPTIONAL_CAMERA_VOCABULARY V(camera) #define OPTIONAL_CAMERA_VOCABULARY V(camera)
#define OPTIONAL_CAMERA_SUPPORT \ #define OPTIONAL_CAMERA_SUPPORT \
XV(internals, "camera-source", CAMERA_SOURCE, \ XV(internals, "camera-source", CAMERA_SOURCE, \

View File

@ -22,11 +22,11 @@
// Adafruit GFX Library // Adafruit GFX Library
// Adafruit BusIO // Adafruit BusIO
#ifndef SIM_PRINT_ONLY
#include <Adafruit_GFX.h> #include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h> #include <Adafruit_SSD1306.h>
static Adafruit_SSD1306 *oled_display = 0; static Adafruit_SSD1306 *oled_display = 0;
#endif
#define OPTIONAL_OLED_VOCABULARY V(oled) #define OPTIONAL_OLED_VOCABULARY V(oled)
#define OPTIONAL_OLED_SUPPORT \ #define OPTIONAL_OLED_SUPPORT \
XV(internals, "oled-source", OLED_SOURCE, \ XV(internals, "oled-source", OLED_SOURCE, \

69
esp32/optional/rmt.h Normal file
View File

@ -0,0 +1,69 @@
// Copyright 2023 Bradley D. Nelson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "driver/rmt.h"
#define OPTIONAL_RMT_VOCABULARY V(rmt)
#define OPTIONAL_RMT_SUPPORT \
YV(rmt, rmt_set_clk_div, n0 = rmt_set_clk_div((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_clk_div, n0 = rmt_get_clk_div((rmt_channel_t) n1, b0); NIP) \
YV(rmt, rmt_set_rx_idle_thresh, n0 = rmt_set_rx_idle_thresh((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_rx_idle_thresh, \
n0 = rmt_get_rx_idle_thresh((rmt_channel_t) n1, (uint16_t *) a0); NIP) \
YV(rmt, rmt_set_mem_block_num, n0 = rmt_set_mem_block_num((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_mem_block_num, n0 = rmt_get_mem_block_num((rmt_channel_t) n1, b0); NIP) \
YV(rmt, rmt_set_tx_carrier, n0 = rmt_set_tx_carrier((rmt_channel_t) n4, n3, n2, n1, \
(rmt_carrier_level_t) n0); NIPn(4)) \
YV(rmt, rmt_set_mem_pd, n0 = rmt_set_mem_pd((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_mem_pd, n0 = rmt_get_mem_pd((rmt_channel_t) n1, (bool *) a0); NIP) \
YV(rmt, rmt_tx_start, n0 = rmt_tx_start((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_tx_stop, n0 = rmt_tx_stop((rmt_channel_t) n0)) \
YV(rmt, rmt_rx_start, n0 = rmt_rx_start((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_rx_stop, n0 = rmt_rx_stop((rmt_channel_t) n0)) \
YV(rmt, rmt_tx_memory_reset, n0 = rmt_tx_memory_reset((rmt_channel_t) n0)) \
YV(rmt, rmt_rx_memory_reset, n0 = rmt_rx_memory_reset((rmt_channel_t) n0)) \
YV(rmt, rmt_set_memory_owner, n0 = rmt_set_memory_owner((rmt_channel_t) n1, (rmt_mem_owner_t) n0); NIP) \
YV(rmt, rmt_get_memory_owner, n0 = rmt_get_memory_owner((rmt_channel_t) n1, (rmt_mem_owner_t *) a0); NIP) \
YV(rmt, rmt_set_tx_loop_mode, n0 = rmt_set_tx_loop_mode((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_tx_loop_mode, n0 = rmt_get_tx_loop_mode((rmt_channel_t) n1, (bool *) a0); NIP) \
YV(rmt, rmt_set_rx_filter, n0 = rmt_set_rx_filter((rmt_channel_t) n2, n1, n0); NIPn(2)) \
YV(rmt, rmt_set_source_clk, n0 = rmt_set_source_clk((rmt_channel_t) n1, (rmt_source_clk_t) n0); NIP) \
YV(rmt, rmt_get_source_clk, n0 = rmt_get_source_clk((rmt_channel_t) n1, (rmt_source_clk_t * ) a0); NIP) \
YV(rmt, rmt_set_idle_level, n0 = rmt_set_idle_level((rmt_channel_t) n2, n1, \
(rmt_idle_level_t) n0); NIPn(2)) \
YV(rmt, rmt_get_idle_level, n0 = rmt_get_idle_level((rmt_channel_t) n2, \
(bool *) a1, (rmt_idle_level_t *) a0); NIPn(2)) \
YV(rmt, rmt_get_status, n0 = rmt_get_status((rmt_channel_t) n1, (uint32_t *) a0); NIP) \
YV(rmt, rmt_set_rx_intr_en, n0 = rmt_set_rx_intr_en((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_set_err_intr_en, n0 = rmt_set_err_intr_en((rmt_channel_t) n1, (rmt_mode_t) n0); NIP) \
YV(rmt, rmt_set_tx_intr_en, n0 = rmt_set_tx_intr_en((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_set_tx_thr_intr_en, n0 = rmt_set_tx_thr_intr_en((rmt_channel_t) n2, n1, n0); NIPn(2)) \
YV(rmt, rmt_set_gpio, n0 = rmt_set_gpio((rmt_channel_t) n3, (rmt_mode_t) n2, (gpio_num_t) n1, n0); NIPn(3)) \
YV(rmt, rmt_config, n0 = rmt_config((const rmt_config_t *) a0)) \
YV(rmt, rmt_isr_register, n0 = rmt_isr_register((void (*)(void*)) a3, a2, n1, \
(rmt_isr_handle_t *) a0); NIPn(3)) \
YV(rmt, rmt_isr_deregister, n0 = rmt_isr_deregister((rmt_isr_handle_t) n0)) \
YV(rmt, rmt_fill_tx_items, n0 = rmt_fill_tx_items((rmt_channel_t) n3, \
(rmt_item32_t *) a2, n1, n0); NIPn(3)) \
YV(rmt, rmt_driver_install, n0 = rmt_driver_install((rmt_channel_t) n2, n1, n0); NIPn(2)) \
YV(rmt, rmt_driver_uinstall, n0 = rmt_driver_uninstall((rmt_channel_t) n0)) \
YV(rmt, rmt_get_channel_status, n0 = rmt_get_channel_status((rmt_channel_status_result_t *) a0)) \
YV(rmt, rmt_get_counter_clock, n0 = rmt_get_counter_clock((rmt_channel_t) n1, (uint32_t *) a0); NIP) \
YV(rmt, rmt_write_items, n0 = rmt_write_items((rmt_channel_t) n3, (rmt_item32_t *) a2, n1, n0); NIPn(3)) \
YV(rmt, rmt_wait_tx_done, n0 = rmt_wait_tx_done((rmt_channel_t) n1, n0); NIP) \
YV(rmt, rmt_get_ringbuf_handle, n0 = rmt_get_ringbuf_handle((rmt_channel_t) n1, (RingbufHandle_t *) a0); NIP) \
YV(rmt, rmt_translator_init, n0 = rmt_translator_init((rmt_channel_t) n1, (sample_to_rmt_t) n0); NIP) \
YV(rmt, rmt_translator_set_context, n0 = rmt_translator_set_context((rmt_channel_t) n1, a0); NIP) \
YV(rmt, rmt_translator_get_context, n0 = rmt_translator_get_context((const size_t *) a1, (void **) a0); NIP) \
YV(rmt, rmt_write_sample, n0 = rmt_write_sample((rmt_channel_t) n3, b2, n1, n0); NIPn(3))

View File

@ -17,11 +17,11 @@
* Revision: {{REVISION}} * Revision: {{REVISION}}
*/ */
#ifndef SIM_PRINT_ONLY
#include "esp_bt_device.h" #include "esp_bt_device.h"
#include "BluetoothSerial.h" #include "BluetoothSerial.h"
#define bt0 ((BluetoothSerial *) a0) #define bt0 ((BluetoothSerial *) a0)
#endif
#define OPTIONAL_BLUETOOTH_VOCABULARY V(bluetooth) #define OPTIONAL_BLUETOOTH_VOCABULARY V(bluetooth)
#define OPTIONAL_SERIAL_BLUETOOTH_SUPPORT \ #define OPTIONAL_SERIAL_BLUETOOTH_SUPPORT \
XV(internals, "serial-bluetooth-source", SERIAL_BLUETOOTH_SOURCE, \ XV(internals, "serial-bluetooth-source", SERIAL_BLUETOOTH_SOURCE, \

View File

@ -17,10 +17,9 @@
* Revision: {{REVISION}} * Revision: {{REVISION}}
*/ */
#ifndef SIM_PRINT_ONLY
#include "esp_spi_flash.h" #include "esp_spi_flash.h"
#include "esp_partition.h" #include "esp_partition.h"
#endif
#define OPTIONAL_SPI_FLASH_VOCABULARY V(spi_flash) #define OPTIONAL_SPI_FLASH_VOCABULARY V(spi_flash)
#define OPTIONAL_SPI_FLASH_SUPPORT \ #define OPTIONAL_SPI_FLASH_SUPPORT \
XV(internals, "spi-flash-source", SPI_FLASH_SOURCE, \ XV(internals, "spi-flash-source", SPI_FLASH_SOURCE, \

View File

@ -30,6 +30,12 @@ internals DEFINED? oled-source [IF]
oled-source evaluate oled-source evaluate
[THEN] forth [THEN] forth
DEFINED? rmt-builtins [IF]
vocabulary rmt rmt definitions
transfer rmt-builtins
forth definitions
[THEN]
internals DEFINED? serial-bluetooth-source [IF] internals DEFINED? serial-bluetooth-source [IF]
serial-bluetooth-source evaluate serial-bluetooth-source evaluate
[THEN] forth [THEN] forth

View File

@ -43,15 +43,6 @@
# define ENABLE_DAC_SUPPORT # define ENABLE_DAC_SUPPORT
#endif #endif
// RMT support designed around v2.0.1 toolchain.
// While ESP32 also has RMT, for now only include for
// ESP32-S2 and ESP32-C3.
#if defined(CONFIG_IDF_TARGET_ESP32S2) || \
defined(CONFIG_IDF_TARGET_ESP32C3) || \
defined(SIM_PRINT_ONLY)
# define ENABLE_RMT_SUPPORT
#endif
// ESP32-C3 doesn't support fault handling yet. // ESP32-C3 doesn't support fault handling yet.
#if !defined(CONFIG_IDF_TARGET_ESP32C3) #if !defined(CONFIG_IDF_TARGET_ESP32C3)
#endif #endif
@ -100,9 +91,10 @@
V(forth) V(internals) \ V(forth) V(internals) \
V(rtos) V(SPIFFS) V(serial) V(SD) V(SD_MMC) V(ESP) \ V(rtos) V(SPIFFS) V(serial) V(SD) V(SD_MMC) V(ESP) \
V(ledc) V(Wire) V(WiFi) V(sockets) \ V(ledc) V(Wire) V(WiFi) V(sockets) \
V(rmt) V(interrupts) V(timers) \ V(interrupts) V(timers) \
OPTIONAL_CAMERA_VOCABULARY \ OPTIONAL_CAMERA_VOCABULARY \
OPTIONAL_BLUETOOTH_VOCABULARY \ OPTIONAL_BLUETOOTH_VOCABULARY \
OPTIONAL_OLED_VOCABULARY \ OPTIONAL_OLED_VOCABULARY \
OPTIONAL_RMT_VOCABULARY \
OPTIONAL_SPI_FLASH_VOCABULARY \ OPTIONAL_SPI_FLASH_VOCABULARY \
USER_VOCABULARIES USER_VOCABULARIES

View File

@ -27,12 +27,14 @@
#define OPTIONAL_ASSEMBLERS_SUPPORT #define OPTIONAL_ASSEMBLERS_SUPPORT
#define OPTIONAL_OLED_SUPPORT #define OPTIONAL_OLED_SUPPORT
#define OPTIONAL_CAMERA_SUPPORT #define OPTIONAL_CAMERA_SUPPORT
#define OPTIONAL_RMT_SUPPORT
#define OPTIONAL_SERIAL_BLUETOOTH_SUPPORT #define OPTIONAL_SERIAL_BLUETOOTH_SUPPORT
#define OPTIONAL_SPI_FLASH_SUPPORT #define OPTIONAL_SPI_FLASH_SUPPORT
#define OPTIONAL_OLED_VOCABULARY #define OPTIONAL_OLED_VOCABULARY
#define OPTIONAL_CAMERA_VOCABULARY #define OPTIONAL_CAMERA_VOCABULARY
#define OPTIONAL_BLUETOOTH_VOCABULARY #define OPTIONAL_BLUETOOTH_VOCABULARY
#define OPTIONAL_RMT_VOCABULARY
#define OPTIONAL_SPI_FLASH_VOCABULARY #define OPTIONAL_SPI_FLASH_VOCABULARY
#include "builtins.h" #include "builtins.h"

View File

@ -25,6 +25,7 @@
#define OPTIONAL_OLED_VOCABULARY #define OPTIONAL_OLED_VOCABULARY
#define OPTIONAL_CAMERA_VOCABULARY #define OPTIONAL_CAMERA_VOCABULARY
#define OPTIONAL_BLUETOOTH_VOCABULARY #define OPTIONAL_BLUETOOTH_VOCABULARY
#define OPTIONAL_RMT_VOCABULARY
#define OPTIONAL_SPI_FLASH_VOCABULARY #define OPTIONAL_SPI_FLASH_VOCABULARY
static cell_t *simulated(cell_t *sp, const char *op); static cell_t *simulated(cell_t *sp, const char *op);

View File

@ -830,7 +830,10 @@ timer_isr_register ( group timer xt arg ret -- 0/err ) REMOVED
<h5 id="rmt">RMT</h5> <h5 id="rmt">RMT</h5>
These words are inside the <code>RMT</code> vocabulary. These words are inside the <code>RMT</code> vocabulary.
<p><b>
NOTE: Starting in v7.0.7.15 the optional module rmt.h must be
placed next to ESP32forth.ino to include this capability.
</b></p>
<pre> <pre>
rmt_set_clk_div ( channel div8 -- err ) rmt_set_clk_div ( channel div8 -- err )
rmt_get_clk_div ( channel @div8 -- err ) rmt_get_clk_div ( channel @div8 -- err )