![]() |
LibDriver OPT300X
|
opt300x base driver modules More...
Data Structures | |
| struct | opt300x_handle_s |
| opt300x handle structure definition More... | |
| struct | opt300x_info_s |
| opt300x information structure definition More... | |
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 | |
opt300x base driver modules
| typedef struct opt300x_handle_s opt300x_handle_t |
opt300x handle structure definition
| typedef struct opt300x_info_s opt300x_info_t |
opt300x information structure definition
| enum opt3002_range_t |
opt3002 range enumeration definition
Definition at line 144 of file driver_opt300x.h.
| enum opt3005_range_t |
opt3005 range enumeration definition
Definition at line 164 of file driver_opt300x.h.
| enum opt300x_address_t |
opt300x address enumeration definition
| Enumerator | |
|---|---|
| OPT300X_ADDRESS_GND | ADDR pin connected to GND |
| OPT300X_ADDRESS_VCC | ADDR pin connected to VCC |
| OPT300X_ADDRESS_SDA | ADDR pin connected to SDA |
| OPT300X_ADDRESS_SCL | ADDR pin connected to SCL |
Definition at line 75 of file driver_opt300x.h.
| enum opt300x_bool_t |
opt300x bool enumeration definition
| Enumerator | |
|---|---|
| OPT300X_BOOL_FALSE | disable |
| OPT300X_BOOL_TRUE | enable |
Definition at line 86 of file driver_opt300x.h.
opt300x conversion time enumeration definition
| Enumerator | |
|---|---|
| OPT300X_CONVERSION_TIME_100_MS | 100ms |
| OPT300X_CONVERSION_TIME_800_MS | 800ms |
Definition at line 95 of file driver_opt300x.h.
opt300x fault count enumeration definition
| Enumerator | |
|---|---|
| OPT300X_FAULT_COUNT_ONE | one fault count |
| OPT300X_FAULT_COUNT_TWO | two fault counts |
| OPT300X_FAULT_COUNT_FOUR | four fault counts |
| OPT300X_FAULT_COUNT_EIGHT | eight fault counts |
Definition at line 113 of file driver_opt300x.h.
opt300x interrupt polarity enumeration definition
| Enumerator | |
|---|---|
| OPT300X_INTERRUPT_POLARITY_LOW | polarity low |
| OPT300X_INTERRUPT_POLARITY_HIGH | polarity high |
Definition at line 104 of file driver_opt300x.h.
| enum opt300x_interrupt_t |
opt300x interrupt enumeration definition
| Enumerator | |
|---|---|
| OPT300X_INTERRUPT_HIGH_LIMIT | high limit |
| OPT300X_INTERRUPT_LOW_LIMIT | low limit |
Definition at line 184 of file driver_opt300x.h.
| enum opt300x_range_t |
opt300x range enumeration definition
Definition at line 124 of file driver_opt300x.h.
| enum opt300x_t |
opt300x type enumeration definition
| Enumerator | |
|---|---|
| OPT3001 | opt3001 |
| OPT3002 | opt3002 |
| OPT3004 | opt3004 |
| OPT3005 | opt3005 |
| OPT3006 | opt3006 |
| OPT3007 | opt3007 |
Definition at line 62 of file driver_opt300x.h.
| uint8_t opt3002_continuous_read | ( | opt300x_handle_t * | handle, |
| uint16_t * | raw, | ||
| float * | nw_cm2 ) |
read data from the chip continuously
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *raw | pointer to a raw data buffer |
| [out] | *nw_cm2 | pointer to a converted data buffer |
Definition at line 519 of file driver_opt300x.c.
| uint8_t opt3002_get_range | ( | opt300x_handle_t * | handle, |
| opt3002_range_t * | range ) |
get range
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *range | pointer to a range buffer |
Definition at line 1286 of file driver_opt300x.c.
| 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
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | reg | register raw data |
| [out] | *nw_cm2 | pointer to a converted data buffer |
Definition at line 1087 of file driver_opt300x.c.
| 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
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | nw_cm2 | input data |
| [out] | *reg | pointer to a register raw buffer |
Definition at line 1032 of file driver_opt300x.c.
| uint8_t opt3002_set_range | ( | opt300x_handle_t * | handle, |
| opt3002_range_t | range ) |
set range
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | range | set range |
Definition at line 1234 of file driver_opt300x.c.
| uint8_t opt3002_single_read | ( | opt300x_handle_t * | handle, |
| uint16_t * | raw, | ||
| float * | nw_cm2 ) |
read data from the chip
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *raw | pointer to a raw data buffer |
| [out] | *nw_cm2 | pointer to a converted data buffer |
Definition at line 689 of file driver_opt300x.c.
| uint8_t opt3005_get_range | ( | opt300x_handle_t * | handle, |
| opt3005_range_t * | range ) |
get range
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *range | pointer to a range buffer |
Definition at line 1382 of file driver_opt300x.c.
| uint8_t opt3005_set_range | ( | opt300x_handle_t * | handle, |
| opt3005_range_t | range ) |
set range
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | range | set range |
Definition at line 1330 of file driver_opt300x.c.
| uint8_t opt300x_continuous_read | ( | opt300x_handle_t * | handle, |
| uint16_t * | raw, | ||
| float * | lux ) |
read data from the chip continuously
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *raw | pointer to a raw data buffer |
| [out] | *lux | pointer to a converted lux buffer |
Definition at line 448 of file driver_opt300x.c.
| uint8_t opt300x_deinit | ( | opt300x_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to an opt300x handle structure |
Definition at line 307 of file driver_opt300x.c.
| uint8_t opt300x_get_addr_pin | ( | opt300x_handle_t * | handle, |
| opt300x_address_t * | addr_pin ) |
get the iic address pin
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *addr_pin | pointer to a chip iic address pin buffer |
Definition at line 182 of file driver_opt300x.c.
| uint8_t opt300x_get_conversion_time | ( | opt300x_handle_t * | handle, |
| opt300x_conversion_time_t * | t ) |
get conversion time
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *t | pointer to a conversion time buffer |
Definition at line 1470 of file driver_opt300x.c.
| uint8_t opt300x_get_fault_count | ( | opt300x_handle_t * | handle, |
| opt300x_fault_count_t * | count ) |
get fault count
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *count | pointer to a fault count buffer |
Definition at line 1798 of file driver_opt300x.c.
| uint8_t opt300x_get_high_limit | ( | opt300x_handle_t * | handle, |
| uint16_t * | limit ) |
get high limit
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *limit | pointer to a high limit buffer |
Definition at line 888 of file driver_opt300x.c.
| uint8_t opt300x_get_interrupt_latch | ( | opt300x_handle_t * | handle, |
| opt300x_bool_t * | enable ) |
get interrupt latch status
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *enable | pointer to a bool value buffer |
Definition at line 1552 of file driver_opt300x.c.
| uint8_t opt300x_get_interrupt_pin_polarity | ( | opt300x_handle_t * | handle, |
| opt300x_interrupt_polarity_t * | polarity ) |
get interrupt pin polarity
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *polarity | pointer to an interrupt polarity buffer |
Definition at line 1634 of file driver_opt300x.c.
| uint8_t opt300x_get_low_limit | ( | opt300x_handle_t * | handle, |
| uint16_t * | limit ) |
get low limit
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *limit | pointer to a low limit buffer |
Definition at line 818 of file driver_opt300x.c.
| uint8_t opt300x_get_mask_exponent | ( | opt300x_handle_t * | handle, |
| opt300x_bool_t * | enable ) |
get mask exponent status
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *enable | pointer to a bool value buffer |
Definition at line 1716 of file driver_opt300x.c.
| uint8_t opt300x_get_range | ( | opt300x_handle_t * | handle, |
| opt300x_range_t * | range ) |
get range
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *range | pointer to a range buffer |
Definition at line 1184 of file driver_opt300x.c.
| uint8_t opt300x_get_type | ( | opt300x_handle_t * | handle, |
| opt300x_t * | type ) |
get the iic chip type
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *type | pointer to a chip type buffer |
Definition at line 140 of file driver_opt300x.c.
| uint8_t opt300x_info | ( | opt300x_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to an opt300x info structure |
Definition at line 1948 of file driver_opt300x.c.
| uint8_t opt300x_init | ( | opt300x_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to an opt300x handle structure |
Definition at line 205 of file driver_opt300x.c.
| uint8_t opt300x_irq_handler | ( | opt300x_handle_t * | handle | ) |
irq handler
| [in] | *handle | pointer to an opt300x handle structure |
Definition at line 1834 of file driver_opt300x.c.
| 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
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | reg | register raw data |
| [out] | *lux | pointer to a lux buffer |
Definition at line 986 of file driver_opt300x.c.
| 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
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | lux | input lux |
| [out] | *reg | pointer to a register raw buffer |
Definition at line 924 of file driver_opt300x.c.
| uint8_t opt300x_set_addr_pin | ( | opt300x_handle_t * | handle, |
| opt300x_address_t | addr_pin ) |
set the iic address pin
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | addr_pin | chip iic address pin |
Definition at line 161 of file driver_opt300x.c.
| uint8_t opt300x_set_conversion_time | ( | opt300x_handle_t * | handle, |
| opt300x_conversion_time_t | t ) |
set conversion time
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | t | conversion time |
Definition at line 1425 of file driver_opt300x.c.
| uint8_t opt300x_set_fault_count | ( | opt300x_handle_t * | handle, |
| opt300x_fault_count_t | count ) |
set fault count
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | count | fault count |
Definition at line 1753 of file driver_opt300x.c.
| uint8_t opt300x_set_high_limit | ( | opt300x_handle_t * | handle, |
| uint16_t | limit ) |
set high limit
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | limit | high limit |
Definition at line 853 of file driver_opt300x.c.
| uint8_t opt300x_set_interrupt_latch | ( | opt300x_handle_t * | handle, |
| opt300x_bool_t | enable ) |
enable or disable interrupt latch
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | enable | bool value |
Definition at line 1507 of file driver_opt300x.c.
| uint8_t opt300x_set_interrupt_pin_polarity | ( | opt300x_handle_t * | handle, |
| opt300x_interrupt_polarity_t | polarity ) |
set interrupt pin polarity
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | polarity | interrupt polarity |
Definition at line 1589 of file driver_opt300x.c.
| uint8_t opt300x_set_low_limit | ( | opt300x_handle_t * | handle, |
| uint16_t | limit ) |
set low limit
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | limit | low limit |
Definition at line 783 of file driver_opt300x.c.
| uint8_t opt300x_set_mask_exponent | ( | opt300x_handle_t * | handle, |
| opt300x_bool_t | enable ) |
enable or disable mask exponent
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | enable | bool value |
Definition at line 1671 of file driver_opt300x.c.
| uint8_t opt300x_set_range | ( | opt300x_handle_t * | handle, |
| opt300x_range_t | range ) |
set range
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | range | set range |
Definition at line 1126 of file driver_opt300x.c.
| uint8_t opt300x_set_type | ( | opt300x_handle_t * | handle, |
| opt300x_t | type ) |
set the chip type
| [in] | *handle | pointer to an opt300x handle structure |
| [in] | type | chip type |
Definition at line 119 of file driver_opt300x.c.
| uint8_t opt300x_single_read | ( | opt300x_handle_t * | handle, |
| uint16_t * | raw, | ||
| float * | lux ) |
read data from the chip
| [in] | *handle | pointer to an opt300x handle structure |
| [out] | *raw | pointer to a raw data buffer |
| [out] | *lux | pointer to a converted lux buffer |
Definition at line 584 of file driver_opt300x.c.
| uint8_t opt300x_start_continuous_read | ( | opt300x_handle_t * | handle | ) |
start the chip reading
| [in] | *handle | pointer to an opt300x handle structure |
Definition at line 357 of file driver_opt300x.c.
| uint8_t opt300x_stop_continuous_read | ( | opt300x_handle_t * | handle | ) |
stop the chip reading
| [in] | *handle | pointer to an opt300x handle structure |
Definition at line 401 of file driver_opt300x.c.