Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MCP23S08

Hierarchy

  • MCP23S08

Implements

Index

Constructors

constructor

  • Returns MCP23S08

Properties

csPin

io0

io1

io2

io3

io4

io5

io6

io7

keys

keys: string[]

params

params: any

readSlaveAddress

readSlaveAddress: number

requiredKeys

requiredKeys: string[]

writeSlaveAddress

writeSlaveAddress: number

Methods

flush

  • flush(type?: string): void
  • Parameters

    • Default value type: string = "gpio"

    Returns void

flushWait

  • flushWait(type?: string): Promise<void>
  • Parameters

    • Default value type: string = "gpio"

    Returns Promise<void>

initWait

  • initWait(): Promise<void>
  • Initialize all ios. set direction=input.

    Returns Promise<void>

inputWait

  • inputWait(id: number): Promise<boolean>
  • Read current all GPIO value and return single io value.

    Parameters

    • id: number

      io 0-7

    Returns Promise<boolean>

    GPIO value

output

  • output(id: number, value: boolean): void
  • set output value for io. It will apply immidiately. This function never change direction. set direction output before. If you want to hold some changes and flush once.

    use following examle steps
    this.io0.value = true;
    this.io1.value = true;
    this.flush("gpio");

    Parameters

    • id: number

      io address. 0-7

    • value: boolean

      boolean. true or false

    Returns void

outputWait

  • outputWait(id: number, value: boolean): Promise<void>
  • async version of output();

    Parameters

    • id: number
    • value: boolean

    Returns Promise<void>

readAllGPIOWait

  • readAllGPIOWait(): Promise<void>
  • Read current all GPIO value.

    Returns Promise<void>

readWait

  • readWait(address: number): Promise<number>
  • Read byte from address

    Parameters

    • address: number

      internal register address

    Returns Promise<number>

    readed value of address

wired

  • wired(obniz: Obniz): void
  • Parameters

    Returns void

write

  • write(address: number, data: number): void
  • Write byte to address without wait.

    Parameters

    • address: number

      internal register address

    • data: number

    Returns void

writeBulkWait

  • writeBulkWait(address: number, data: number[]): Promise<void>
  • Bulk write to addresses

    Parameters

    • address: number

      start address

    • data: number[]

    Returns Promise<void>

writeWait

  • writeWait(address: number, data: number): Promise<void>
  • Write byte to address. It will wait until success response receive

    Parameters

    • address: number

      internal register address

    • data: number

    Returns Promise<void>

Static info

  • Returns ObnizPartsInfo

Object literals

Static MCP23S08_IO_DIRECTION

MCP23S08_IO_DIRECTION: object

INPUT

INPUT: boolean = true

OUTPUT

OUTPUT: boolean = false

Static MCP23S08_REGISTER

MCP23S08_REGISTER: object

DEFVAL

DEFVAL: number = 3

GPINTEN

GPINTEN: number = 2

GPIO

GPIO: number = 9

GPPU

GPPU: number = 6

INTCAP

INTCAP: number = 8

INTCON

INTCON: number = 4

INTF

INTF: number = 7

IOCON

IOCON: number = 5

IODIR

IODIR: number = 0

IPOL

IPOL: number = 1

OLAT

OLAT: number = 10

Generated using TypeDoc