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

Functions for interacting with the LTR329 ambient light sensor. More...

#include "sensor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwAlsLtr329Gain {
  MBL_MW_ALS_LTR329_GAIN_1X = 0, MBL_MW_ALS_LTR329_GAIN_2X, MBL_MW_ALS_LTR329_GAIN_4X, MBL_MW_ALS_LTR329_GAIN_8X,
  MBL_MW_ALS_LTR329_GAIN_48X, MBL_MW_ALS_LTR329_GAIN_96X
}
 Controls the range and resolution of illuminance values. More...
 
enum  MblMwAlsLtr329IntegrationTime {
  MBL_MW_ALS_LTR329_TIME_100ms = 0, MBL_MW_ALS_LTR329_TIME_50ms, MBL_MW_ALS_LTR329_TIME_200ms, MBL_MW_ALS_LTR329_TIME_400ms,
  MBL_MW_ALS_LTR329_TIME_150ms, MBL_MW_ALS_LTR329_TIME_250ms, MBL_MW_ALS_LTR329_TIME_300ms, MBL_MW_ALS_LTR329_TIME_350ms
}
 Measurement time for each cycle. More...
 
enum  MblMwAlsLtr329MeasurementRate {
  MBL_MW_ALS_LTR329_RATE_50ms = 0, MBL_MW_ALS_LTR329_RATE_100ms, MBL_MW_ALS_LTR329_RATE_200ms, MBL_MW_ALS_LTR329_RATE_500ms,
  MBL_MW_ALS_LTR329_RATE_1000ms, MBL_MW_ALS_LTR329_RATE_2000ms
}
 How frequently to update the illuminance data. More...
 

Functions

METAWEAR_API MblMwDataSignalmbl_mw_als_ltr329_get_illuminance_data_signal (const MblMwMetaWearBoard *board)
 Retrieves the data signal representing LTR329 illuminance data. More...
 
METAWEAR_API void mbl_mw_als_ltr329_set_gain (MblMwMetaWearBoard *board, MblMwAlsLtr329Gain gain)
 Sets the sensor gain. More...
 
METAWEAR_API void mbl_mw_als_ltr329_set_integration_time (MblMwMetaWearBoard *board, MblMwAlsLtr329IntegrationTime integration_time)
 Sets the sensor integration time. More...
 
METAWEAR_API void mbl_mw_als_ltr329_set_measurement_rate (MblMwMetaWearBoard *board, MblMwAlsLtr329MeasurementRate measurement_rate)
 Sets the sensor measurement rate. More...
 
METAWEAR_API void mbl_mw_als_ltr329_write_config (const MblMwMetaWearBoard *board)
 Writes the configuration to the LTR329 sensor. More...
 
METAWEAR_API void mbl_mw_als_ltr329_start (const MblMwMetaWearBoard *board)
 Starts illuminance sampling. More...
 
METAWEAR_API void mbl_mw_als_ltr329_stop (const MblMwMetaWearBoard *board)
 Stops illuminance sampling. More...
 

Detailed Description

Functions for interacting with the LTR329 ambient light sensor.

This sensor is only available on MetaWear RPro boards.

Enumeration Type Documentation

◆ MblMwAlsLtr329Gain

Controls the range and resolution of illuminance values.

Enumerator
MBL_MW_ALS_LTR329_GAIN_1X 

Illuminance range between [1, 64k] lux (default)

MBL_MW_ALS_LTR329_GAIN_2X 

Illuminance range between [0.5, 32k] lux.

MBL_MW_ALS_LTR329_GAIN_4X 

Illuminance range between [0.25, 16k] lux.

MBL_MW_ALS_LTR329_GAIN_8X 

Illuminance range between [0.125, 8k] lux.

MBL_MW_ALS_LTR329_GAIN_48X 

Illuminance range between [0.02, 1.3k] lux.

MBL_MW_ALS_LTR329_GAIN_96X 

Illuminance range between [0.01, 600] lux.

◆ MblMwAlsLtr329IntegrationTime

Measurement time for each cycle.

Enumerator
MBL_MW_ALS_LTR329_TIME_100ms 

Default setting.

◆ MblMwAlsLtr329MeasurementRate

How frequently to update the illuminance data.

Enumerator
MBL_MW_ALS_LTR329_RATE_500ms 

Default setting.

Function Documentation

◆ mbl_mw_als_ltr329_get_illuminance_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_als_ltr329_get_illuminance_data_signal ( const MblMwMetaWearBoard board)

Retrieves the data signal representing LTR329 illuminance data.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's LTR329 illuminance data signal

◆ mbl_mw_als_ltr329_set_gain()

METAWEAR_API void mbl_mw_als_ltr329_set_gain ( MblMwMetaWearBoard board,
MblMwAlsLtr329Gain  gain 
)

Sets the sensor gain.

Parameters
boardPointer to the board to modify
gainSensor gain value to set

◆ mbl_mw_als_ltr329_set_integration_time()

METAWEAR_API void mbl_mw_als_ltr329_set_integration_time ( MblMwMetaWearBoard board,
MblMwAlsLtr329IntegrationTime  integration_time 
)

Sets the sensor integration time.

Parameters
boardPointer to the board to modify
integration_timeIntegration time value to set

◆ mbl_mw_als_ltr329_set_measurement_rate()

METAWEAR_API void mbl_mw_als_ltr329_set_measurement_rate ( MblMwMetaWearBoard board,
MblMwAlsLtr329MeasurementRate  measurement_rate 
)

Sets the sensor measurement rate.

Parameters
boardPointer to the board to modify
measurement_rateMeasurement rate value to set

◆ mbl_mw_als_ltr329_start()

METAWEAR_API void mbl_mw_als_ltr329_start ( const MblMwMetaWearBoard board)

Starts illuminance sampling.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_als_ltr329_stop()

METAWEAR_API void mbl_mw_als_ltr329_stop ( const MblMwMetaWearBoard board)

Stops illuminance sampling.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_als_ltr329_write_config()

METAWEAR_API void mbl_mw_als_ltr329_write_config ( const MblMwMetaWearBoard board)

Writes the configuration to the LTR329 sensor.

Parameters
boardPointer to the board to send the command to