import { WPILibWSRobotBase, DigitalChannelMode } from "@wpilib/wpilib-ws-robot"; import LSM6 from "./devices/core/lsm6/lsm6"; import RomiConfiguration from "./romi-config"; import QueuedI2CBus from "../device-interfaces/i2c/queued-i2c-bus"; export interface DevicePortMappingInfo { deviceName: string; port: number; } export interface RobotIOChannelInfo { dio: DevicePortMappingInfo[]; analogIn: DevicePortMappingInfo[]; pwm: DevicePortMappingInfo[]; } export declare const NUM_CONFIGURABLE_PINS: number; export default class WPILibWSRomiRobot extends WPILibWSRobotBase { private _queuedBus; private _i2cHandle; private _firmwareIdent; private _batteryPct; private _heartbeatTimer; private _readTimer; private _imuReadTimer; private _digitalInputValues; private _analogInputValues; private _encoderInputValues; private _leftEncoderChannel; private _rightEncoderChannel; private _ioConfiguration; private _dioDevicePortMapping; private _analogInDevicePortMapping; private _pwmDevicePortPortMapping; private _extPinConfiguration; private _onboardPinConfiguration; private _readyP; private _i2cErrorDetector; private _lsm6; private _imuFIFOperiod; private _romiAccelerometer; private _romiGyro; private _imuReadsPaused; private _numWsConnections; private _dsEnabled; private _dsHeartbeatPresent; private _customDevices; private _statusNetworkTable; private _configNetworkTable; constructor(bus: QueuedI2CBus, address: number, romiConfig?: RomiConfiguration); getIMU(): LSM6; pauseIMUReads(reason?: string): void; resumeIMUReads(reason?: string): void; readyP(): Promise; get descriptor(): string; get firmwareIdent(): number; get ioChannelInfo(): RobotIOChannelInfo; getBatteryPercentage(): number; setDigitalChannelMode(channel: number, mode: DigitalChannelMode): void; setDIOValue(channel: number, value: boolean): void; getDIOValue(channel: number): boolean; setAnalogOutVoltage(channel: number, voltage: number): void; getAnalogInVoltage(channel: number): number; setPWMValue(channel: number, value: number): void; registerEncoder(encoderChannel: number, channelA: number, channelB: number): void; getEncoderCount(channel: number): number; getEncoderPeriod(channel: number): number; resetEncoder(channel: number, keepLast?: boolean): void; setEncoderReverseDirection(channel: number, reverse: boolean): void; /** * Called when a new WebSocket connection occurs */ onWSConnection(remoteAddrV4?: string): void; /** * Called when a WebSocket disconnects */ onWSDisconnection(): void; onRobotEnabled(): void; onRobotDisabled(): void; onDSPacketTimeoutOccurred(): void; onDSPacketTimeoutCleared(): void; queryFirmwareIdent(): Promise; private _verifyConfiguration; /** * Configure all devices on the Romi * This includes setting up the appropriate IO port->device/port pairs */ private _configureDevices; /** * Write the onboard IO configuration in oneshot */ private _writeRomiOnboardIOConfiguration; /** * Do the actual configuration write to the romi */ private _writeRomiExtIOConfiguration; private _setRomiHeartBeat; private _bulkAnalogRead; private _bulkDigitalRead; private _bulkEncoderRead; private _readBattery; /** * Resets the Romi to a known clean state * This does NOT reset any IO configuration */ private _resetToCleanState; private _configureNTInterface; private _registerCustomDevices; }