Code Monkey home page Code Monkey logo

si114x-spin's Introduction

si114x-spin


This is a P8X32A/Propeller driver object for the Silicon Labs Si114x (5, 6, 7) series UV/Proximity/Ambient light sensors.

IMPORTANT: This software is meant to be used with the spin-standard-library (P8X32A) or p2-spin-standard-library (P2X8C4M64P). Please install the applicable library first before attempting to use this code, otherwise you will be missing several files required to build the project.

Salient Features

  • I2C connection at up to 3.4MHz (tested at 400kHz)
  • Read ambient light sensor (IR, Visible) raw data
  • Read Auxiliary and UV data channels (UV index unverified)
  • Flags indicating measurement overflow for IR and visible light sensors
  • One-shot and continuous measurement modes
  • Set IR and Visible light sensor gains
  • Set custom UV index calibration coefficients
  • Measure illuminance, in lux

Requirements

P1/SPIN1:

  • spin-standard-library
  • 1 extra core/cog for the PASM I2C engine

P2/SPIN2:

  • p2-spin-standard-library

Compiler Compatibility

Processor Language Compiler Backend Status
P1 SPIN1 FlexSpin (6.9.4) Bytecode OK
P1 SPIN1 FlexSpin (6.9.4) Native/PASM OK
P2 SPIN2 FlexSpin (6.9.4) NuCode Untested
P2 SPIN2 FlexSpin (6.9.4) Native/PASM2 OK

(other versions or toolchains not listed are not supported, and may or may not work)

Limitations

  • Very early in development - may malfunction, or outright fail to build
  • Doesn't support proximity sensor function
  • Doesn't support alternate slave address usage/programming
  • Doesn't support temp sensor/Vdd/Vss reading (not currently planned)
  • Measurement calibration/correction/calculation unverified

si114x-spin's People

Contributors

avsa242 avatar

Watchers

 avatar  avatar  avatar

si114x-spin's Issues

Add support for setting IR LED current

The current drive of the IR LED can be controlled variably. The settings don't seem to be exactly the same across all models though. For instance, the LED2_I field in PS_LED21 must be set to zero on an Si1145. LED3_I (PS_LED3) must be set to zero for both 1145 and 1146.

Add support for interrupts

The chip supports interrupts for proximity sensing as well as ambient light sensing. The external INT pin drive can also be toggled on and off.

Redefine MeasureRate() parameter

The parameter should be Hz (shortest timescale is 31.25uS, or 32kHz rate, longest is 2047969uS, or 0.488Hz).
The method should also be renamed to something along the lines of DataRate(), to keep consistent with other drivers.

Add ALS demo

The chip can be used for ambient light sensing as well. Demonstrate this capability.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.