npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@johntalton/tca9548

v1.1.1

Published

A simple, but effective, solution for I²C bus managment.

Downloads

3

Readme

TCA9548

A simple, but effective, solution for I²C bus managment.

This package allows for direct and simple interaction with the channel (segment) selection API. It also provides a I2CBus implementation for creating an abstraction layer for compositing multi-bus multi-sensor deployments.

Adafruit as always.

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

Concept

The TCA provides a managment layer that exposes channels. Each channel is an I²C bus segment that can extends the host I²C bus. The managment layer allow for forking and joining these channels.

As such, zero or more channel can extend the host bus. Allowing for the host bus to address directly all connected devices to the unified channels.

Consider the following

Assume four sensor are connected to the TCA chip via channel 0 and 1, and each sensor label by it's address.

example bus layout

Using the above bus configuration, the following commands will describe and allow you to control the bus segments.

> node tune off
> i2cdetect
  0x10 0x70
> node tune 0
> i2cdetect
  0x1 0x2 0x10 0x70
> node tune 1
> i2cdetect
  0x3 0x4 0x10 0x70
> node tune 0 1
> i2cdetect
  0x1 0x2 0x3 0x4 0x10 0x70

Make note of the last multi channel tune call. Also the fact that 0x10 and 0x70 is always present from the host perspective as expected.

Overlapping static address multiplexing

A simple / common use case is to use the TCA to select from sensor that would nomraly share an address (and create errors on the I²C bus) by placing each on individual channels:

example bus layout

In such a configuration the tune command would exclusivly select each channel (never selecting more then one at a time), and the i2cdetect call would always return 0xA onto the host bus.

Some care is needed by calling application layer when managing and caching resourses as called from code addressing 0xA (in this example) will result in read/write on different sensors depending on the channel configuration.

Interoperability / Dependencies

This project aims to provide a common / abstract I²C bus implementation such that transparent sensor logic can be writen without knowledge of the bus layer.

Wrapper code for i2c-bus and onoff are well supported.