mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
[FL-3734] UART framing mode selection (#4121)
* HAL: feat: uart framing * JS: feat: uart framing * fix formatting * fix pvs warning * HAL: flash impact reduction attempt 1 * HAL: flash impact reduction attempt 2 * fix compile error * HAL: finalize flash impact reduction * HAL: remove user-facing magic numbers Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
* @brief Checks compatibility between the script and the JS SDK that the
|
||||
* firmware provides
|
||||
*
|
||||
* @note You're looking at JS SDK v0.1
|
||||
* @note You're looking at JS SDK v0.3
|
||||
*
|
||||
* @param expectedMajor JS SDK major version expected by the script
|
||||
* @param expectedMinor JS SDK minor version expected by the script
|
||||
@@ -92,7 +92,7 @@ declare function sdkCompatibilityStatus(expectedMajor: number, expectedMinor: nu
|
||||
* @brief Checks compatibility between the script and the JS SDK that the
|
||||
* firmware provides in a boolean fashion
|
||||
*
|
||||
* @note You're looking at JS SDK v0.1
|
||||
* @note You're looking at JS SDK v0.3
|
||||
*
|
||||
* @param expectedMajor JS SDK major version expected by the script
|
||||
* @param expectedMinor JS SDK minor version expected by the script
|
||||
@@ -105,7 +105,7 @@ declare function isSdkCompatible(expectedMajor: number, expectedMinor: number):
|
||||
* @brief Asks the user whether to continue executing the script if the versions
|
||||
* are not compatible. Does nothing if they are.
|
||||
*
|
||||
* @note You're looking at JS SDK v0.1
|
||||
* @note You're looking at JS SDK v0.3
|
||||
*
|
||||
* @param expectedMajor JS SDK major version expected by the script
|
||||
* @param expectedMinor JS SDK minor version expected by the script
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flipperdevices/fz-sdk",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"description": "Type declarations and documentation for native JS modules available on Flipper Zero",
|
||||
"keywords": [
|
||||
"flipper",
|
||||
|
||||
@@ -4,16 +4,33 @@
|
||||
* @module
|
||||
*/
|
||||
|
||||
export interface Framing {
|
||||
/**
|
||||
* @note 6 data bits can only be selected when parity is enabled (even or
|
||||
* odd)
|
||||
* @note 9 data bits can only be selected when parity is disabled (none)
|
||||
*/
|
||||
dataBits: "6" | "7" | "8" | "9";
|
||||
parity: "none" | "even" | "odd";
|
||||
/**
|
||||
* @note LPUART only supports whole stop bit lengths (i.e. 1 and 2 but not
|
||||
* 0.5 and 1.5)
|
||||
*/
|
||||
stopBits: "0.5" | "1" | "1.5" | "2";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes the serial port
|
||||
*
|
||||
* Automatically disables Expansion module service to prevent interference.
|
||||
*
|
||||
* @param port The port to initialize (`"lpuart"` or `"start"`)
|
||||
* @param baudRate
|
||||
* @param port The port to initialize (`"lpuart"` or `"usart"`)
|
||||
* @param baudRate Baud rate
|
||||
* @param framing See `Framing` type
|
||||
* @version Added in JS SDK 0.1
|
||||
* @version Added `framing` parameter in JS SDK 0.3, extra feature `"serial-framing"`
|
||||
*/
|
||||
export declare function setup(port: "lpuart" | "usart", baudRate: number): void;
|
||||
export declare function setup(port: "lpuart" | "usart", baudRate: number, framing?: Framing): void;
|
||||
|
||||
/**
|
||||
* @brief Writes data to the serial port
|
||||
|
||||
Reference in New Issue
Block a user