49 Commits

Author SHA1 Message Date
devsaurus
f5632f41f9 extend i2c master with hardware interfaces for synchronous and asynchronous operation 2017-02-04 20:14:13 +01:00
devsaurus
381726f103 add i2c module 2017-02-02 21:40:36 +01:00
devsaurus
4fcb1404b6 add simga_delta module 2017-01-13 22:34:24 +01:00
Johny Mattsson
9f8dc0271b Updated to latest IDF. 2017-01-10 11:37:49 +11:00
Johny Mattsson
ea59007bc3 WiFi module documentation and updates.
Addresses one point of #1615.
2017-01-03 12:57:45 +11:00
Johny Mattsson
7abda5c9e0 Updated to latest IDF.
- Switched hardcoded interrupts to new IDF interrupt allocation
framework.

- gpio module switched to the IDF's per-pin interrupt callback service.

- Improved NodeMCU linker script since it broke with the IDF upgrade.

- Various compatibility updates.
2016-12-30 19:25:48 +11:00
Johny Mattsson
4ece8de4d9 net module: hold/unhold support.
As per @djphoenix's work on the ESP8266 side.
2016-12-30 15:55:14 +11:00
Johny Mattsson
6bce18f9ac net module: Server timeout support
As per @djphoenix's version on the ESP8266 side.
2016-12-30 15:39:07 +11:00
Johny Mattsson
334ba08131 Split wifi.on() into wifi.sta.on()/wifi.ap.on()
As discussed in #1615.
2016-12-10 15:25:57 +11:00
Johny Mattsson
d48265348a Fixed various warnings. 2016-11-27 13:28:48 +11:00
Johny Mattsson
c505cc0270 Preliminary gpio module.
The gpio ISR needs to go into the platform layer most likely, but that's
for later.
2016-11-26 21:54:05 +11:00
Johny Mattsson
c4911ca391 Updated to latest IDF.
This fixes the panic-on-restart issue and the crash-on-uart-input-before-flash-mapped issue.

Node module updated to reflect new function names for sleep/restart.
2016-11-25 10:51:49 +11:00
Johny Mattsson
888ce8b5f3 Unbreak integer build. 2016-11-17 21:59:56 +11:00
Johny Mattsson
3fe7f77512 Imported 'bit' module from dev branch. 2016-11-17 21:56:51 +11:00
Johny Mattsson
6ce3e7a551 Imported 'struct' module from dev branch. 2016-11-17 21:48:31 +11:00
Johny Mattsson
0f0cc93f7b Fix module inclusion (got broken by IDF build changes). 2016-11-17 16:52:01 +11:00
Johny Mattsson
2b454abfdf Improved flash size detection.
With the recent flash layout changes, it became very possible to misdetect the
flash size. We're now using the partition table as the guard marker, since
that really shouldn't be all 0xff. Also, we now don't clobber the flash
device id (and keep block/sector/page/mask values).
2016-11-17 11:56:39 +11:00
Johny Mattsson
2266670b46 Updated to latest IDF. 2016-11-16 17:59:06 +11:00
Johny Mattsson
389980fc0c Removed call to deprecated system_init(). 2016-11-12 13:23:09 +11:00
Johny Mattsson
5c1bb4c6d6 Updated to latest IDF.
WiFi STA module updated to reflect IDF name changes.

Platform flash and partition api updated to reflect IDF name changes.
Eventually these (and the SPIFFS module) will likely need to be updated
to exclusively work with the esp_partition_xxx() functions in order to
support working with encrypted flash.
2016-11-12 13:17:17 +11:00
Johny Mattsson
be5dafb264 Imported @djphoenix's new native LWIP net module.
Based on his revision 2d290a24a0914be88e5ca4ac7b1018392fe75fe2
(https://github.com/djphoenix/nodemcu-firmware).

All LWIP callback handling changed to use the NodeMCU task interface
to make it usable on RTOS.

IPv4 assumptions have been removed, and this net module /should/ now
be IPv6 ready, but aside from compilation no testing has been done
in this area.

SSL integration points not touched - some work needed there once we
have an mbedTLS module.
2016-10-06 17:24:08 +11:00
Johny Mattsson
e67c6f0917 Split out IP formatting helpers. 2016-10-06 17:23:48 +11:00
Johny Mattsson
d83437d1ba Removed left-over UART debug echo. 2016-10-05 14:36:24 +11:00
Johny Mattsson
4fead4a4be More WiFi module work.
Station connect/disconnect/scan, plus event handling via wifi.on().
2016-10-04 17:40:06 +11:00
Johny Mattsson
233bdc63aa Fixed Kconfig macro use for Lua debug module (oops). 2016-10-04 15:33:40 +11:00
Johny Mattsson
991965e242 Actually include standard Lua modules. 2016-10-04 14:47:41 +11:00
Johny Mattsson
3503a1ec95 Basic wifi config functions.
Note need to use explicit wifi.start() at this point.
2016-10-03 17:42:28 +11:00
Johny Mattsson
5df981010a Prevent UART/startup race ala 1517.
We're already in the right context, there is no point posting back the
Lua start, we can do it right then and there instead.
2016-10-03 13:05:17 +11:00
Johny Mattsson
e355057de6 Fix our esp_event_send() implementation. 2016-09-29 18:21:18 +10:00
Johny Mattsson
f9bf50cf03 Simple BlueTooth module for BT LE advertisements. 2016-09-29 17:02:40 +10:00
Johny Mattsson
8e441b59c1 Grabbed the encoder module from dev.
Only minor changes to make it IDF friendly.
2016-09-28 17:58:44 +10:00
Johny Mattsson
16e19442c1 Added node.osprint().
Implemented in terms of esp_log_level_set() at this point.
2016-09-28 17:57:29 +10:00
Johny Mattsson
febc8f7f36 Updated to latest IDF. 2016-09-28 17:57:00 +10:00
Johny Mattsson
33eb1bc790 Updated to new startup & esp event handling.
Modules can now subscribe to ESP system events via the new
NODEMCU_ESP_EVENT() macro. See nodemcu_esp_event.h for details.
2016-09-27 18:42:08 +10:00
Johny Mattsson
6349fc8622 Most of the node module from dev.
node.dsleep() no longer takes options.
node.output() not yet supported (needs syscall registration/chaining support)

Dynamic CPU frequency changing not currently supported in the IDF.
Various chip IDs not currently available/obtainable.
Boot reason completely revamped in ESP32, will need new code.
2016-09-26 18:04:24 +10:00
Johny Mattsson
48bbe74cbf Updated to latest IDF.
Lost some helpful macros when they changed the uart register header it seems.
2016-09-26 13:36:53 +10:00
Johny Mattsson
baf8249a79 Improved flash-size auto-detection.
No longer limited to the default 2MB.
2016-09-23 17:39:06 +10:00
Johny Mattsson
3b65262922 Less memory leaks if not coding in a rush... 2016-09-22 19:50:46 +10:00
Johny Mattsson
d369953328 Auto-create SPIFFS partition if not found.
The heuristics could probably be improved a lot, but this is better than
nothing at least.
2016-09-22 18:19:39 +10:00
Johny Mattsson
60339b812b SPIFFS partition support, file module from dev.
Now uses the designated partition (type 0xC2, 0x00) unconditionally.
2016-09-22 17:18:22 +10:00
Johny Mattsson
0fe0096c04 Platform flash layer updated for ESP32.
It would appear my ESP3212 only has a 2MB flash chip despite the
bootloader saying 4MB.
2016-09-22 14:56:40 +10:00
Johny Mattsson
6cd3111d79 Platform interface to flash partition info. 2016-09-22 13:09:56 +10:00
Johny Mattsson
8e23335c0f Removed more unused legacy code. 2016-09-22 11:42:25 +10:00
Johny Mattsson
6f54c38e53 Grabbed fatfs from dev branch, and IDF-ified it. 2016-09-21 18:21:44 +10:00
Johny Mattsson
4f1b33d522 Grabbed latest spiffs + vfs layer from dev branch.
Also included the recent LVM fix.

Platform flash layer not yet functional.
2016-09-21 18:14:15 +10:00
Johny Mattsson
fe602d2d7e Removed all currently-unused code & docs.
Heading towards having only ESP32-aware/capable code in this branch.
2016-09-21 13:47:44 +10:00
Johny Mattsson
51fabc7439 Fixed NodeMCU boot banner.
Build for ESP32 on Travis.
2016-09-20 14:19:50 +10:00
Johny Mattsson
9bbf8f43fb Successfully boot barebones NodeMCU on ESP32 (only).
RTOS driver evicted as it did not play nice with stdio etc.

Implemented a minimal driver to fully support Lua console on UART0. Output
on UART0 done via stdout (provided by the IDF). Input and setup handled
via driver_console/console.c. In addition to the direct input function
console_getc(), the driver also registers in the syscall tables to enable
regular stdio input functions to work (yay!). The Lua VM is still using the
direct interface since it's less overhead, but does also work when going
through stdin/fd 0.

Auto-bauding on the console is not yet functional; revisit when the UART docs
are available.

Module registration/linking/enabling moved over to be Kconfig based. See
updates to base_nodemcu/include/module.h and base_nodemcu/Kconfig for
details.

The sdk-overrides directory/approach is no longer used. The IDF is simply
too different to the old RTOS SDK - we need to adapt our code directly instead.

Everything in app/ is now unused, and will need to be gradually migrated
into components/ though it is probably better to migrate straight from the
latest dev branch.
2016-09-20 13:35:56 +10:00
Johny Mattsson
a463d764eb WIP ESP32 IDF port.
Currently the UART driver break boot (or at least output).
2016-09-16 18:11:42 +10:00