Skip to content

Commit

Permalink
Fix ledc, otaupgrade, pulsecnt, sdmmc, sjson, touch docs (#3436)
Browse files Browse the repository at this point in the history
ledc.md - formatting, add object name
otaupgrade.md - formatting, add 'Syntax' section
pulsecnt.md - formatting, fix syntax pulsecnt.create, add object name
sdmmc.md - fix typos
sjson.md - formatting, add `Parameters` section
touch.md - formatting, add object name, fix Returns in tp:read()
  • Loading branch information
serg3295 authored May 23, 2021
1 parent 39dc2e0 commit 8e0e0cb
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 158 deletions.
24 changes: 12 additions & 12 deletions docs/modules/ledc.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ List of configuration tables:
- `duty` Channel duty, the duty range is [0, (2**bit_num) - 1]. Example: if ledc.TIMER_13_BIT is used maximum value is 4096 x 2 -1 = 8091

#### Returns
`ledc.channel`
`channel` ledc.channel

#### Example
```lua
Expand Down Expand Up @@ -79,7 +79,7 @@ Disable LEDC output, and set idle level.
- `ledc.IDLE_HIGH`

#### Returns
nil
`nil`

#### Example
```lua
Expand All @@ -96,7 +96,7 @@ Set channel frequency (Hz)
- `frequency` What frequency should be set

#### Returns
nil
`nil`

#### Example
```lua
Expand Down Expand Up @@ -133,7 +133,7 @@ Set channel duty
- `duty` What duty should be set

#### Returns
nil
`nil`

#### Example
```lua
Expand Down Expand Up @@ -170,7 +170,7 @@ Resets the timer
None

#### Returns
nil
`nil`


#### Example
Expand All @@ -189,7 +189,7 @@ Pauses the timer
None

#### Returns
nil
`nil`

#### Example
```lua
Expand All @@ -207,7 +207,7 @@ Resumes a paused timer
None

#### Returns
nil
`nil`

#### Example
```lua
Expand All @@ -229,7 +229,7 @@ Set LEDC fade function, with a limited time.
- `ledc.FADE_WAIT_DONE`

#### Returns
nil
`nil`

#### Example
```lua
Expand All @@ -252,7 +252,7 @@ Set LEDC fade function, with step.
- `ledc.FADE_WAIT_DONE`

#### Returns
nil
`nil`

#### Example
```lua
Expand All @@ -269,8 +269,8 @@ Set LEDC fade function.
#### Parameters
- `duty` Set the start of the gradient duty.
- `direction` Set the direction of the gradient.
- `ledc.FADE_DECREASE`
- `ledc.FADE_INCREASE`
- `ledc.FADE_DECREASE`
- `ledc.FADE_INCREASE`
- `scale` Set gradient change amplitude.
- `cycleNum` Set how many LEDC tick each time the gradient lasts.
- `stepNum` Set the number of the gradient.
Expand All @@ -279,7 +279,7 @@ Set LEDC fade function.
- `ledc.FADE_WAIT_DONE`

#### Returns
nil
`nil`

#### Example
```lua
Expand Down
30 changes: 17 additions & 13 deletions docs/modules/otaupgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,40 @@ marking a new firmware as valid is to ensure the upgrade server can be
reached, on the basis that as long as the firmware can be remotely
upgraded, it's "good enough" to accept.

# otaupgrade.info()
## otaupgrade.info()

The boot info and application state and version info can be queried with
this function. Typically it will be used to check the version of the
running application, to compare against a "desired" version in order
to decide whether an upgrade is required.

#### Syntax
`otaupgrade.info()`

#### Parameters
None.

#### Returns
A list of three values:

- the name of the partition of the running application
- the name of the partition currently marked for boot next (typically the
same as the running application, but after `otaupgrade.complete()` it
may point to a new application partition.
- a table whose keys are the names of OTA partitions and corresponding
values are tables containing:
- `state` one of `new`, `testing`, `valid`, `invalid`, `aborted` or
- `state` one of `new`, `testing`, `valid`, `invalid`, `aborted` or
possibly `undefined`. The values `invalid` and `aborted` largely
mean the same things. See the IDF documentation for specifics.
A partition in `testing` state needs to call `otaupgrade.accept()`
if it wishes to become `valid`.
- `name` the application name, typically "NodeMCU"
- `date` the build date
- `time` the build time
- `version` the build version, as set by the *PROJECT_VER* variable
- `name` the application name, typically "NodeMCU"
- `date` the build date
- `time` the build time
- `version` the build version, as set by the *PROJECT_VER* variable
during build
- `secure_version` the secure version number, if secure boot is enabled
- `idf_version` the IDF version
- `secure_version` the secure version number, if secure boot is enabled
- `idf_version` the IDF version

#### Example
```lua
Expand All @@ -99,7 +103,7 @@ end
print("Running version: "..info[boot_part].version)
```

# otaupgrade.commence()
## otaupgrade.commence()

Wipes the spare application partition and prepares to receive the new
application firmware.
Expand All @@ -121,7 +125,7 @@ A Lua error may be raised if the OTA upgrade cannot be commenced for some
reason (such as due to incorrect partition setup).


# otaupgrade.write(data)
## otaupgrade.write(data)

Write a chunk of application firmware data to the correct partition and
location. Data must be streamed sequentially, the IDF does not support
Expand All @@ -141,7 +145,7 @@ data not being a valid OTA image (the IDF performs some checks in this
regard).


# otaupgrade.complete(reboot)
## otaupgrade.complete(reboot)

Finalises the upgrade, and optionally reboots into the new application
firmware right away.
Expand Down Expand Up @@ -192,7 +196,7 @@ end)

```

# otaupgrade.accept()
## otaupgrade.accept()

When the installed boot loader is built with rollback support, a new
application image is by default only booted once. During this "test run"
Expand All @@ -211,7 +215,7 @@ None.
`nil`


# otaupgrade.rollback()
## otaupgrade.rollback()

A new firmware may decide that it is not performing as expected, and
request an explicit rollback to the previous version. If the call to this
Expand Down
Loading

0 comments on commit 8e0e0cb

Please sign in to comment.