mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
Merge remote-tracking branch 'ul/dev' into merge/js-sdk
This commit is contained in:
31
applications/system/js_app/packages/fz-sdk/i2c/index.d.ts
vendored
Normal file
31
applications/system/js_app/packages/fz-sdk/i2c/index.d.ts
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @brief Check if there is an I2C device ready on the bus
|
||||
* @param address The device address to check
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function isDeviceReady(address: number, timeout?: number): boolean;
|
||||
|
||||
/**
|
||||
* @brief Write data to I2C device and return success status
|
||||
* @param address The device address to write to
|
||||
* @param data The data to write to the device
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function write(address: number, data: number[] | ArrayBuffer, timeout?: number): boolean;
|
||||
|
||||
/**
|
||||
* @brief Read data from I2C device or return undefined on failure
|
||||
* @param address The device address to read from
|
||||
* @param length How many bytes to read
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function read(address: number, length: number, timeout?: number): ArrayBuffer | undefined;
|
||||
|
||||
/**
|
||||
* @brief Write data then read from I2C device or return undefined on failure
|
||||
* @param address The device address to talk to
|
||||
* @param writeData The data to write to the device
|
||||
* @param readLength How many bytes to read
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function writeRead(address: number, writeData: number[] | ArrayBuffer, readLength: number, timeout?: number): ArrayBuffer | undefined;
|
||||
30
applications/system/js_app/packages/fz-sdk/spi/index.d.ts
vendored
Normal file
30
applications/system/js_app/packages/fz-sdk/spi/index.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @brief Acquire SPI bus
|
||||
*/
|
||||
export declare function acquire(): void;
|
||||
|
||||
/**
|
||||
* @brief Release SPI bus
|
||||
*/
|
||||
export declare function release(): void;
|
||||
|
||||
/**
|
||||
* @brief Write data to SPI bus and return success status
|
||||
* @param data The data to write
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function write(data: number[] | ArrayBuffer, timeout?: number): boolean;
|
||||
|
||||
/**
|
||||
* @brief Read data from SPI bus or return undefined on failure
|
||||
* @param length How many bytes to read
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function read(length: number, timeout?: number): ArrayBuffer | undefined;
|
||||
|
||||
/**
|
||||
* @brief Write and read data on SPI bus or return undefined on failure
|
||||
* @param data The data to write, its length also indicates how many bytes will be read
|
||||
* @param timeout Timeout in milliseconds
|
||||
*/
|
||||
export declare function writeRead(data: number[] | ArrayBuffer, timeout?: number): ArrayBuffer | undefined;
|
||||
Reference in New Issue
Block a user