Commit Graph

404 Commits

Author SHA1 Message Date
Jade Mattsson 21122827e6 fixup uart examples 2024-10-24 12:05:11 +11:00
Jade Mattsson 231db92619 Fix and document console.write()
Added example on using framed data transmission over the console.
2024-10-23 15:00:13 +11:00
Jade Mattsson 13553ddf76 Refactor into new 'console' module.
A breaking change, but should finally see us move away from the chronic edge
cases and inconsistent behaviour we have while trying to shoe-horn the
usb-serial-jtag and cdc-acm consoles into uart behaviour and assumptions.
2024-10-22 19:00:29 +11:00
serg3295 a78abd41b4
Add node.info() (#3655) 2024-07-31 09:43:15 +02:00
Jade Mattsson 3b9ef17d33 Added node.chipmodel().
Updated and removed incorrect node module documentation.
2024-05-21 16:22:51 +10:00
serg3295 6036c8a6ed
Update u8g2 docs (#3650)
Added description for `updateDisplay()` and `updateDisplayArea()` functions.
2024-05-09 07:58:52 +02:00
Philip Gladstone 92f37dea2d
Port of the rotary module to ESP32 (#3625)
* Ported rotary driver. Compiles but not tested.

* Added the rotary switch driver to the esp32 version

* Review comments. Also ensure that we have GPIO if we have ROTARY.

* Allow use of GPIO 0

* Another bad piece of documentation

* Fix docs and also free the timer

* Now adds a self reference to prevent GC until after close has been called and
any queued messages have been flushed.

* Simplified the code a bit
2024-04-26 21:25:43 -04:00
Jade Mattsson bc3b31fee5 Updated docs after review. 2024-03-27 15:43:59 +11:00
Jade Mattsson 830522ac33 Added espnow module with documentation. 2024-03-27 15:43:59 +11:00
Jade Mattsson bd6b70ee61 Add missing doc link to rtcmem module.
As pointed out by Marcel, thank you!
2024-03-27 13:51:31 +11:00
Marcel Stör 10d0a26f87 Add note about NodeMCU branches 2024-02-18 22:41:18 +01:00
Marcel Stör 4bc22d0c3a Bump MkDocs to latest 2024-02-18 22:41:18 +01:00
Christoph Thelen 14cdff107f
Update rmt translator (#3629)
* Choose the number of RMT buffers in the ws2812 module.

The number of buffers required for optimal operation should be selected
by the ws2812 module, not the caller.

* Add parameters for RGB LED bit times.

This patch adds compatibility for different RGB LEDS besides the WS2812.
ESP evaluation boards like the ESP32-C3-DevKitM-1 use an SK68XXMINI-HS
RGB LED which does not respond to the timings of this module.
The patch adds optional parameters for the bit timings to the write
function. If the new parameters are not supplied, the old values are used.
An example for the SK68XXMINI-HS is provided in the documentation.

* Remove restrictions from RTM translator.

The old RMT translator was not able to split the bits of the source
data into the size requested by the RMT transmitter. Either all 8 bits
of an input byte were translated or none.
The new routine removes the restriction by delivering exactly the
requested amount of data to the transmitter, which results in a more
balanced buffering of translated data under load.

* Add a parameter for the RGB LED reset time.

This patch introduces a new optional parameter for the reset time
in the RGB LED communication. The default is 51.2 microseconds. A
value of 0 sends no reset signal, which allows a small optimisation
for consecutive write commands.

Please note that the reset time of the old code should be 50
microseconds, as the define WS2812_DURATION_RESET suggested. Due to the
restrictions of the old RMT translator routine, it was slightly
increased to 51.2 microseconds. This patch keeps the value of 51.2
microseconds to be as compatible as possible.

* Minimize the time drift between RMT channels.

Place all RMT channels in a group to minimize the time drift between
the signals. Please note that this feature is not available on all
platforms.

* Fix the description of the SK6812 LED in the example code.

The SK6812 expects the data for the green LED first, then red and
finally blue. It should be described as a GRB LED.
2024-02-07 17:56:17 -05:00
Philip Gladstone 4816c168d8
Add support for using multiple memory slots in rmt setup (#3568)
* Add support for using multiple memory slots in rmt setup

* Fix a crash when stopping an RMT receiver

* Add missing docs to the mkdocs
2024-02-01 20:31:56 -05:00
Mike_Went 3cc1d48b83 Fix example pins in docs/modules/uart.md 2024-01-30 12:36:10 +11:00
serg3295 9a9548b0b8 fix(mqtt): select next parameter in connect() 2024-01-30 11:34:03 +11:00
Johny Mattsson 12035a7678 Upgrade to IDF v5.0.2
With minor update required to our spi module.
2024-01-30 11:34:03 +11:00
Johny Mattsson f126b6fe91 Initial migration to IDFv5.0
Plenty of dependency adjustments, printf format specificier updates,
FreeRTOS type and macro name modernisation, not to mention API changes.

Still plenty of legacy/deprecated drivers in use which will need updating.

The following features have been removed due to no longer being available
from the IDF:
  - ADC hall effect sensor reading
  - Configuration of SD SPI host via sdmmc module (now must be done first
    via the spimaster module)
  - FAT partition selection on external SD cards; only the first FAT
    partition is supported by the IDF now

On the other hand, the eth module now supports the following new chipsets:
  - KSZ8001
  - KSZ8021
  - KSZ8031
  - KSZ8051
  - KSZ8061
  - KSZ8091
  - Possibly additional models in the LAN87xx series (the IDF docs aren't
    clear on precisely which models are handled)

Further, the sdmmc module is now available on the ESP32-S3 as well.
2024-01-30 11:34:03 +11:00
Johny Mattsson 32d03a21da Prefer Lua booleans over 1/nil or 1/0
Document preference and also provide easy-to-use backwards compatible
interface.
2023-02-09 15:52:38 +11:00
Johny Mattsson bc3aaf6e4b Update wifi.sta to support new IDF functionality.
In addition to exposing additional configuration settings, it now also
provides access to the wifi station power-saving control.

Documentation updated, and wifi.sta.getconfig() has been documented. Not
sure why that wasn't already the case.
2023-02-09 15:52:38 +11:00
serg3295 1d173c818b
Fix typo in `file.md` (#3566) 2023-01-17 16:44:59 +01:00
Johny Mattsson 55dbcc79d5 Added mkdir/rmdir support to file module. 2023-01-17 14:34:26 +11:00
Johny Mattsson 4c510a5a69 Initial support for using external components/modules. 2023-01-17 14:08:47 +11:00
Johny Mattsson c684180dea Remove defunct extmod bits. 2023-01-17 14:08:47 +11:00
Tom Sutcliffe a40d69dbe8 Make sodium.random API behave consistently on all build types
By returning result as a signed 32-bit int between INT32_MIN to IN32_MAX
which is represented the same regardless of 64-bit support or
integral-only builds.

Also updated docs, fixed links and clarified behavior of random APIs
when WiFi isn't started.
2022-12-19 18:53:04 +11:00
serg3295 f592cf4ee5
Fix ledc.md (#3557)
fixes ledc.channel:fade() syntax.
2022-11-10 20:49:16 -05:00
Philip Gladstone c7cab0aba4
Adds support for settxpower (#3535)
* Adds support for settxpower

* Update docs/modules/wifi.md

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>

* Update docs/modules/wifi.md

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>
2022-09-29 21:38:32 -04:00
Philip Gladstone 9965635694
Ported the rtcmem over to ESP32 (#3544)
* Ported the rtcmem over to ESP32

* Apply review comments.

* Add the rtcmem string to the config option
2022-09-29 21:37:34 -04:00
Marcel Stör e8caaebc5a Pin jinja2, see https://twitter.com/readthedocs/status/1507388916013314048 2022-05-20 07:51:42 +02:00
Philip Gladstone c03e7cffb7
Add the invert option for the ledc module (#3506) 2022-05-20 07:36:36 +02:00
Philip Gladstone ceb62993da
First attempt at adding support for the RMT device. (#3493)
* Adding the first version of the rmt documentation.

* Stub RMT module compiles.

* This version seems to work in (at least) simple cases.

* CLean up the docs

* Minor fixes

* Give the SPI module a chance of working...

* Update to the released version of idf4.4

* Try to get the CI Build to work in all cases

* Try to get the CI Build to work in all cases

* FIx a ringbuffer return issue

* Remove bogus comment

* Review comments

* Better example of transmission

* Review comments

* Add table send example

* Improved documentation

* Documentation comments

* Install the driver correctly.

* A couple of doc updates

* Fix typo
2022-03-05 17:27:11 -05:00
Johny Mattsson cb434811ca
IDF web server module (#3502)
* Added httpd module.

Lua-interface to the standard esp_http_server component.

* Added eromfs module.
2022-03-05 13:51:54 +11:00
Philip Gladstone e5892a7286
Give the SPI module a chance of working... (#3496) 2022-01-27 07:02:56 +01:00
Johny Mattsson 6e63264963
Support interface-specific hostname on ethernet interface. (#3487) 2022-01-02 13:31:58 +11:00
Johny Mattsson a0c9085cca Make node.output() RTOS thread safe.
Also removed old, very unsafe node.osoutput(). We're now integrating cleanly
with the IDF/newlib way of redirecting stdout.

Added necessary depends in Kconfig to ensure VFS support is enabled, as
otherwise you'd only get a mysterious crash when attempting to enable
output redirection.
2021-11-04 22:24:01 +11:00
Johny Mattsson 5c59c57a16 Implement tmr.wdclr() 2021-10-22 12:38:07 +11:00
Johny Mattsson a2ba49e36b Switch to IDF-provided VFS and standard `io` module.
The IDF-provided VFS resolves several issues:

 - The IDF components having a different view of the (virtual) file system
   compared to the Lua environment.

 - RTOS task/thread safety. Our legacy VFS was only ever safe to use
   from the LVM thread, which limited its usability. Upgrading it
   would have effectively required a reimplementation of the IDF VFS,
   which would have been a bigger task with larger on-going maintenance
   issues.

 - We're no longer needing to maintain our own SPIFFS component.

 - We're no longer needing to maintain our own FATFS component.

 - The legacy of the 8266's lack of standard C interface to the file system
   is no longer holding us back, meaning that we can use the standard
   Lua `io` module rather than the cobbled-together swiss army knife
   also known as the file module.

Of course, the downside is that we'll either have to declare a backwards
breakage in regard to the file module, or provide a Lua shim for the old
functions, where applicable.

Also included is some necessary integer type fixups in unrelated code,
which apparently had depended on some non-standard types in either the
SPIFFS or FATFS headers.

A memory leak issue in the sdmmc module was also found and fixed while
said module got switched over to the Espressif VFS.

Module documentation has been updated to match the new reality (and I
discovered in some places it wasn't even matching the old reality).
2021-10-20 21:49:11 +11:00
Marcel Stör 389c119a8b
Add http.put (#3462)
Replaces setpostdata() with setbody().
2021-10-05 13:33:27 +11:00
Johny Mattsson 5e52a9e200 Added heaptrace module. 2021-09-16 13:54:55 +10:00
Johny Mattsson b84138595d Add eth.set_ip() functionality.
Effectively the esp_netif version of the recent tcpip_adapter based
support added on dev-esp32 in fa6fd1a41b.
2021-09-09 19:07:51 +10:00
Johny Mattsson 37f682dd70 More ethernet module fixes. 2021-09-09 19:05:48 +10:00
Johny Mattsson 185855b69a Brought over node.setonerror() functionality.
Now properly triggering restart on non-interactive errors.
2021-08-26 11:33:42 +10:00
Johny Mattsson 0690a7d181 Make bit module handle 32/64bit integer configs. 2021-08-25 18:58:53 +10:00
Johny Mattsson dba57fa0ea Merge branch 'dev-esp32-idf4-lua53' into dev-esp32-idf4 2021-08-24 10:42:43 +10:00
Johny Mattsson e52e0a8e84 Pulled in the 5.1+5.3 docs from the esp8266 branch.
With minor modifications to drop ESP8266 specific information not
applicable to the ESP32 series. Further corrections welcome.
2021-08-22 19:25:39 +10:00
Marcel Stör 3a6961ccc7
Update RTD MkDocs (#3457)
* Modernize docs

* Remove old style hacks

* Add comment
2021-08-16 15:27:56 +10:00
Johny Mattsson bc7b923646 Code cleanup to sort out warnings.
I2S constants have changed; docs updated.
2021-07-29 13:47:45 +10:00
Johny Mattsson dff32e8902 WiFi module updates.
- Added support for WPA3
- Evicted left-over broken WiFi auto-reconnect
- Updated docs
2021-07-28 19:09:19 +10:00
Johny Mattsson 06a0e3dc23 idf4: part 3.2 - fix bug in updated eth module
Updated docs to reflect new WiFi station connect behaviour.
2021-07-22 16:46:57 +10:00
Johny Mattsson 54a41149ea idf4: part 3.1 - sorting out the linker specifics
Now boots to the Lua prompt, and modules are included and findable.
2021-07-21 20:46:42 +10:00