Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MCP23017

Hierarchy

  • MCP23017

Index

Constructors

constructor

  • new MCP23017(bus: BusInterface, __namedParameters?: object): MCP23017
  • Parameters

    • bus: BusInterface
    • Default value __namedParameters: object = {}
      • address: number
      • separate: boolean

    Returns MCP23017

Methods

handle

init

  • init(): Promise<void>

read

  • read(): Promise<number>
  • Reads the GPIO

    Returns Promise<number>

    the value of the GPIO Pin in a promise.

readConfigByte

  • readConfigByte(): Promise<number>
  • Reads the configuration byte of the chip

    Returns Promise<number>

    the value of the configuration as a byte in a promise.

register

setDirection

  • setDirection(pins: number, direction: Direction): Promise<void>
  • Sets the direction of a set of GPI/O pins and eventually pull-up status.

    Parameters

    Returns Promise<void>

    a promisse fullfilled when the operation is performed.

setPolarity

  • setPolarity(pins: number): Promise<void>
  • Set the polarity of the output (ie XOR with it)

    Parameters

    • pins: number

    Returns Promise<void>

setSeparate

  • setSeparate(separate: boolean): Promise<void>
  • Change the way register banks are organize.

    Parameters

    • separate: boolean

    Returns Promise<void>

    a promisse fullfilled when the operation is performed.

write

  • write(set: number, unset: number): Promise<void>
  • Modify the GPIO

    Parameters

    • set: number
    • unset: number

    Returns Promise<void>

Generated using TypeDoc