Contiki-NG
Loading...
Searching...
No Matches

Driver for the TSL256X sensor. More...

Files

file  arch/platform/zoul/dev/tsl256x.c
 Driver for the external TSL256X light sensor.
file  arch/platform/zoul/dev/tsl256x.h
 Header file for the external TSL256X Sensor Driver.

Functions

static uint16_t calculate_lux (uint8_t *buf)

TSL256X convertion and calibration values

#define LUX_SCALE   14
 scale by 2^14
#define RATIO_SCALE   9
 scale ratio
#define CH_SCALE   10
 scale channel values by 2^10
#define CHSCALE_TINT0   0x7517
 322/11 * 2^CH_SCALE
#define CHSCALE_TINT1   0x0fe7
 322/81 * 2^CH_SCALE

Detailed Description

Driver for the TSL256X sensor.

The TSL256X driver returns the converted light value value in lux

Function Documentation

◆ calculate_lux()

uint16_t calculate_lux ( uint8_t * buf)
static

< scale channel values by 2^10

< 322/81 * 2^CH_SCALE

< 322/11 * 2^CH_SCALE

< scale channel values by 2^10

< scale channel values by 2^10

< scale channel values by 2^10

< scale by 2^14

< scale by 2^14

Definition at line 68 of file tsl256x.c.

References CH_SCALE, CHSCALE_TINT0, CHSCALE_TINT1, and LUX_SCALE.