|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Public header for TI OPT4048 XYZ tristimulus color sensor. More...
Go to the source code of this file.
Macros | |
OPT4048 status register flags | |
Bit masks of the flags returned by opt4048_get_flags(). | |
| #define | OPT4048_FLAG_L 0x01 |
| Measurement below the low threshold. | |
| #define | OPT4048_FLAG_H 0x02 |
| Measurement above the high threshold. | |
| #define | OPT4048_FLAG_CONVERSION_READY 0x04 |
| Conversion completed. | |
| #define | OPT4048_FLAG_OVERLOAD 0x08 |
| Signal exceeded the full-scale range. | |
Functions | |
| int | opt4048_get_flags (const struct device *dev, uint8_t *flags) |
| Read the status flags of the OPT4048. | |
Public header for TI OPT4048 XYZ tristimulus color sensor.
Defines the sensor channels, attributes and value enumerations specific to the OPT4048 for use with the generic Zephyr sensor API.
| #define OPT4048_FLAG_CONVERSION_READY 0x04 |
Conversion completed.
| #define OPT4048_FLAG_H 0x02 |
Measurement above the high threshold.
| #define OPT4048_FLAG_L 0x01 |
Measurement below the low threshold.
| #define OPT4048_FLAG_OVERLOAD 0x08 |
Signal exceeded the full-scale range.
Conversion time per channel of the OPT4048.
Use with SENSOR_ATTR_OPT4048_CONVERSION_TIME.
| enum opt4048_fault_count |
| enum opt4048_int_cfg |
Function of the INT pin of the OPT4048.
Use with SENSOR_ATTR_OPT4048_INT_CONFIG.
| enum opt4048_mode |
Operating mode of the OPT4048.
Use with SENSOR_ATTR_OPT4048_MODE.
| Enumerator | |
|---|---|
| OPT4048_MODE_POWERDOWN | Power-down, no measurements. |
| OPT4048_MODE_AUTO_ONESHOT | Forced auto-range one-shot. |
| OPT4048_MODE_ONESHOT | One-shot. |
| OPT4048_MODE_CONTINUOUS | Continuous. |
| enum opt4048_range |
Full-scale light range of the OPT4048.
Use with SENSOR_ATTR_OPT4048_RANGE. A fixed range trades measurable illuminance against resolution; OPT4048_RANGE_AUTO lets the device pick the range for every conversion.
Driver-specific sensor attribute identifiers for the OPT4048.
The attribute value is passed in sensor_value.val1.
Use these identifiers with sensor_attr_set() and sensor_attr_get().
| Enumerator | |
|---|---|
| SENSOR_ATTR_OPT4048_RANGE | Full-scale range, see opt4048_range. |
| SENSOR_ATTR_OPT4048_CONVERSION_TIME | Conversion time per channel, see opt4048_conversion_time. |
| SENSOR_ATTR_OPT4048_MODE | Operating mode, see opt4048_mode. |
| SENSOR_ATTR_OPT4048_FAULT_COUNT | Consecutive fault count, see opt4048_fault_count. |
| SENSOR_ATTR_OPT4048_INT_LATCH | Interrupt latch: 1 = latched window mode, 0 = transparent hysteresis. |
| SENSOR_ATTR_OPT4048_INT_POLARITY | INT pin polarity: 0 = active low, 1 = active high. |
| SENSOR_ATTR_OPT4048_INT_DIRECTION | INT pin direction: 1 = output, 0 = input (hardware one-shot trigger). |
| SENSOR_ATTR_OPT4048_INT_CONFIG | INT pin function, see opt4048_int_cfg. |
| SENSOR_ATTR_OPT4048_THRESHOLD_CHANNEL | Channel (0 to 3) used by the threshold logic. |
| SENSOR_ATTR_OPT4048_QUICK_WAKE | Quick wake-up from standby in one-shot modes: 1 = enabled. |
Driver-specific sensor channel identifiers for the OPT4048.
Exposes the raw ADC codes of the four device channels and values derived from them (CIE tristimulus, chromaticity and CCT). SENSOR_CHAN_LIGHT returns the illuminance in lux.
Read the status flags of the OPT4048.
Reads the STATUS register of the device and returns the flag bits as a bitmask of OPT4048_FLAG_L, OPT4048_FLAG_H, OPT4048_FLAG_CONVERSION_READY and OPT4048_FLAG_OVERLOAD.
| [in] | dev | Pointer to the device structure for the driver instance. |
| [out] | flags | Pointer to store the status flags bitmask. |
| 0 | Success. |
| -EINVAL | flags is NULL. |
| -errno | Negative error code from the I2C API. |