MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Enumerations | Functions
proximity_tsl2671.h File Reference

Communicates with the TSL2671 proximity detector. More...

#include "sensor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwProximityTsl2671Channel { MBL_MW_PROXIMITY_TSL2671_CHANNEL_0 = 1, MBL_MW_PROXIMITY_TSL2671_CHANNEL_1, MBL_MW_PROXIMITY_TSL2671_CHANNEL_BOTH }
 Photodiodes the detector should use for proximity detection. More...
 
enum  MblMwProximityTsl2671Current { MBL_MW_PROXIMITY_TSL2671_CURRENT_100mA = 0, MBL_MW_PROXIMITY_TSL2671_CURRENT_50mA, MBL_MW_PROXIMITY_TSL2671_CURRENT_25mA, MBL_MW_PROXIMITY_TSL2671_CURRENT_12_5mA }
 Amount of current driving the IR transmitter.
 

Functions

METAWEAR_API MblMwDataSignalmbl_mw_proximity_tsl2671_get_adc_data_signal (const MblMwMetaWearBoard *board)
 Retrieves the data signal representing ADC values for the light's colors. More...
 
METAWEAR_API void mbl_mw_proximity_tsl2671_set_integration_time (MblMwMetaWearBoard *board, float time)
 Sets the integration time. More...
 
METAWEAR_API void mbl_mw_proximity_tsl2671_set_n_pulses (MblMwMetaWearBoard *board, uint8_t n_pulses)
 Sets the pulse count. More...
 
METAWEAR_API void mbl_mw_proximity_tsl2671_set_receiver_channel (MblMwMetaWearBoard *board, MblMwProximityTsl2671Channel channel)
 Sets the photodiode that responds to light. More...
 
METAWEAR_API void mbl_mw_proximity_tsl2671_set_transmitter_current (MblMwMetaWearBoard *board, MblMwProximityTsl2671Current current)
 Sets the current driving the light transmitter. More...
 
METAWEAR_API void mbl_mw_proximity_tsl2671_write_config (const MblMwMetaWearBoard *board)
 Writes the configuration to the sensor. More...
 

Detailed Description

Communicates with the TSL2671 proximity detector.

Enumeration Type Documentation

◆ MblMwProximityTsl2671Channel

Photodiodes the detector should use for proximity detection.

Enumerator
MBL_MW_PROXIMITY_TSL2671_CHANNEL_0 

Use channel 0, which is responsive to infrared and visible light.

MBL_MW_PROXIMITY_TSL2671_CHANNEL_1 

Use channel 1, which is responsive to primarily infrared light.

MBL_MW_PROXIMITY_TSL2671_CHANNEL_BOTH 

Use both channel 0 and 1.

Function Documentation

◆ mbl_mw_proximity_tsl2671_get_adc_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_proximity_tsl2671_get_adc_data_signal ( const MblMwMetaWearBoard board)

Retrieves the data signal representing ADC values for the light's colors.

Parameters
boardBoard the sensor resides on
Returns
Pointer to the data signal

◆ mbl_mw_proximity_tsl2671_set_integration_time()

METAWEAR_API void mbl_mw_proximity_tsl2671_set_integration_time ( MblMwMetaWearBoard board,
float  time 
)

Sets the integration time.

Parameters
boardBoard to modify
timeNew integration time to use, between [2.72, 693.6] milliseconds

◆ mbl_mw_proximity_tsl2671_set_n_pulses()

METAWEAR_API void mbl_mw_proximity_tsl2671_set_n_pulses ( MblMwMetaWearBoard board,
uint8_t  n_pulses 
)

Sets the pulse count.

Sensitivity increase by the sqrt of pulse count.

Parameters
boardBoard to modify
n_pulsesNumber of pulses to use for proximity detection, between [1, 255]

◆ mbl_mw_proximity_tsl2671_set_receiver_channel()

METAWEAR_API void mbl_mw_proximity_tsl2671_set_receiver_channel ( MblMwMetaWearBoard board,
MblMwProximityTsl2671Channel  channel 
)

Sets the photodiode that responds to light.

Parameters
boardBoard to modify
channelNew receiver channel to use

◆ mbl_mw_proximity_tsl2671_set_transmitter_current()

METAWEAR_API void mbl_mw_proximity_tsl2671_set_transmitter_current ( MblMwMetaWearBoard board,
MblMwProximityTsl2671Current  current 
)

Sets the current driving the light transmitter.

For boards powered by the CR2032 battery, it is recommended that the current be 25mA or less.

Parameters
boardBoard to modify
currentNew driver current to use

◆ mbl_mw_proximity_tsl2671_write_config()

METAWEAR_API void mbl_mw_proximity_tsl2671_write_config ( const MblMwMetaWearBoard board)

Writes the configuration to the sensor.

Parameters
boardBoard the sensor resides on