[riot-notifications] [RIOT-OS/RIOT] drivers/opt3001: Initial support for the Opt3001 sensor (#12260)

JannesVolkens notifications at github.com
Tue Sep 17 11:41:13 CEST 2019

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description

The TI OPT3001 (Ambient Light Sensor) measures the intensity of visible light with a spectral response comparable to the human eye, with simultaneous rejection of infrared light. The conversion time, mode of conversion and the interrupt reporting mechanism mode can be set by the sensor initialization. After initialization the raw sensor values can be read and converted to lux. 

The calculation for the ambient light is wrapped from TI OPT3001 Ambient Light Sensor (ALS) datasheet (Rev. C): [http://www.ti.com/lit/ds/symlink/opt3001.pdf](url)

Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

### Testing procedure

The driver was tested using the CC2650-launchpad and CC2650stk boards. A Test was written under `tests/driver_opt3001`. 

There are several options to configure the I2C-address. The default address is 0x44 and is obtained by connecting the ADDR Pin to GND. The address is set in `opt3001.h` in line 61:
`#define OPT3001_I2C_ADDRESS   (0x44)`

There are also two options to set the conversion time to 100 ms or 800 ms. The time is set in `opt3001.h` in line 79:

Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output

### Issues/PRs references


Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * driver/opt3001: Initial support
  * driver/opt3001: Saul implementation
  * driver: Correct Makefile.dep
  * driver/opt3001: Add doc

-- File Changes --

    M drivers/Makefile.dep (5)
    M drivers/Makefile.include (4)
    A drivers/include/opt3001.h (187)
    A drivers/opt3001/Makefile (3)
    A drivers/opt3001/include/opt3001_params.h (73)
    A drivers/opt3001/include/opt3001_regs.h (97)
    A drivers/opt3001/opt3001.c (194)
    A drivers/opt3001/opt3001_saul.c (48)
    M sys/auto_init/auto_init.c (4)
    A sys/auto_init/saul/auto_init_opt3001.c (76)
    A tests/driver_opt3001/Makefile (6)
    A tests/driver_opt3001/README.md (0)
    A tests/driver_opt3001/main.c (71)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190917/44427fb5/attachment.htm>

More information about the notifications mailing list