1.1.1 • Published 3 days ago

@johntalton/pcf8574 v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

PCF8574 ⚙️

npm Version GitHub package.json version CI GitHub Downloads Per Month GitHub last commit

GPIO-like 8bit device with simplistic interface and interrupt support.

Behavior

Unlike most GPIO, this chip considers the pin / port to be both input and output at the same time. This is achieved by tri-stating the pin, floating it, when set to LOW (0 / ground).

When set HIGH, the pin is driven to Vcc.

In both states, driven or not, the pins state can be read. With the LOW (floated) being of most interest.

Interrupt

When a pin is driven externally, not by setting it HIGH, the INT will be grounded (open drain). This style interrupt allows for a flexible, chainable, efficient interrupt implementations.

In this chips specific case, the interrupt will be be toggled based on the difference from last read state. That is, if the state changes from A to B, and back to A (ex: HIGH, LOW, HIGH)), then the interrupt will be self-cleared. Thus, late reads of the state may not reflect changes if not timely enough.

Other clear state are achieved by writing or reading to the chip. Both achieve clear the interrupt.

LED stuff

Apparently this chip has some benefit for driving LEDs. Much todo is given in the Datasheet about that. Make sure your using resistor where everyone on the internet sais you should be. 🥳