UNPKG

jvsveml6070

Version:

Node.js package for the Vishay VEML6070 UVA Light Sensor, written in TypeScript.

89 lines (88 loc) 3.06 kB
/// <reference types="node" /> import { Byte } from './module'; import { AcknowledgeMode, AcknowledgeThreshold, IntegrationTime, ShutdownMode } from './enums/module'; export declare class CommandRegister extends Byte { /** * Creates a new `CommandRegister` instance. * If the optional `Buffer` instance is not provided, the correct initial bit values are set based on the datasheet. * * @see {@link https://www.vishay.com/docs/84277/veml6070.pdf|Vishay VEML6070 datasheet}, pages 6 to 8. * * @param buffer - An optional `Buffer` instance to use. */ constructor(buffer?: Buffer); /** * Creates a new `CommandRegister` instance from the values of one or more bits. * The initial bit values are set based on the datasheet, but they can be overwritten by passing their values via * the `bits` argument. * * @see {@link https://www.vishay.com/docs/84277/veml6070.pdf|Vishay VEML6070 datasheet}, pages 6 to 8. * * @param bits - A map of bit values keyed by the bit index (in binary order, right to left). * * @returns The created `CommandRegister` instance. */ static fromBits(bits: Map<number, number>): CommandRegister; /** * Creates a new `CommandRegister` instance from a hexadecimal value. * * @param hex - A hexadecimal value, e.g. `0x01` (binary `00000001`). * * @returns The created `CommandRegister` instance. */ static fromHex(hex: number): Byte; /** * Retrieves the shutdown mode. * * @returns The `ShutdownMode` enumeration value. */ getShutdownMode(): ShutdownMode; /** * Sets the shutdown mode. * * @param shutdownMode - The `ShutdownMode` enumeration value. */ setShutdownMode(shutdownMode: ShutdownMode): void; /** * Retrieves the integration time. * * @returns The `IntegrationTime` enumeration value. */ getIntegrationTime(): IntegrationTime; /** * Sets the integration time. * * @param integrationTime - The `IntegrationTime` enumeration value. */ setIntegrationTime(integrationTime: IntegrationTime): void; /** * Retrieves the acknowledge mode. * * @returns The `AcknowledgeMode` enumeration value. */ getAcknowledgeMode(): AcknowledgeMode; /** * Sets the acknowledge mode. * * @param ackMode - The `AcknowledgeMode` enumeration value. */ setAcknowledgeMode(ackMode: AcknowledgeMode): void; /** * Retrieves the acknowledge threshold. * * @returns The `AcknowledgeThreshold` enumeration value. */ getAcknowledgeThreshold(): AcknowledgeThreshold; /** * Sets the acknowledge threshold. * * @param ackThreshold - The `AcknowledgeThreshold` enumeration value. */ setAcknowledgeThreshold(ackThreshold: AcknowledgeThreshold): void; /** * Clones the `CommandRegister` instance. * * @returns The cloned `CommandRegister` instance. */ clone(): CommandRegister; }