Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GPIO

Hierarchy

  • GPIOPort
    • GPIO

Index

Constructors

constructor

  • new GPIO(portNumber: number): GPIO
  • Parameters

    • portNumber: number

    Returns GPIO

Properties

onchange

onchange: undefined | GPIOChangeEventHandler

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Accessors

direction

  • get direction(): DirectionMode
  • Returns DirectionMode

exported

  • get exported(): boolean
  • Returns boolean

pinName

  • get pinName(): string
  • Returns string

portName

  • get portName(): string
  • Returns string

portNumber

  • get portNumber(): number
  • Returns number

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

export

  • export(direction: DirectionMode): Promise<void>
  • Parameters

    • direction: DirectionMode

    Returns Promise<void>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

on

  • on(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

once

  • once(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

read

removeAllListeners

  • removeAllListeners(event?: string | symbol): GPIO
  • Parameters

    • Optional event: string | symbol

    Returns GPIO

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): GPIO
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns GPIO

setMaxListeners

  • setMaxListeners(n: number): GPIO
  • Parameters

    • n: number

    Returns GPIO

unexport

  • unexport(): Promise<void>
  • Returns Promise<void>

write

Static getEventListener

  • getEventListener(emitter: DOMEventTarget | EventEmitter, name: string | symbol): Function[]
  • Returns a list listener for a specific emitter event name.

    Parameters

    • emitter: DOMEventTarget | EventEmitter
    • name: string | symbol

    Returns Function[]

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string
    • Optional options: StaticEventEmitterOptions

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string, options?: StaticEventEmitterOptions): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol
    • Optional options: StaticEventEmitterOptions

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string
    • Optional options: StaticEventEmitterOptions

    Returns Promise<any[]>

Generated using TypeDoc