# Class: Bus

# Hierarchy

  • Bus

# Constructors

# constructor

+ new Bus(__namedParameters: object): Bus

Defined in src/lib/Bus.ts:10

Parameters:

__namedParameters: object

Name Type
busNumber number

Returns: Bus

# Properties

# busNumber

busNumber: number

Defined in src/lib/Bus.ts:8


# isOpen

isOpen: boolean = false

Defined in src/lib/Bus.ts:10

# Methods

# close

close(): Promise‹this›

Defined in src/lib/Bus.ts:35

Returns: Promise‹this›


# deviceId

deviceId(address: number): Promise‹number›

Defined in src/lib/Bus.ts:205

Parameters:

Name Type
address number

Returns: Promise‹number›


# i2cFuncs

i2cFuncs(): Promise‹I2cFuncs›

Defined in src/lib/Bus.ts:49

Returns: Promise‹I2cFuncs›


# i2cRead

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

Defined in src/lib/Bus.ts:169

Parameters:

Name Type
address number
length number
buffer Buffer

Returns: Promise‹I2cReadResponse›


# i2cWrite

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

Defined in src/lib/Bus.ts:181

Parameters:

Name Type
address number
length number
buffer Buffer

Returns: Promise‹I2cWriteResponse›


# open

open(): Promise‹this›

Defined in src/lib/Bus.ts:22

Returns: Promise‹this›


# readByte

readByte(address: number, command: number): Promise‹number›

Defined in src/lib/Bus.ts:61

Parameters:

Name Type
address number
command number

Returns: Promise‹number›


# readI2cBlock

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

Defined in src/lib/Bus.ts:85

Parameters:

Name Type
address number
command number
length number
buffer Buffer

Returns: Promise‹I2cReadResponse›


# readWord

readWord(address: number, command: number): Promise‹number›

Defined in src/lib/Bus.ts:73

Parameters:

Name Type
address number
command number

Returns: Promise‹number›


# receiveByte

receiveByte(address: number): Promise‹number›

Defined in src/lib/Bus.ts:97

Parameters:

Name Type
address number

Returns: Promise‹number›


# scan

scan(startAddress?: undefined | number, endAddress?: undefined | number): Promise‹number[]›

Defined in src/lib/Bus.ts:193

Parameters:

Name Type
startAddress? undefined | number
endAddress? undefined | number

Returns: Promise‹number[]›


# sendByte

sendByte(address: number, byte: number): Promise‹this›

Defined in src/lib/Bus.ts:109

Parameters:

Name Type
address number
byte number

Returns: Promise‹this›


# writeByte

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

Defined in src/lib/Bus.ts:121

Parameters:

Name Type
address number
command number
byte number

Returns: Promise‹this›


# writeI2cBlock

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

Defined in src/lib/Bus.ts:157

Parameters:

Name Type
address number
command number
length number
buffer Buffer

Returns: Promise‹I2cWriteResponse›


# writeQuick

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

Defined in src/lib/Bus.ts:145

Parameters:

Name Type
address number
bit 0 | 1

Returns: Promise‹this›


# writeWord

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

Defined in src/lib/Bus.ts:133

Parameters:

Name Type
address number
command number
word number

Returns: Promise‹this›


# Static create

create(__namedParameters: object): Bus

Defined in src/lib/Bus.ts:217

Parameters:

__namedParameters: object

Name Type
busNumber number

Returns: Bus


# Static createAndOpen

createAndOpen(__namedParameters: object): Promise‹Bus

Defined in src/lib/Bus.ts:221

Parameters:

__namedParameters: object

Name Type
busNumber number

Returns: Promise‹Bus