open-index/open-npm huggingface dataset:
npm package: @johntalton/mb85
Description: Simple wrapper around i2c (i2c-bus) impl. to provide basic buffer read/write command.
Author: johntalton@gmail.com
Latest version: 2.0.5

# Fujitsu MB85 FRAM 

Simple wrapper around i2c (i2c-bus) impl. to provide basic buffer read/write command.

[![npm Version](https://img.shields.io/npm/v/@johntalton/mb85.svg)](https://www.npmjs.com/package/@johntalton/mb85)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/mb85)
![CI](https://github.com/johntalton/mb85/workflows/CI/badge.svg?branch=master&event=push)
![GitHub](https://img.shields.io/github/license/johntalton/mb85)
[![Downloads Per Month](https://img.shields.io/npm/dm/@johntalton/mb85.svg)](https://www.npmjs.com/package/@johntalton/mb85)
![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/mb85)


## Devcie ID
The provided library is also provides a way of identifying a chip based on its assigned Id value.

This can be passed in, however, it becomes more usefull with the bus level `deviceId` call.  This uses a bus level discovery not supported by most chips.  By using this method, the chips feature inforamtion can detected.

```javascript
const i2c = require('i2c-bus')
const { I2CAddressedBus } = require('@johntalton/and-other-delights')
const { MB85RC, DEFAULT_MB85_ADDRESS } = require('@johntalton/mb85')

const busNumber = 1
const busAddress = DEFAULT_MB85_ADDRESS // 0x50

const bus1 = await i2c.openPromisified(busNumber)
const id = await bus1.deviceId()
const ab = new I2CAddressedBus(bus1, busAddress)
const fram = MB85RC.from(ab, id)

console.log('Fujitsu FRAM MB85', fram.busHuman, fram.densityHuman, fram.featuresHuman)
// Fujitsu FRAM MB85 RC 256K V

```
npm package: @johntalton/mcp23
Description: A Feature rich general I/O chip available in single port (8-bit) and dual port (16-bit) packages.
Latest version: 6.0.3

# Microchip I/O Expander

A Feature rich general I/O chip available in single port (8-bit) and dual port (16-bit) packages.

[![npm Version](http://img.shields.io/npm/v/@johntalton/mcp23.svg)](https://www.npmjs.com/package/@johntalton/mcp23)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/mcp23)
[![CI](https://github.com/johntalton/mcp23/actions/workflows/CI.yaml/badge.svg)](https://github.com/johntalton/mcp23/actions/workflows/CI.yaml)

## Banks and sequential mode

The chip has four operational mode in which registers can be read/written.

- Interlaced Block
- Dual Block
- 8-bit Poll
- 16-bit Poll

The library exposes methods that are specific for each mode, and is the callers responsibility to validate mode settings. This affords reduced call overhead (no validation of mode) when operation are done in a stable mode environment.


# Example

```javascript
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { MCP23, MODE, PORT, DIRECTION } form '@johntalton/mcp23'

const bus = /* I2CBus implementation of your choice */
const aBus = new I2CAddressedBus(bus, 0x20)
const device = new MCP23(aBus)

const mode = MODE.DUAL_BLOCK // bank: 1, sequential: true
const port = PORT.A
const direction = await device.getDirection(mode, port)

// test if portA pin 0 is an Output
const isA0Output = direction[0] === DIRECTION.OUT


```
```javascript
// ...
// some things can only be done in specific modes
// first switch to that mode from the existing mode
const existingIOControl = await device.getControl(existingMode)
const newMode = MODE.POLL_16_BIT

await device.setControl(existingMode, {
  ...existingIOControl,
  mode: newMode
})

// existingMode is now invalid, and the device is in the newMode
// now polling 16 bit register can be done efficiently
const flags = await device.getInterruptFlags(newMode)


```
npm package: @johntalton/ndef
Description: ![CI](https://github.com/johntalton/st25dv/workflows/CI/badge.svg)
Latest version: 1.0.3

# NDEF

![CI](https://github.com/johntalton/st25dv/workflows/CI/badge.svg)

NDEF encode and decode library.

Follows [Web NFC](https://w3c.github.io/web-nfc) Spec conventions.

With support for Capability Container and Type 5 wrapper objects.

## Encoder / Decoder

The Web NFC spec describes two basic format/class structures when working with NDEF - `NDEFMessage` and `NDEFRecord`.

A Message is a wrapper type for a list of records.

Each record represents an object having `recordType` and `data` properties (as well as other depending on type).

There are a wide range of "Well Known" record types supported.

## Common recordTypes

In most case the `data` field of the record is an `ArrayBuffer` or `ArrayBufferView` (aka `Uint8Array`). However, some well know types are parsed for the user.

- `'empty'`
- `'url'` - data is URL string
- `'text'`
- `'smart-poster'` - data is `NDEFMessage` call `toRecords` to iterate or access data directly to parse in application space.
- `'mime'` - `mediaType` contains further information about data
- `'absolute-url'` - data is a URL string
- `'unknown'`


## Example Decoding with CC wrapper

```javascript
import { CapabilityContainer } from '@johntalton/ndef'

// see st25dv https://github.com/johntalton/st25dv for init
const st25dv = new ST25DVUser(/* ... */)

 // read 64 bytes starting at offset 0
const buffer = await st25dv.readMemory(0, 64)

const cc = CapabilityContainer.decode(buffer)
for(const record of cc.message.records) {
  const { recordType, id, data } = record

  console.log('id:', id)
  console.log('recordType:', recordType)
  if(recordType === 'mime' && record.mediaType === 'application/json') {
    const decoder = new TextDecoder()
    const json = JSON.parse(decoder.decode(data))
  }
  else {
    // do other stuff
  }
}

```

## Example Encoding without CC

```javascript
import { NDEFMessageEncoder, CONTEXT_ROOT } from '@johntalton/ndef'

const buffer = NDEFMessageEncoder.encode({
  records: [
    {
      recordType: 'url',
      data: 'https://github.com/johntalton/ndef'
    },
    {
      recordType: 'text',
      data: 'NDEF library in JS'
    },
  ]
}, CONTEXT_ROOT, 0)

// do something with buffer ...

```

## Capability Container & Type 5 Tag

Included in this library is an implementation of the CC/T5T wrapper format needed to write NDEF Message onto a device (such as the [st25dv](https://github.com/johntalton/st25dv))

The `CapabilityContainer` provides a `encode`/`decode` that will account for the TLV (Type Length Value) container as well as the devices CCFile.

`CapabilityContainer` provides access to permissions for `read` and `write` as well as the root `NDEFMessage` via `message`.

(This has limited testing beyond above mentioned st25dv device and basic memory layout - feedback welcome :P)
npm package: @johntalton/pca9536
Description: Single Port I²C GPIO Expander with four pins.
Author: johntalton@gmail.com
Latest version: 1.0.3

# pca9536

Single Port I²C GPIO Expander with four pins.

[![npm Version](http://img.shields.io/npm/v/@johntalton/pca9536.svg)](https://www.npmjs.com/package/@johntalton/pca9536)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/pca9536)
[![CI](https://github.com/johntalton/pca9536/actions/workflows/CI.yml/badge.svg)](https://github.com/johntalton/pca9536/actions/workflows/CI.yml)


# Usage / Example

Setting the profile for any pin must set the entire Port (4 pins).

It is common to read the settings and write them back modified, however, care must be taken with the approach when other actions can exist on the bus.

```javascript
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { PCA9536, DIRECTION, SET, CLEAR } from '@johntalton/pca9536'

const bus = /* ... */
const device = new PCA9536(new I2CAddressedBus(bus, ))

await device.setConfiguration({
  gpio0: DIRECTION.OUTPUT,
  gpio1: DIRECTION.INPUT,
  gpio2: DIRECTION.INPUT,
  gpio3: DIRECTION.OUTPUT,
})

/*
set state of outputs the output gpios 0 and 3 (on and off respectively)
gpio 1 and 2 will float-high if not connected, set to "don't care"
*/
await device.setOutputPort({
  gpio0: SET,
  gpio1: CLEAR, // aka DONT_CARE
  gpio2: CLEAR, // aka DONT_CARE
  gpio3: CLEAR
})

const { gpio1, gpio2 } = await device.getInputPort()


```

Note that input polarity only effect when reading from the input port.

Users should take care when changing output port value or direction when connected to external IO.  The write of direction, polarity and value are all done as separate interactions.


## SparkX Quiic Power Switch

The [Sparkfun Power Switch](https://www.sparkfun.com/products/16740) uses the PCA9536 as its main component.  While GPIO1 and GPIO2 are free (and exposed on board), GPIO0 and GPIO3 are used for Main Power and I²C Isolation respectively.
npm package: @johntalton/pcf8523
Description: Feature rich Real Time Clock including Alarm and Timers.
Latest version: 2.2.2

# pcf8523 (Real Time Clock)

Feature rich Real Time Clock including Alarm and Timers.


[![npm Version](https://img.shields.io/npm/v/@johntalton/pcf8523.svg)](https://www.npmjs.com/package/@johntalton/pcf8523)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/pcf8523)
[![CI](https://github.com/johntalton/pcf8523/actions/workflows/CI.yml/badge.svg)](https://github.com/johntalton/pcf8523/actions/workflows/CI.yml)


# Examples
## Basic Time

Using the legacy `Date` object, the time can be set.

Note however, without enabling the proper Power Mode (aka, switch to battery when off line) this will only keep time while on main power.

It is also "recommended" to start/stop the oscillator when changing time (as well as most other time related parameters of the chip).

```typescript
import { I2CAddressedBus, I2CBus } from '@johntalton/and-other-delights'
import {
  PCF8523,
  DEFAULT_PCF8523_ADDRESS,
  BASE_CENTURY_Y2K
} from '@johntalton/pcf8523'

const bus:I2CBus = /* ... */
const abus = new I2CAddressedBus(bus, DEFAULT_PCF8523_ADDRESS)
const device = new PCF8523(abus)

// should we store the clock using 24 hour or 12 hour
const ampm_mode = false // 24-hour

// the chip only stores last 2 digits, using this as the base
const century = BASE_CENTURY_Y2K

// get some time ...
const now = new Date(Date.now())

// the time can be manually constructed, here we use a helper
const time = encodeTimeFromDate(now)
await device.setTime(time, ampm_mode, century)
```

## Update Control 1 Register (Stop Oscillator)

```typescript
const device = new PCF8523(/* ... see basic example */)

// fetch current control and then set with override value
const current = await device.getControl1()
await device.setControl1({
  ...current,
  stop: true
})
```

## Setting Power Mode
```typescript
const device = new PCF8523(/* ... see basic example */)

await device.setControl3({
  // enable power switchover mode (this enable fallback to battery)
  // use standard mode
  pmSwitchoverEnabled: true,
  pmDirectSwitchingEnabled: false,

  // enable detection of low battery events (see interrupt enable bellow trigger)
  pmBatteryLowDetectionEnabled: true,

  clearBatterSwitchoverFlag: true, // clear any existing switchover events

  // enable both battery events to trigger an interrupt
  batterySwitchoverInterruptEnabled: true,
  batteryLowInterruptEnabled: true,
})
```

# Interrupts

Support for multiple types of interrupts are supported.  Note that this is independent of the Flags set (control 2 and 3).  While multiple flags can be set, the chip has the ability to optionally expose those to the INT pin.

The Clock need to be disabled for interrupt pin to be valid.

The Second interrupt Flag will also only be enabled when the interrupt itself is enabled.

- Timer A
- Timer B
- Alarm
- Second timer
- Battery switch-over
- Battery low detection
- Clock offset correction pulse
npm package: @johntalton/pcf8574
Description: GPIO-like 8bit device with simplistic interface and interrupt support.
Author: johntalton@gmail.com
Latest version: 2.1.1

# PCF8574 ⚙️

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

[![npm Version](https://img.shields.io/npm/v/@johntalton/pcf8574.svg)](https://www.npmjs.com/package/@johntalton/pcf8574)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/PCF8574)
[![CI](https://github.com/johntalton/pcf8574/actions/workflows/CI.yml/badge.svg)](https://github.com/johntalton/pcf8574/actions/workflows/CI.yml)



## 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 says you should be. 🥳

# Example

```javascript
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { PCF8574, DEFAULT_ADDRESS } from '@johntalton/pcf8574'

const bus = /* some I2CBus */
const device = new PCF8574(new I2CAddressedBus(bus, DEFAULT_ADDRESS))

const { p0, p1, /* ..etc */. } = await device.readPort()


await device.writerPort({
  p2: true,
  p5: true
  // all other default false
})

```
npm package: @johntalton/si5351
Description: Clock Generator
Latest version: 1.0.1

# si5351

Clock Generator

[![npm Version](http://img.shields.io/npm/v/@johntalton/si5351.svg)](https://www.npmjs.com/package/@johntalton/si5351)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/si5351)
[![CI](https://github.com/johntalton/si5351/actions/workflows/CI.yml/badge.svg)](https://github.com/johntalton/si5351/actions/workflows/CI.yml)

# Example

```javascript
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import {
  SI5351,
  DEFAULT_ADDRESS,
  MULTI_SYNTH_SOURCE_SELECT,
  INPUT_SOURCE_SELECT,
  STRENGTH
} from '@johntalton/si5351'

const bus = /* some I2CBus implementation */
const aBus = new I2CAddressedBus(bus, DEFAULT_ADDRESS)
const device = new SI5351(aBus)

// get status
const {
  revisionId,
  systemInitializing,
  lossOfLockPLLB,
  lossOfLockPLLA,
  lossOfSignal
} = await device.getDeviceStatus()

// setup clock 2
await device.setClockControl(2, {
  powerDown: true,
  integerMode: true,
  multiSynthSourceSelect: MULTI_SYNTH_SOURCE_SELECT.PLLA,
  inverted: false,
  inputSourceSelect: INPUT_SOURCE_SELECT.CRYSTAL,
  strength: STRENGTH.DRIVE_4_MA
})

// set clock 2 enabled
await device.setOutputEnableControl({
  // ... other clock values too
  clock2: true
})

```
npm package: @johntalton/ssd1306
Description: OLED Display driver over [I2CBus](https://github.com/johntalton/and-other-delights) abstraction.
Latest version: 2.1.1

# SSD1306

OLED Display driver over [I2CBus](https://github.com/johntalton/and-other-delights) abstraction.

[![npm Version](https://img.shields.io/npm/v/@johntalton/ssd1306.svg)](https://www.npmjs.com/package/@johntalton/ssd1306)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/ssd1306)
[![CI](https://github.com/johntalton/ssd1306/actions/workflows/CI.yml/badge.svg)](https://github.com/johntalton/ssd1306/actions/workflows/CI.yml)


# Example

```javascript
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { SSD1306, ADDRESS_MODE } from '@johntalton/ssd1306'

const bus = /* I2CBus of your choosing */
const aBus = new I2CAddressedBus(bus, 0x3C)
const device = new SSD1306(aBus)

await device.setAddressMode(ADDRESS_MODE.HORIZONTAL)
await device.setChargePump(true)
await device.setDisplay(true)
await device.setContrastControl(64) // 0 - 255
```
npm package: @johntalton/sse-util
Description: A simple set of transformation functions to abstract away the sse protocol.
Author: johntalton@gmail.com
Latest version: 1.0.0

# Server Sent Events util

A simple set of transformation functions to abstract away the sse protocol.

[![npm Version](https://img.shields.io/npm/v/@johntalton/sse-util.svg)](https://www.npmjs.com/package/@johntalton/sse-util)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/sse-util)
![GitHub](https://img.shields.io/github/license/johntalton/sse-util)
[![Downloads Per Month](https://img.shields.io/npm/dm/@johntalton/sse-util.svg)](https://www.npmjs.com/package/@johntalton/sse-util)
![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/sse-util)

## API

Class `ServerSentEvents`
- `messageToEventStreamLines`
- `retryToEventStreamLine`
- `keepAliveToEventStreamLine`

#### `messageToEventStreamLines`
Core method that converts a `SSEMessage` into a set of Server Sent Event Lines.

```javascript
const lines = ServerSentEvents.messageToEventStreamLines({ id: 42, event: '🎁', data: ['i got you this'] })
// result lines array:
// [ "event: 🎁\n", "data: i got you this\n", "id: 42\n", "\n" ]
```


#### `retryToEventStreamLine`
Alias to `messageToEventStreamLines` that only returns the `retryMs` value and extracts the first line as a single `string`.

```javascript
// create a line to request the retry interval be set to 5 sec
const line = ServerSentEvents.retryToEventStreamLine(5 * 1000)
// result "retry: 5000\n"
```


#### `keepAliveToEventStreamLine`
Alias to `messageToEventStreamLines` that sets the comment and returns `string` line instread of and `Array` of lines.


## Docs
- [W3](https://www.w3.org/TR/eventsource/)
- [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
npm package: @johntalton/st25dv
Description: ![CI](https://github.com/johntalton/st25dv/workflows/CI/badge.svg)
Latest version: 1.2.1

# ST25DV

![CI](https://github.com/johntalton/st25dv/workflows/CI/badge.svg)

Dynamic NFC/RFID tag javascript driver over abstracted [`I2CBus`](https://github.com/johntalton/and-other-delights) implementation.

Obligatory [Adafruit](https://www.adafruit.com/product/4701)

## Multiple Address

The ST25DV presents on the bus as two (2) unique addresses (typically `0x53` and `0x57`).  This split corresponds to the devices "user" and "system" interaction spaces.

That is, to access the main persistent configuration settings the System area need to be accessed, while most operational command are in the user area.

This library provides both `ST25DVUser` and `ST25DVSystem` classes for abstracting those interactions (as well as a convenance `ST25DV` wrapper class).

The choice to allow setting and interacting with different classes with separate `I2CAddressedBus` abstraction is provided to allow for a range of configurations and interaction when the underlining `I2CBus` implementations may very.

## Example

### Direct system device access

The following example shows access to the System configuration area.

```javascript
const bus = /* I2CBus concrete from your choice of sources */
const abus = I2CAddressedBus.from(bus, DEFAULT_ST25DV_SYSTEM_ADDRESS)
const device = ST25DVSystem.from(abus)

const uid = await device.getUID()
```

### Wrapper class

Using the same example as above while utalizing teh wrapper `ST25DV` class

```javascript
const bus = /* again, some I2CBus, such as the MCP2221  */
const abusUser = I2CAddressedBus.from(bus, DEFAULT_ST25DV_USER_ADDRESS)
const abusSystem = I2CAddressedBus.from(bus, DEFAULT_ST25DV_SYSTEM_ADDRESS)
const device = ST25DV.from(abusUser, abusSystem)

const uid = await device.system.getUID()

```

## Password protected configuration

In order to write to the majority of the configuration, a I²C "password" must first be sent to the device to "open a secure session".  This can be configured for a range of configuration and user areas.
npm package: @johntalton/tca9548
Description: A simple, but effective, solution for I²C bus managment.
Author: johntalton@gmail.com
Latest version: 1.1.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# 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](https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout?view=all) as always.

[![npm Version](http://img.shields.io/npm/v/@johntalton/tca9548.svg)](https://www.npmjs.com/package/@johntalton/tca9548)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/tca9548)
![CI](https://github.com/johntalton/tca9548/workflows/CI/badge.svg?branch=master&event=push)
![GitHub](https://img.shields.io/github/license/johntalton/tca9548)
[![Downloads Per Month](http://img.shields.io/npm/dm/@johntalton/tca9548.svg)](https://www.npmjs.com/package/@johntalton/tca9548)
![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/tca9548)


## 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](examples/multibus.svg)

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](examples/multiplex.svg)

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.
npm package: @johntalton/tcs34725
Description: [![npm Version](http://img.shields.io/npm/v/@johntalton/tcs34725.svg)](https://www.npmjs.com/package/@johntalton/tcs34725) ![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/tcs34725) ![CI](https://github.com/johntalton
Author: johntalton@gmail.com
Latest version: 1.1.1

[![npm Version](http://img.shields.io/npm/v/@johntalton/tcs34725.svg)](https://www.npmjs.com/package/@johntalton/tcs34725)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/tcs34725)
![CI](https://github.com/johntalton/tcs34725/workflows/CI/badge.svg?branch=master&event=push)
![GitHub](https://img.shields.io/github/license/johntalton/tcs34725)
[![Downloads Per Month](http://img.shields.io/npm/dm/@johntalton/tcs34725.svg)](https://www.npmjs.com/package/@johntalton/tcs34725)
![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/tcs34725)

# tcs34725

TAOS Color-light sensor.

This sensor provides and RGB plus intensit result.  It can be accessed via the normal read process or via interrupts based on intensity thresholds.  A wide range of setting and features are exposed by this library.

[Adafruit ofcourse](https://www.adafruit.com/product/1334)

## API

### ```Tcs34725```

Primary interface method for accessing the sensor and factory for creating class instances.

example usage:

```javascript
const sensor = await Tcs34725.init(i2cbus);
const color = await sensor.data();
```

##### ```static init```

Pass and I2CBus compliant implementation as a parameter.
Returns a instance of this class.

##### ```close```

Closes the device and bus instance.

##### ```id```

Retrives the chips ID.

##### ```profile```

Retrives full profile, including status, from the chip.

##### ```status```

Retrives status flag, including ```thresholdViolation``` and ```valid```.

If ```thresholdViolation``` is true, then the chips clear channel has excided the


##### ```threshold```

Retrives the current set thresholds for interrupts.

##### ```setThreshold```

Sets new threshold values to be used for interrupt triggering.

##### ```setProfile```

Set a new profile for the chip.

##### ```clearInterrupt```

Manually clears the interrupt flag on the chip.  Note that if conditions for the interrupt continue to exists, the chip will imidiatly re-assert the interrupt flag.

##### ```data```

Retrives rag data from the chip and performes RGBC convertions.


# Interrupt

Interrupts are driven via a seperate Gpio driver ([onoff](../fivdi/onoff) is well tested).  Though any mechanisme of detection is supported.

Once an interrupt has been raised, clear it via normal read methods. Note that it will continue to be rased if the alert condition persists.

Thresholds can be updated via the `setThreshold` call.

Interrupt state can also be manually cleared via `clearInterrupt`.

# LED

Adafruit LED (breakout) supported also via gpio control.  The [onoff](../fivdi/onoff) library can be used to control this features.

No specific code is needed via this library to support this external feature.
npm package: @johntalton/tsl2591
Description: A light to digital converter, that has some bells and whistles.
Latest version: 1.0.2

# TSL2591

A light to digital converter, that has some bells and whistles.

[![npm Version](http://img.shields.io/npm/v/@johntalton/tsl2591.svg)](https://www.npmjs.com/package/@johntalton/tsl2591)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/tsl2591)
[![CI](https://github.com/johntalton/tsl2591/actions/workflows/CI.yml/badge.svg)](https://github.com/johntalton/tsl2591/actions/workflows/CI.yml)

# Example

```javascript
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { TSL2591, DEFAULT_ADDRESS } from '@johntalton/tsl2591'

const bus = /* byob */
const aBus = new I2CAddressedBus(bus, DEFAULT_ADDRESS)
const device = TSL2591.from(aBus)

await device.setProfile({ enable: true, powerOn: true })

const { ch0, ch1 } = await device.getColor()


```

Each channel represents the two analog sensors, full spectrum on `ch0` and inferred on `ch1`.  via magic, once and deduce the lux value.
npm package: @johntng/sidebar-generator
Description: A CLI tool to generate the _sidebar.md file for docsify directories recursively.
Author: John Tng
Latest version: 1.0.6

# sidebar-generator
This is a CLI tool to generate the _sidebar.md file for docsify directories recursively.  

To understand what is docsify, please refer to [docsify](https://docsify.js.org/#/).  
To understand why you need the sidebar-generator, please refer to [docsify sidebar](https://docsify.js.org/#/more-pages?id=sidebar).


# Installing and using

To install sidebar generator:
```
npm i @johntng/sidebar-generator
```

To uninstall:
```
npm un @johntng/sidebar-generator
```

To use the sidebar-generator, simply type in the folder you want to generate the _sidebar.md file:
```
sidebar-generator
```

If the '_sidebar.md' file already exist, you will be prompt to overwrite it:
```
? Do you want to overwrite the _sidebar.md file? (Use arrow keys)
❯ No 
  Yes 
```


# List of arguments

Run the cli with -h for more options

```
sidebar-generator -h
```

Output:
```
Options: 

Default options:
'depth' is 5
'sort' is off by default
'overwrite' is off by default

--help, -h 		 Display help.
--depth, -d [Number] 	 Set the depth of the directory to recursive to find *.md files.
			 Depth 0 means it will NOT recurse.
--sort, -s 		 Option to sort the the *.md files in alphabetical order.
--overwrite, -o 	 If this option is set, it will overwrite the _sidebar.md file if exist.
```
npm package: @johntravelertick/nguniversal-common
Description: Angular Universal common 
Latest version: 5.0.0-beta.5-john5

# Angular Universal Common Module

This is the common Angular Universal module that is common across server-side rendering app
irrespective of the rendering engine.

The package can be installed using:

`npm install @nguniversal/common --save`

## TransferHttpCacheModule

`TransferHttpCacheModule` installs a Http interceptor that avoids duplicate `HttpClient` requests
on the client, for requests that were already made when the application was rendered on the server
side.

When the module is installed in the application `NgModule`, it will intercept `HttpClient` requests
on the server and store the response in the `TransferState` key-value store. This is transferred to the client, which then uses it to respond to the same `HttpClient` requests on the client.

### Usage

To use the `TransferHttpCacheModule` just install it as part of the top-level App module.

That's it!

```ts
import {TransferHttpCacheModule} from '@nguniversal/common';

@NgModule({
  imports: [
    BrowserModule.withServerTransition({appId: 'my-app'}),
    TransferHttpCacheModule,
  ],
  bootstrap: [MyApp]
})
export class AppBrowserModule() {}
```