# Class: Device

# Hierarchy

  • Device

# Constructors

# constructor

+ new Device(__namedParameters: object): Device

Defined in src/lib/Device.ts:8

Parameters:

__namedParameters: object

Name Type
address number
bus Bus‹›

Returns: Device

# Properties

# address

address: number

Defined in src/lib/Device.ts:8

# Methods

# deviceId

deviceId(): Promise‹number›

Defined in src/lib/Device.ts:81

Returns: Promise‹number›


# i2cRead

i2cRead(length: number, buffer: Buffer): Promise‹I2cReadResponse›

Defined in src/lib/Device.ts:69

Parameters:

Name Type
length number
buffer Buffer

Returns: Promise‹I2cReadResponse›


# i2cWrite

i2cWrite(length: number, buffer: Buffer): Promise‹I2cWriteResponse›

Defined in src/lib/Device.ts:75

Parameters:

Name Type
length number
buffer Buffer

Returns: Promise‹I2cWriteResponse›


# readByte

readByte(command: number): Promise‹number›

Defined in src/lib/Device.ts:15

Parameters:

Name Type
command number

Returns: Promise‹number›


# readI2cBlock

readI2cBlock(command: number, length: number, buffer: Buffer): Promise‹I2cReadResponse›

Defined in src/lib/Device.ts:27

Parameters:

Name Type
command number
length number
buffer Buffer

Returns: Promise‹I2cReadResponse›


# readWord

readWord(command: number): Promise‹number›

Defined in src/lib/Device.ts:21

Parameters:

Name Type
command number

Returns: Promise‹number›


# receiveByte

receiveByte(): Promise‹number›

Defined in src/lib/Device.ts:33

Returns: Promise‹number›


# sendByte

sendByte(byte: number): Promise‹this›

Defined in src/lib/Device.ts:39

Parameters:

Name Type
byte number

Returns: Promise‹this›


# writeByte

writeByte(command: number, byte: number): Promise‹this›

Defined in src/lib/Device.ts:45

Parameters:

Name Type
command number
byte number

Returns: Promise‹this›


# writeI2cBlock

writeI2cBlock(command: number, length: number, buffer: Buffer): Promise‹I2cWriteResponse›

Defined in src/lib/Device.ts:63

Parameters:

Name Type
command number
length number
buffer Buffer

Returns: Promise‹I2cWriteResponse›


# writeQuick

writeQuick(bit: 0 | 1): Promise‹this›

Defined in src/lib/Device.ts:57

Parameters:

Name Type
bit 0 | 1

Returns: Promise‹this›


# writeWord

writeWord(command: number, word: number): Promise‹this›

Defined in src/lib/Device.ts:51

Parameters:

Name Type
command number
word number

Returns: Promise‹this›


# Static create

create(__namedParameters: object): Device

Defined in src/lib/Device.ts:87

Parameters:

__namedParameters: object

Name Type
address number
bus Bus‹›

Returns: Device