mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-13 05:19:50 +04:00
JS: Update and fix docs, fix Number.toString() with decimals (#4168)
* Update and fix JS docs This could really use some automation, atleast for API reference There are TypeScript definitions and typedocs, we don't need to be monkeys copying and reformatting this to API reference by hand * Fix bugged character * JS: Fix Number.toString() with decimals * Fix * Forgot this one * docs: mention per-view child format * Added @portasynthinca3 to docs' codeowners * Updated CODEOWNERS --------- Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com> Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
@@ -24,7 +24,7 @@ delay(1000);
|
||||
---
|
||||
|
||||
# API reference
|
||||
## get
|
||||
## get()
|
||||
Gets a `Pin` object that can be used to manage a pin.
|
||||
|
||||
**Parameters**
|
||||
@@ -89,3 +89,33 @@ Attaches an interrupt to a pin configured with `direction: "in"` and
|
||||
|
||||
An event loop `Contract` object that identifies the interrupt event source. The
|
||||
event does not produce any extra data.
|
||||
|
||||
### Pin.isPwmSupported()
|
||||
Determines whether this pin supports PWM.
|
||||
If `false`, all other PWM-related methods on this pin will throw an error when called.
|
||||
|
||||
**Returns**
|
||||
|
||||
Boolean value.
|
||||
|
||||
### Pin.pwmWrite()
|
||||
Sets PWM parameters and starts the PWM.
|
||||
Configures the pin with `{ direction: "out", outMode: "push_pull" }`.
|
||||
Throws an error if PWM is not supported on this pin.
|
||||
|
||||
**Parameters**
|
||||
- `freq`: Frequency in Hz
|
||||
- `duty`: Duty cycle in %
|
||||
|
||||
### Pin.isPwmRunning()
|
||||
Determines whether PWM is running.
|
||||
Throws an error if PWM is not supported on this pin.
|
||||
|
||||
**Returns**
|
||||
|
||||
Boolean value.
|
||||
|
||||
### Pin.pwmStop()
|
||||
Stops PWM.
|
||||
Does not restore previous pin configuration.
|
||||
Throws an error if PWM is not supported on this pin.
|
||||
|
||||
Reference in New Issue
Block a user