Library for the MAX44000 Ambient Light Sensor / Proximity Detector
Dependents: LED_Demo LED_Demo2 LED_Demo
Fork of BMP180 by
MAX44000 Device Driver
Diff: MAX44000.h
- Revision:
- 2:91f97c274e89
- Parent:
- 1:1a770989adcb
diff -r 1a770989adcb -r 91f97c274e89 MAX44000.h
--- a/MAX44000.h Wed May 04 15:47:32 2016 +0000
+++ b/MAX44000.h Wed May 04 18:03:38 2016 +0000
@@ -37,7 +37,7 @@
#include "mbed.h"
/**
- * Bosch MAX44000 Digital Pressure Sensor
+ * MAX44000 Ambient Light and Infrared Proximity Sensor
*
* @code
* #include <stdio.h>
@@ -88,22 +88,22 @@
* @details Enumerated MAX44000 register addresses
*/
typedef enum {
- REG_STATUS, // Interrupt Status
- REG_MAIN_CONFIG, // Main Configuration
- REG_RX_CONFIG, // Receive Configuration
- REG_TX_CONFIG, // Transmit Configuration
- REG_ALS_DATA_HIGH, // ADC High Byte (ALS)
- REG_ALS_DATA_LOW, // ADC Low Byte (ALS)
- REG_ALS_UPTHR_HIGH, // ALS Upper Threshold (High Byte)
- REG_ALS_UPTHR_LOW, // ALS Upper Threshold (Low Byte)
- REG_ALS_LOTHR_HIGH, // ALS Lower Threshold (High Byte)
- REG_ALS_LOTHR_LOW, // ALS Lower Threshold (Low Byte)
- REG_PST, // Threshold Persist Timer
- REG_PRX_IND, // PROX Threshold Indicator
- REG_PRX_THR, // PROX Threshold
- REG_TRIM_GAIN_GREEN,// Digital Gain Trim of Green Channel
- REG_TRIM_GAIN_IR = 0x0F, // Digital Gain Trim of Infrared Channel
- REG_PRX_DATA = 0x16 // ADC Byte (PROX)
+ REG_STATUS, ///< Interrupt Status
+ REG_MAIN_CONFIG, ///< Main Configuration
+ REG_RX_CONFIG, ///< Receive Configuration
+ REG_TX_CONFIG, ///< Transmit Configuration
+ REG_ALS_DATA_HIGH, ///< ADC High Byte (ALS)
+ REG_ALS_DATA_LOW, ///< ADC Low Byte (ALS)
+ REG_ALS_UPTHR_HIGH, ///< ALS Upper Threshold (High Byte)
+ REG_ALS_UPTHR_LOW, ///< ALS Upper Threshold (Low Byte)
+ REG_ALS_LOTHR_HIGH, ///< ALS Lower Threshold (High Byte)
+ REG_ALS_LOTHR_LOW, ///< ALS Lower Threshold (Low Byte)
+ REG_PST, ///< Threshold Persist Timer
+ REG_PRX_IND, ///< PROX Threshold Indicator
+ REG_PRX_THR, ///< PROX Threshold
+ REG_TRIM_GAIN_GREEN, ///< Digital Gain Trim of Green Channel
+ REG_TRIM_GAIN_IR = 0x0F, ///< Digital Gain Trim of Infrared Channel
+ REG_PRX_DATA = 0x16 ///< ADC Byte (PROX)
} registers_t;
@@ -112,14 +112,14 @@
* @details Enumerated MAX44000 operating modes
*/
typedef enum {
- MODE_SHUTDOWN, // Analog circuits are shut down, but the digital register retains values
- MODE_ALS_GMIR, // Standard ALS mode, stores difference between green and IR channels
- MODE_ALS_G, // ALS green channel only
- MODE_ALS_IR, // Infrared channel only
- MODE_ALS_PROX, // ALS and PROX are interleaved continuously
- MODE_PROX, // PROX only
- MODE_RSVD_110, // Reserved, do not use
- MODE_RSVD_111 // Reserved, do not use
+ MODE_SHUTDOWN, ///< Analog circuits are shut down, but the digital register retains values
+ MODE_ALS_GMIR, ///< Standard ALS mode, stores difference between green and IR channels
+ MODE_ALS_G, ///< ALS green channel only
+ MODE_ALS_IR, ///< Infrared channel only
+ MODE_ALS_PROX, ///< ALS and PROX are interleaved continuously
+ MODE_PROX, ///< PROX only
+ MODE_RSVD_110, ///< Reserved, do not use
+ MODE_RSVD_111 ///< Reserved, do not use
} modes_t;
@@ -128,10 +128,10 @@
* @details MAX44000 Ambient Light Sensor ADC Conversion Time
*/
typedef enum {
- ALSTIM_1X, // 100ms, 16,384 counts, 14 bit resolution
- ALSTIM_4X, // 25ms, 4096 counts, 12 bit resolution
- ALSTIM_16X, // 6.25ms, 1024 counts, 10 bit resolution
- ALSTIM_64X // 1.5625ms, 256 counts, 8 bit resolution
+ ALSTIM_1X, ///< 100ms, 16,384 counts, 14 bit resolution
+ ALSTIM_4X, ///< 25ms, 4096 counts, 12 bit resolution
+ ALSTIM_16X, ///< 6.25ms, 1024 counts, 10 bit resolution
+ ALSTIM_64X ///< 1.5625ms, 256 counts, 8 bit resolution
} alstim_t;
@@ -139,10 +139,10 @@
* alspga_t - MAX44000 Ambient Light Measurement Gain
*/
typedef enum {
- ALSPGA_1X, // 0.03125 lux/lsb
- ALSPGA_4X, // 0.125 lux/lsb
- ALSPGA_16X, // 0.5 lux/lsb
- ALSPGA_128X // 4 lux/lsb
+ ALSPGA_1X, ///< 0.03125 lux/lsb
+ ALSPGA_4X, ///< 0.125 lux/lsb
+ ALSPGA_16X, ///< 0.5 lux/lsb
+ ALSPGA_128X ///< 4 lux/lsb
} alspga_t;
@@ -151,22 +151,22 @@
* @details MAX44000 LED Driver Current Settings
*/
typedef enum {
- DRV_0, // LED driver disabled
- DRV_10, // 10mA
- DRV_20, // 20mA
- DRV_30, // 30mA
- DRV_40, // 40mA
- DRV_50, // 50mA
- DRV_60, // 60mA
- DRV_70, // 70mA
- DUP_40, // 40mA
- DUP_50, // 50mA
- DUP_60, // 60mA
- DUP_70, // 70mA
- DRV_80, // 80mA
- DRV_90, // 90mA
- DRV_100, // 100mA
- DRV_110 // 110mA
+ DRV_0, ///< LED driver disabled
+ DRV_10, ///< 10mA
+ DRV_20, ///< 20mA
+ DRV_30, ///< 30mA
+ DRV_40, ///< 40mA
+ DRV_50, ///< 50mA
+ DRV_60, ///< 60mA
+ DRV_70, ///< 70mA
+ DUP_40, ///< 40mA
+ DUP_50, ///< 50mA
+ DUP_60, ///< 60mA
+ DUP_70, ///< 70mA
+ DRV_80, ///< 80mA
+ DRV_90, ///< 90mA
+ DRV_100, ///< 100mA
+ DRV_110 ///< 110mA
} drive_t;
@@ -175,10 +175,10 @@
* @details MAX44000 ALS/PROX Threshold Persist Timer Settings
*/
typedef enum {
- PST_1, // 1 trigger before interrupt
- PST_2, // 2 consecutive triggers before interrupt
- PST_4, // 4 consecutive triggers before interrupt
- PST_16 // 16 consecutive triggers before interrupt
+ PST_1, ///< 1 trigger before interrupt
+ PST_2, ///< 2 consecutive triggers before interrupt
+ PST_4, ///< 4 consecutive triggers before interrupt
+ PST_16 ///< 16 consecutive triggers before interrupt
} persist_t;
@@ -211,7 +211,7 @@
* @param drive LED Driver Current
* @returns 0 if no errors, -1 if error.
*/
- int init(MAX44000::modes_t mode, MAX44000::alstim_t alstim, MAX44000::alspga_t alspga, MAX44000::drive_t drive);
+ int init(MAX44000::modes_t mode, MAX44000::alstim_t alstim, MAX44000::alspga_t alspga, MAX44000::drive_t drive);
/**
* @brief Write Register

Ambient Light and Proximity Sensor MAX44000