Added node.chipmodel().
Updated and removed incorrect node module documentation.
This commit is contained in:
parent
3324ce137d
commit
e1a0a627ff
|
@ -174,6 +174,13 @@ static int node_chipid( lua_State *L )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Lua: node.chipmodel()
|
||||||
|
static int node_chipmodel(lua_State *L)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, CONFIG_IDF_TARGET);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Lua: node.heap()
|
// Lua: node.heap()
|
||||||
static int node_heap( lua_State* L )
|
static int node_heap( lua_State* L )
|
||||||
{
|
{
|
||||||
|
@ -868,6 +875,7 @@ LROT_BEGIN(node, NULL, 0)
|
||||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||||
LROT_FUNCENTRY( chipid, node_chipid )
|
LROT_FUNCENTRY( chipid, node_chipid )
|
||||||
#endif
|
#endif
|
||||||
|
LROT_FUNCENTRY( chipmodel, node_chipmodel )
|
||||||
LROT_FUNCENTRY( compile, node_compile )
|
LROT_FUNCENTRY( compile, node_compile )
|
||||||
LROT_FUNCENTRY( dsleep, node_dsleep )
|
LROT_FUNCENTRY( dsleep, node_dsleep )
|
||||||
#if defined(CONFIG_LUA_VERSION_51)
|
#if defined(CONFIG_LUA_VERSION_51)
|
||||||
|
|
|
@ -71,7 +71,7 @@ if reset_reason == 0 then print("Power UP!") end
|
||||||
|
|
||||||
## node.chipid()
|
## node.chipid()
|
||||||
|
|
||||||
Returns the ESP chip ID.
|
Returns the ESP chip ID. Only available on the base ESP32 model.
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
`node.chipid()`
|
`node.chipid()`
|
||||||
|
@ -85,6 +85,19 @@ chip ID (string)
|
||||||
Note that due to the chip id being a much larger value on the ESP32, it is
|
Note that due to the chip id being a much larger value on the ESP32, it is
|
||||||
reported as a string now. E.g. `"0x1818fe346a88"`.
|
reported as a string now. E.g. `"0x1818fe346a88"`.
|
||||||
|
|
||||||
|
## node.chipmodel()
|
||||||
|
|
||||||
|
Returns the model of the ESP chip.
|
||||||
|
|
||||||
|
#### Syntax
|
||||||
|
`node.chipmodel()`
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
none
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
The chip model as a string, e.g. "esp32c3". This is the string corresponding to the IDF's Kconfig parameter `IDF_TARGET`.
|
||||||
|
|
||||||
## node.compile()
|
## node.compile()
|
||||||
|
|
||||||
Compiles a Lua text file into Lua bytecode, and saves it as .lc file.
|
Compiles a Lua text file into Lua bytecode, and saves it as .lc file.
|
||||||
|
@ -153,20 +166,6 @@ node.dsleep({ gpio = 13, level = 0, pull = true })
|
||||||
- [`node.sleep()`](#nodesleep)
|
- [`node.sleep()`](#nodesleep)
|
||||||
|
|
||||||
|
|
||||||
## node.flashid()
|
|
||||||
|
|
||||||
Returns the flash chip ID.
|
|
||||||
|
|
||||||
#### Syntax
|
|
||||||
`node.flashid()`
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
none
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
flash ID (number)
|
|
||||||
|
|
||||||
|
|
||||||
## node.flashindex() --deprecated
|
## node.flashindex() --deprecated
|
||||||
|
|
||||||
Deprecated synonym for [`node.LFS.get()`](#nodelfsget) to return an LFS function reference.
|
Deprecated synonym for [`node.LFS.get()`](#nodelfsget) to return an LFS function reference.
|
||||||
|
@ -191,31 +190,6 @@ none
|
||||||
#### Returns
|
#### Returns
|
||||||
system heap size left in bytes (number)
|
system heap size left in bytes (number)
|
||||||
|
|
||||||
## node.info()
|
|
||||||
|
|
||||||
Returns NodeMCU version, chipid, flashid, flash size, flash mode, flash speed.
|
|
||||||
|
|
||||||
#### Syntax
|
|
||||||
`node.info()`
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
none
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
- `majorVer` (number)
|
|
||||||
- `minorVer` (number)
|
|
||||||
- `devVer` (number)
|
|
||||||
- `chipid` (number)
|
|
||||||
- `flashid` (number)
|
|
||||||
- `flashsize` (number)
|
|
||||||
- `flashmode` (number)
|
|
||||||
- `flashspeed` (number)
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
```lua
|
|
||||||
majorVer, minorVer, devVer, chipid, flashid, flashsize, flashmode, flashspeed = node.info()
|
|
||||||
print("NodeMCU "..majorVer.."."..minorVer.."."..devVer)
|
|
||||||
```
|
|
||||||
|
|
||||||
## node.input()
|
## node.input()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue