![]() |
LibDriver OPT300X
|
driver opt300x header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | opt300x_handle_s |
| opt300x handle structure definition More... | |
| struct | opt300x_info_s |
| opt300x information structure definition More... | |
Macros | |
| #define | DRIVER_OPT300X_LINK_INIT(HANDLE, STRUCTURE) |
| initialize opt300x_handle_t structure | |
| #define | DRIVER_OPT300X_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init function | |
| #define | DRIVER_OPT300X_LINK_IIC_DEINIT(HANDLE, FUC) |
| link iic_deinit function | |
| #define | DRIVER_OPT300X_LINK_IIC_READ(HANDLE, FUC) |
| link iic_read function | |
| #define | DRIVER_OPT300X_LINK_IIC_WRITE(HANDLE, FUC) |
| link iic_write function | |
| #define | DRIVER_OPT300X_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_OPT300X_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
| #define | DRIVER_OPT300X_LINK_RECEIVE_CALLBACK(HANDLE, FUC) |
| link receive_callback function | |
Typedefs | |
| typedef struct opt300x_handle_s | opt300x_handle_t |
| opt300x handle structure definition | |
| typedef struct opt300x_info_s | opt300x_info_t |
| opt300x information structure definition | |
Functions | |
| uint8_t | opt300x_info (opt300x_info_t *info) |
| get chip's information | |
| uint8_t | opt300x_set_type (opt300x_handle_t *handle, opt300x_t type) |
| set the chip type | |
| uint8_t | opt300x_get_type (opt300x_handle_t *handle, opt300x_t *type) |
| get the iic chip type | |
| uint8_t | opt300x_set_addr_pin (opt300x_handle_t *handle, opt300x_address_t addr_pin) |
| set the iic address pin | |
| uint8_t | opt300x_get_addr_pin (opt300x_handle_t *handle, opt300x_address_t *addr_pin) |
| get the iic address pin | |
| uint8_t | opt300x_irq_handler (opt300x_handle_t *handle) |
| irq handler | |
| uint8_t | opt300x_init (opt300x_handle_t *handle) |
| initialize the chip | |
| uint8_t | opt300x_deinit (opt300x_handle_t *handle) |
| close the chip | |
| uint8_t | opt300x_start_continuous_read (opt300x_handle_t *handle) |
| start the chip reading | |
| uint8_t | opt300x_stop_continuous_read (opt300x_handle_t *handle) |
| stop the chip reading | |
| uint8_t | opt300x_continuous_read (opt300x_handle_t *handle, uint16_t *raw, float *lux) |
| read data from the chip continuously | |
| uint8_t | opt3002_continuous_read (opt300x_handle_t *handle, uint16_t *raw, float *nw_cm2) |
| read data from the chip continuously | |
| uint8_t | opt300x_single_read (opt300x_handle_t *handle, uint16_t *raw, float *lux) |
| read data from the chip | |
| uint8_t | opt3002_single_read (opt300x_handle_t *handle, uint16_t *raw, float *nw_cm2) |
| read data from the chip | |
| uint8_t | opt300x_set_low_limit (opt300x_handle_t *handle, uint16_t limit) |
| set low limit | |
| uint8_t | opt300x_get_low_limit (opt300x_handle_t *handle, uint16_t *limit) |
| get low limit | |
| uint8_t | opt300x_set_high_limit (opt300x_handle_t *handle, uint16_t limit) |
| set high limit | |
| uint8_t | opt300x_get_high_limit (opt300x_handle_t *handle, uint16_t *limit) |
| get high limit | |
| uint8_t | opt300x_limit_convert_to_register (opt300x_handle_t *handle, float lux, uint16_t *reg) |
| convert the limit threshold to the register raw data | |
| uint8_t | opt300x_limit_convert_to_data (opt300x_handle_t *handle, uint16_t reg, float *lux) |
| convert the register raw data to the limit threshold | |
| uint8_t | opt3002_limit_convert_to_register (opt300x_handle_t *handle, float nw_cm2, uint16_t *reg) |
| convert the limit threshold to the register raw data | |
| uint8_t | opt3002_limit_convert_to_data (opt300x_handle_t *handle, uint16_t reg, float *nw_cm2) |
| convert the register raw data to the limit threshold | |
| uint8_t | opt300x_set_range (opt300x_handle_t *handle, opt300x_range_t range) |
| set range | |
| uint8_t | opt300x_get_range (opt300x_handle_t *handle, opt300x_range_t *range) |
| get range | |
| uint8_t | opt3002_set_range (opt300x_handle_t *handle, opt3002_range_t range) |
| set range | |
| uint8_t | opt3002_get_range (opt300x_handle_t *handle, opt3002_range_t *range) |
| get range | |
| uint8_t | opt3005_set_range (opt300x_handle_t *handle, opt3005_range_t range) |
| set range | |
| uint8_t | opt3005_get_range (opt300x_handle_t *handle, opt3005_range_t *range) |
| get range | |
| uint8_t | opt300x_set_conversion_time (opt300x_handle_t *handle, opt300x_conversion_time_t t) |
| set conversion time | |
| uint8_t | opt300x_get_conversion_time (opt300x_handle_t *handle, opt300x_conversion_time_t *t) |
| get conversion time | |
| uint8_t | opt300x_set_interrupt_latch (opt300x_handle_t *handle, opt300x_bool_t enable) |
| enable or disable interrupt latch | |
| uint8_t | opt300x_get_interrupt_latch (opt300x_handle_t *handle, opt300x_bool_t *enable) |
| get interrupt latch status | |
| uint8_t | opt300x_set_interrupt_pin_polarity (opt300x_handle_t *handle, opt300x_interrupt_polarity_t polarity) |
| set interrupt pin polarity | |
| uint8_t | opt300x_get_interrupt_pin_polarity (opt300x_handle_t *handle, opt300x_interrupt_polarity_t *polarity) |
| get interrupt pin polarity | |
| uint8_t | opt300x_set_mask_exponent (opt300x_handle_t *handle, opt300x_bool_t enable) |
| enable or disable mask exponent | |
| uint8_t | opt300x_get_mask_exponent (opt300x_handle_t *handle, opt300x_bool_t *enable) |
| get mask exponent status | |
| uint8_t | opt300x_set_fault_count (opt300x_handle_t *handle, opt300x_fault_count_t count) |
| set fault count | |
| uint8_t | opt300x_get_fault_count (opt300x_handle_t *handle, opt300x_fault_count_t *count) |
| get fault count | |
| uint8_t | opt300x_set_reg (opt300x_handle_t *handle, uint8_t reg, uint16_t data) |
| set the chip register | |
| uint8_t | opt300x_get_reg (opt300x_handle_t *handle, uint8_t reg, uint16_t *data) |
| get the chip register | |
driver opt300x header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2025/08/30 | 1.0 | Shifeng Li | first upload |
Definition in file driver_opt300x.h.