Thu, 06 Apr 2023 20:53:06 +0200
Set the new measured deep sleep current consumption. This is half of the Wemos D1 system.
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * @file APDS-9930.h |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * @brief Library for the SparkFun APDS-9930 breakout board |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * @author Shawn Hymel (SparkFun Electronics) |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * @copyright This code is public domain but you buy me a beer if you use |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * this and we meet someday (Beerware license). |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * This library interfaces the Avago APDS-9930 to ESP-IDF over I2C. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * Ported from Arduino library by Davide Depau. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * MIT Licensed as described in the file LICENSE |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | */ |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | #ifndef __APDS9930_H__ |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | #define __APDS9930_H__ |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | #include <stdint.h> |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | #include <stdbool.h> |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | #include <esp_err.h> |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | #include <i2cdev.h> |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | #ifdef __cplusplus |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | extern "C" { |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | #endif |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | #define APDS9930_ID_1 0x12 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | #define APDS9930_ID_2 0x39 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | #define APDS9930_ID_3 0x30 // My chip gives this |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | /* LED Drive values */ |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | #define APDS9930_LED_DRIVE_100MA 0 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | #define APDS9930_LED_DRIVE_50MA 1 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | #define APDS9930_LED_DRIVE_25MA 2 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | #define APDS9930_LED_DRIVE_12_5MA 3 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | /* Proximity Gain (PGAIN) values */ |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | #define APDS9930_PGAIN_1X 0 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | #define APDS9930_PGAIN_2X 1 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | #define APDS9930_PGAIN_4X 2 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | #define APDS9930_PGAIN_8X 3 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | /* ALS Gain (AGAIN) values */ |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | #define APDS9930_AGAIN_1X 0 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | #define APDS9930_AGAIN_8X 1 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | #define APDS9930_AGAIN_16X 2 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | #define APDS9930_AGAIN_120X 3 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | |
16
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
50 | /* Default values */ |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
51 | #define APDS9930_DEFAULT_ATIME 0xED |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
52 | #define APDS9930_DEFAULT_WTIME 0xFF |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
53 | #define APDS9930_DEFAULT_PTIME 0xFF |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
54 | #define APDS9930_DEFAULT_PPULSE 0x08 |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
55 | #define APDS9930_DEFAULT_POFFSET 0 // 0 offset |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
56 | #define APDS9930_DEFAULT_CONFIG 0 |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
57 | #define APDS9930_DEFAULT_PDRIVE APDS9930_LED_DRIVE_100MA |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
58 | #define APDS9930_DEFAULT_PDIODE 2 |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
59 | #define APDS9930_DEFAULT_PGAIN APDS9930_PGAIN_8X |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
60 | #define APDS9930_DEFAULT_AGAIN APDS9930_AGAIN_1X |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
61 | #define APDS9930_DEFAULT_PILT 0 // Low proximity threshold |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
62 | #define APDS9930_DEFAULT_PIHT 50 // High proximity threshold |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
63 | #define APDS9930_DEFAULT_AILT 0xFFFF // Force interrupt for calibration |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
64 | #define APDS9930_DEFAULT_AIHT 0 |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
65 | #define APDS9930_DEFAULT_PERS 0x22 // 2 consecutive prox or ALS for int. |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
66 | |
b3e96bbe4ce4
First pass of debugging APDS9930 with a real chip.
Michiel Broek <mbroek@mbse.eu>
parents:
12
diff
changeset
|
67 | |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
68 | /** |
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
69 | * Device descriptor |
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
70 | */ |
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
71 | typedef struct { |
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
72 | i2c_dev_t i2c_dev; |
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
73 | uint8_t id; |
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
74 | } apds9930_t; |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | * @brief Initialize device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | * Default SCL frequency is 100kHz |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | * @param port I2C port number |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | * @param addr I2C address (0x39 for APDS9930) |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | * @param sda_gpio SDA GPIO |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | * @param scl_gpio SCL GPIO |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | * @return `ESP_OK` on success |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
89 | esp_err_t apds9930_init_desc(apds9930_t *dev, uint8_t addr, i2c_port_t port, gpio_num_t sda_gpio, gpio_num_t scl_gpio); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | * @brief Free device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | * @return `ESP_OK` on success |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
96 | esp_err_t apds9930_free_desc(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
98 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
99 | * @brief Setup APDS9930 and initializes registers to defaults |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
100 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
101 | * @return `ESP_OK` on success |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
103 | esp_err_t apds9930_init(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
104 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | * @brief Reads and returns the contents of the ENABLE register |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
107 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | * @return Contents of the ENABLE register. 0xFF if error. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
110 | uint8_t apds9930_getMode(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | * @brief Enables or disables a feature in the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | * @param mode which feature to enable |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | * @param enable ON (1) or OFF (0) |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | * @return `ESP_OK` on success |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
119 | esp_err_t apds9930_setMode(apds9930_t *dev, uint8_t mode, uint8_t enable); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
121 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | * @brief Turn the APDS-9930 on |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
124 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
125 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
126 | esp_err_t apds9930_enablePower(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
127 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
128 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
129 | * @brief Turn the APDS-9930 off |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
130 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
131 | * @return ESP_OK if operation successful. False otherwise. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
132 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
133 | esp_err_t apds9930_disablePower(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
134 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
135 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
136 | * @brief Starts the light (Ambient/IR) sensor on the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
137 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
138 | * @param interrupts true to enable hardware interrupt on high or low light |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
139 | * @return ESP_OK if sensor enabled correctly. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
140 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
141 | esp_err_t apds9930_enableLightSensor(apds9930_t *dev, bool interrupts); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
142 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
143 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
144 | * @brief Ends the light sensor on the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
145 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
146 | * @return ESP_OK if sensor disabled correctly. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
147 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
148 | esp_err_t apds9930_disableLightSensor(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
149 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
150 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
151 | * @brief Starts the proximity sensor on the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
152 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
153 | * @param interrupts true to enable hardware external interrupt on proximity |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
154 | * @return ESP_OK if sensor enabled correctly. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
155 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
156 | esp_err_t apds9930_enableProximitySensor(apds9930_t *dev, bool interrupts); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
157 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
158 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
159 | * @brief Ends the proximity sensor on the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
160 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
161 | * @return ESP_OK if sensor disabled correctly. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
162 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
163 | esp_err_t apds9930_disableProximitySensor(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
164 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
165 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
166 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
167 | * @brief Returns LED drive strength for proximity and ALS |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
168 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
169 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
170 | * Value LED Current |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
171 | * 0 100 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
172 | * 1 50 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
173 | * 2 25 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
174 | * 3 12.5 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
175 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
176 | * @return the value of the LED drive strength. 0xFF on failure. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
177 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
178 | uint8_t APDS9930_getLEDDrive(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
179 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
180 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
181 | * @brief Sets the LED drive strength for proximity and ALS |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
182 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
183 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
184 | * Value LED Current |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
185 | * 0 100 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
186 | * 1 50 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
187 | * 2 25 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
188 | * 3 12.5 mA |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
189 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
190 | * @param drive the value (0-3) for the LED drive strength |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
191 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
192 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
193 | esp_err_t apds9930_setLEDDrive(apds9930_t *dev, uint8_t drive); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
194 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
195 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
196 | * @brief Gets the receiver ALS gain level for the ambient light sensor. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
197 | * When set the gain is extra scaled down with 0.16. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
198 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
199 | * @return 1 if extra ALS gain level is enabled, 0 if not. 0xFF on error. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
200 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
201 | uint8_t apds9930_getAmbientGainLevel(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
202 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
203 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
204 | * @brief Sets the receiver ALS gain level for the ambient light sensor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
205 | * When asserted, the 1x and 8x gain modes are scaled by 0.16. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
206 | * Otherwise AGAIN is scaled by 1. Do not use with AGAIN greater then 8x. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
207 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
208 | * @param enable the value (0-1) for the gain level. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
209 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
210 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
211 | esp_err_t apds9930_setAmbientGainLevel(apds9930_t *dev, uint8_t enable); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
212 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
213 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
214 | * @brief Returns receiver gain for the ambient light sensor (ALS) |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
215 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
216 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
217 | * Value Gain |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
218 | * 0 1x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
219 | * 1 4x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
220 | * 2 16x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
221 | * 3 120x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
222 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
223 | * @return the value of the ALS gain. 0xFF on failure. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
224 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
225 | uint8_t apds9930_getAmbientLightGain(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
226 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
227 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
228 | * @brief Sets the receiver gain for the ambient light sensor (ALS) |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
229 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
230 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
231 | * Value Gain |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
232 | * 0 1x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
233 | * 1 4x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
234 | * 2 16x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
235 | * 3 120x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
236 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
237 | * @param drive the value (0-3) for the gain |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
238 | * @return ESP_OK if operation successful. False otherwise. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
239 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
240 | esp_err_t apds9930_setAmbientLightGain(apds9930_t *dev, uint8_t gain); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
241 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
242 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
243 | * @brief Returns receiver gain for proximity detection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
244 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
245 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
246 | * Value Gain |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
247 | * 0 1x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
248 | * 1 2x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
249 | * 2 4x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
250 | * 3 8x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
251 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
252 | * @return the value of the proximity gain. 0xFF on failure. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
253 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
254 | uint8_t apds9930_getProximityGain(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
255 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
256 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
257 | * @brief Sets the receiver gain for proximity detection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
258 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
259 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
260 | * Value Gain |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
261 | * 0 1x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
262 | * 1 2x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
263 | * 2 4x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
264 | * 3 8x |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
265 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
266 | * @param drive the value (0-3) for the gain |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
267 | * @return True if operation successful. False otherwise. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
268 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
269 | esp_err_t apds9930_setProximityGain(apds9930_t *dev, uint8_t gain); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
270 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
271 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
272 | * @brief Selects the proximity diode |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
273 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
274 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
275 | * Value Diode selection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
276 | * 0 Reserved |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
277 | * 1 Reserved |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
278 | * 2 Use Ch1 diode |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
279 | * 3 Reserved |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
280 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
281 | * @param[in] drive the value (0-3) for the diode |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
282 | * @return True if operation successful. False otherwise. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
283 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
284 | esp_err_t apds9930_setProximityDiode(apds9930_t *dev, uint8_t drive); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
285 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
286 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
287 | * @brief Returns the proximity diode |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
288 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
289 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
290 | * Value Diode selection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
291 | * 0 Reserved |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
292 | * 1 Reserved |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
293 | * 2 Use Ch1 diode |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
294 | * 3 Reserved |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
295 | * |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
296 | * @return the selected diode. 0xFF on failure. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
297 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
298 | uint8_t apds9930_getProximityDiode(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
299 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
300 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
301 | * @brief Gets the low threshold for ambient light interrupts |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
302 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
303 | * @param threshold current low threshold stored on the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
304 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
305 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
306 | esp_err_t apds9930_getLightIntLowThreshold(apds9930_t *dev, uint16_t *threshold); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
307 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
308 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
309 | * @brief Sets the low threshold for ambient light interrupts |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
310 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
311 | * @param threshold low threshold value for interrupt to trigger |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
312 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
313 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
314 | esp_err_t apds9930_setLightIntLowThreshold(apds9930_t *dev, uint16_t threshold); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
315 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
316 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
317 | * @brief Gets the high threshold for ambient light interrupts |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
318 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
319 | * @param threshold current low threshold stored on the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
320 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
321 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
322 | esp_err_t apds9930_getLightIntHighThreshold(apds9930_t *dev, uint16_t *threshold); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
323 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
324 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
325 | * @brief Sets the high threshold for ambient light interrupts |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
326 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
327 | * @param threshold low threshold value for interrupt to trigger |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
328 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
329 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
330 | esp_err_t apds9930_setLightIntHighThreshold(apds9930_t *dev, uint16_t threshold); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
331 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
332 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
333 | * @brief Gets if ambient light interrupts are enabled or not |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
334 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
335 | * @return 1 if interrupts are enabled, 0 if not. 0xFF on error. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
336 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
337 | uint8_t apds9930_getAmbientLightIntEnable(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
338 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
339 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
340 | * @brief Turns ambient light interrupts on or off |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
341 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
342 | * @param[in] enable 1 to enable interrupts, 0 to turn them off |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
343 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
344 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
345 | esp_err_t apds9930_setAmbientLightIntEnable(apds9930_t *dev, uint8_t enable); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
346 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
347 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
348 | * @brief Gets if proximity interrupts are enabled or not |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
349 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
350 | * @return 1 if interrupts are enabled, 0 if not. 0xFF on error. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
351 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
352 | uint8_t apds9930_getProximityIntEnable(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
353 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
354 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
355 | * @brief Turns proximity interrupts on or off |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
356 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
357 | * @param[in] enable 1 to enable interrupts, 0 to turn them off |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
358 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
359 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
360 | esp_err_t apds9930_setProximityIntEnable(apds9930_t *dev, uint8_t enable); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
361 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
362 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
363 | * @brief Clears the ambient light interrupt |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
364 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
365 | * @return ESP_OK if operation completed successfully. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
366 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
367 | esp_err_t apds9930_clearAmbientLightInt(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
368 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
369 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
370 | * @brief Clears the proximity interrupt |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
371 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
372 | * @return ESP_OK if operation completed successfully. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
373 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
374 | esp_err_t apds9930_clearProximityInt(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
375 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
376 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
377 | * @brief Clears all interrupts |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
378 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
379 | * @return ESP_OK if operation completed successfully. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
380 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
381 | esp_err_t apds9930_clearAllInts(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
382 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
383 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
384 | * @brief Reads the proximity level as an 16-bit value |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
385 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
386 | * @param val value of the proximity sensor. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
387 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
388 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
389 | esp_err_t apds9930_readProximity(apds9930_t *dev, uint16_t *val); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
390 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
391 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
392 | * @brief Reads the ambient (clear) light level as a float value |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
393 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
394 | * @param val value of the light sensor. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
395 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
396 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
397 | esp_err_t apds9930_readAmbientLightLux(apds9930_t *dev, float *val); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
398 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
399 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
400 | * @brief Reads the ambient (clear) light level as a unsigned long value |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
401 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
402 | * @param val value of the light sensor. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
403 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
404 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
405 | esp_err_t apds9930_readulAmbientLightLux(apds9930_t *dev, unsigned long *val); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
406 | |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
407 | float apds9930_floatAmbientToLux(apds9930_t *dev, uint16_t Ch0, uint16_t Ch1); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
408 | |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
409 | unsigned long apds9930_ulongAmbientToLux(apds9930_t *dev, uint16_t Ch0, uint16_t Ch1); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
410 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
411 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
412 | * @brief Read the channel 0 light value from the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
413 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
414 | * @param val The value read. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
415 | * @return ESP_OK if read is correctly. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
416 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
417 | esp_err_t apds9930_readCh0Light(apds9930_t *dev, uint16_t *val); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
418 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
419 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
420 | * @brief Read the channel 1 light value from the APDS-9930 |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
421 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
422 | * @param val The value read. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
423 | * @return ESP_OK if read is correctly. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
424 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
425 | esp_err_t apds9930_readCh1Light(apds9930_t *dev, uint16_t *val); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
426 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
427 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
428 | * @brief Returns the lower threshold for proximity detection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
429 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
430 | * @return lower threshold |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
431 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
432 | uint16_t apds9930_getProximityIntLowThreshold(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
433 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
434 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
435 | * @brief Sets the lower threshold for proximity detection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
436 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
437 | * @param threshold the lower proximity threshold |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
438 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
439 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
440 | esp_err_t apds9930_setProximityIntLowThreshold(apds9930_t *dev, uint16_t threshold); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
441 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
442 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
443 | * @brief Returns the high threshold for proximity detection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
444 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
445 | * @return high threshold |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
446 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
447 | uint16_t apds9930_getProximityIntHighThreshold(apds9930_t *dev); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
448 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
449 | /** |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
450 | * @brief Sets the high threshold for proximity detection |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
451 | * @param dev Pointer to I2C device descriptor |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
452 | * @param threshold the high proximity threshold |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
453 | * @return ESP_OK if operation successful. |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
454 | */ |
12
bb72d448e282
In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
455 | esp_err_t apds9930_setProximityIntHighThreshold(apds9930_t *dev, uint16_t threshold); |
11
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
456 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
457 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
458 | #ifdef __cplusplus |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
459 | } |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
460 | #endif |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
461 | |
bdc123ae7b49
Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
462 | #endif |