UNPKG

@linuxcnc-node/hal

Version:

Node.js bindings for LinuxCNC HAL library

55 lines (54 loc) 2.72 kB
import { HalType, HalPinDir, HalParamDir, RtapiMsgLevel, HalPinInfo, HalSignalInfo, HalParamInfo } from "./enums"; import { HalComponent as HalComponentClass, HalComponentInstance, Pin, Param } from "./component"; export * from "./enums"; export { HalComponentClass as HalComponent }; export { Pin, Param }; /** * Creates a new HAL component instance. * @param name The name of the component. * @param prefix Optional prefix for pin/param names. Defaults to component name. * @returns A HalComponent instance. */ export declare const component: (name: string, prefix?: string) => HalComponentInstance; export declare const componentExists: (name: string) => boolean; export declare const componentIsReady: (name: string) => boolean; export declare const getMsgLevel: () => RtapiMsgLevel; export declare const setMsgLevel: (level: RtapiMsgLevel) => void; export declare const connect: (pinName: string, signalName: string) => boolean; export declare const disconnect: (pinName: string) => boolean; export declare const getValue: (name: string) => any; export declare const getInfoPins: () => HalPinInfo[]; export declare const getInfoSignals: () => HalSignalInfo[]; export declare const getInfoParams: () => HalParamInfo[]; export declare const newSignal: (signalName: string, type: HalType) => boolean; export declare const pinHasWriter: (pinName: string) => boolean; /** * Sets the value of any HAL pin or parameter. * @param name The full name of the pin or parameter. * @param value The value to set */ export declare const setPinParamValue: (name: string, value: string | number | boolean) => boolean; /** * Sets the value of any unconnected HAL signal. * @param name The full name of the signal. * @param value The value to set */ export declare const setSignalValue: (name: string, value: string | number | boolean) => boolean; export declare const HAL_BIT: HalType.BIT; export declare const HAL_FLOAT: HalType.FLOAT; export declare const HAL_S32: HalType.S32; export declare const HAL_U32: HalType.U32; export declare const HAL_S64: HalType.S64; export declare const HAL_U64: HalType.U64; export declare const HAL_IN: HalPinDir.IN; export declare const HAL_OUT: HalPinDir.OUT; export declare const HAL_IO: HalPinDir.IO; export declare const HAL_RO: HalParamDir.RO; export declare const HAL_RW: HalParamDir.RW; export declare const MSG_NONE: RtapiMsgLevel.NONE; export declare const MSG_ERR: RtapiMsgLevel.ERR; export declare const MSG_WARN: RtapiMsgLevel.WARN; export declare const MSG_INFO: RtapiMsgLevel.INFO; export declare const MSG_DBG: RtapiMsgLevel.DBG; export declare const MSG_ALL: RtapiMsgLevel.ALL; export type { HalWatchCallback, HalWatchOptions, HalWatchedObject, } from "./component";