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

Driver for the Sensortag OPT-3001 light sensor. More...

#include "contiki.h"
#include "lib/sensors.h"
#include "sys/ctimer.h"
#include "dev/i2c-arch.h"
#include "board-conf.h"
#include "opt-3001-sensor.h"
#include <Board.h>
#include <ti/drivers/I2C.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define CFG_RN   0x00F0
 [15..12] Range Number
 
#define CFG_CT   0x0008
 [11] Conversion Time
 
#define CFG_M   0x0006
 [10..9] Mode of Conversion
 
#define CFG_OVF   0x0001
 [8] Overflow
 
#define CFG_CRF   0x8000
 [7] Conversion Ready Field
 
#define CFG_FH   0x4000
 [6] Flag High
 
#define CFG_FL   0x2000
 [5] Flag Low
 
#define CFG_L   0x1000
 [4] Latch
 
#define CFG_POL   0x0800
 [3] Polarity
 
#define CFG_ME   0x0400
 [2] Mask Exponent
 
#define CFG_FC   0x0300
 [1..0] Fault Count
 

Functions

static bool sensor_enable (bool enable)
 Turn the sensor on/off.
 
static void notify_ready_cb (void *unused)
 Callback when sensor is ready to read data from.
 
static int value (int type)
 Returns a reading from the sensor.
 
static int configure (int type, int enable)
 Configuration function for the OPT3001 sensor.
 
static int status (int type)
 Returns the status of the sensor.
 

Detailed Description

Driver for the Sensortag OPT-3001 light sensor.

Author
Edvard Pettersen e.pet.nosp@m.ters.nosp@m.en@ti.nosp@m..com

Definition in file opt-3001-sensor.c.