LibDriver OPT300X
Loading...
Searching...
No Matches
opt300x example driver function

opt300x example driver modules More...

Collaboration diagram for opt300x example driver function:

Macros

#define OPT3002_BASIC_DEFAULT_RANGE   OPT3002_RANGE_AUTO
 opt300x basic example default definition
#define OPT3005_BASIC_DEFAULT_RANGE   OPT3005_RANGE_AUTO
#define OPT300X_BASIC_DEFAULT_RANGE   OPT300X_RANGE_AUTO
#define OPT300X_BASIC_DEFAULT_CONVERSION_TIME   OPT300X_CONVERSION_TIME_800_MS
#define OPT300X_BASIC_DEFAULT_MASK_EXPONENT   OPT300X_BOOL_FALSE
#define OPT300X_BASIC_DEFAULT_FAULT_COUNT   OPT300X_FAULT_COUNT_ONE
#define OPT300X_INTERRUPT_DEFAULT_INTERRUPT_LATCH   OPT300X_BOOL_TRUE
 opt300x interrupt example default definition
#define OPT300X_INTERRUPT_DEFAULT_INTERRUPT_POLARITY   OPT300X_INTERRUPT_POLARITY_LOW
#define OPT3002_INTERRUPT_DEFAULT_RANGE   OPT3002_RANGE_AUTO
#define OPT3005_INTERRUPT_DEFAULT_RANGE   OPT3005_RANGE_AUTO
#define OPT300X_INTERRUPT_DEFAULT_RANGE   OPT300X_RANGE_AUTO
#define OPT300X_INTERRUPT_DEFAULT_CONVERSION_TIME   OPT300X_CONVERSION_TIME_800_MS
#define OPT300X_INTERRUPT_DEFAULT_MASK_EXPONENT   OPT300X_BOOL_FALSE
#define OPT300X_INTERRUPT_DEFAULT_FAULT_COUNT   OPT300X_FAULT_COUNT_ONE
#define OPT3002_SHOT_DEFAULT_RANGE   OPT3002_RANGE_AUTO
 opt300x shot example default definition
#define OPT3005_SHOT_DEFAULT_RANGE   OPT3005_RANGE_AUTO
#define OPT300X_SHOT_DEFAULT_RANGE   OPT300X_RANGE_AUTO
#define OPT300X_SHOT_DEFAULT_CONVERSION_TIME   OPT300X_CONVERSION_TIME_800_MS
#define OPT300X_SHOT_DEFAULT_MASK_EXPONENT   OPT300X_BOOL_FALSE
#define OPT300X_SHOT_DEFAULT_FAULT_COUNT   OPT300X_FAULT_COUNT_ONE

Functions

uint8_t opt300x_basic_init (opt300x_t type, opt300x_address_t addr_pin)
 basic example init
uint8_t opt300x_basic_deinit (void)
 basic example deinit
uint8_t opt300x_basic_read (float *lux)
 basic example read
uint8_t opt3002_basic_read (float *nw_cm2)
 basic example read
uint8_t opt300x_interrupt_irq_handler (void)
 interrupt irq
uint8_t opt300x_interrupt_init (opt300x_t type, opt300x_address_t addr_pin, float low_threshold, float high_threshold, void(*callback)(uint8_t type))
 interrupt example init
uint8_t opt300x_interrupt_deinit (void)
 interrupt example deinit
uint8_t opt300x_interrupt_read (float *lux)
 interrupt example read
uint8_t opt3002_interrupt_read (float *nw_cm2)
 interrupt example read
uint8_t opt300x_shot_init (opt300x_t type, opt300x_address_t addr_pin)
 shot example init
uint8_t opt300x_shot_deinit (void)
 shot example deinit
uint8_t opt300x_shot_read (float *lux)
 shot example read
uint8_t opt3002_shot_read (float *nw_cm2)
 shot example read

Detailed Description

opt300x example driver modules

Macro Definition Documentation

◆ OPT3002_BASIC_DEFAULT_RANGE

#define OPT3002_BASIC_DEFAULT_RANGE   OPT3002_RANGE_AUTO

opt300x basic example default definition

auto range

Definition at line 56 of file driver_opt300x_basic.h.

◆ OPT3002_INTERRUPT_DEFAULT_RANGE

#define OPT3002_INTERRUPT_DEFAULT_RANGE   OPT3002_RANGE_AUTO

auto range

Definition at line 56 of file driver_opt300x_interrupt.h.

◆ OPT3002_SHOT_DEFAULT_RANGE

#define OPT3002_SHOT_DEFAULT_RANGE   OPT3002_RANGE_AUTO

opt300x shot example default definition

auto range

Definition at line 54 of file driver_opt300x_shot.h.

◆ OPT3005_BASIC_DEFAULT_RANGE

#define OPT3005_BASIC_DEFAULT_RANGE   OPT3005_RANGE_AUTO

auto range

Definition at line 57 of file driver_opt300x_basic.h.

◆ OPT3005_INTERRUPT_DEFAULT_RANGE

#define OPT3005_INTERRUPT_DEFAULT_RANGE   OPT3005_RANGE_AUTO

auto range

Definition at line 57 of file driver_opt300x_interrupt.h.

◆ OPT3005_SHOT_DEFAULT_RANGE

#define OPT3005_SHOT_DEFAULT_RANGE   OPT3005_RANGE_AUTO

auto range

Definition at line 55 of file driver_opt300x_shot.h.

◆ OPT300X_BASIC_DEFAULT_CONVERSION_TIME

#define OPT300X_BASIC_DEFAULT_CONVERSION_TIME   OPT300X_CONVERSION_TIME_800_MS

800ms

Definition at line 59 of file driver_opt300x_basic.h.

◆ OPT300X_BASIC_DEFAULT_FAULT_COUNT

#define OPT300X_BASIC_DEFAULT_FAULT_COUNT   OPT300X_FAULT_COUNT_ONE

fault count one

Definition at line 61 of file driver_opt300x_basic.h.

◆ OPT300X_BASIC_DEFAULT_MASK_EXPONENT

#define OPT300X_BASIC_DEFAULT_MASK_EXPONENT   OPT300X_BOOL_FALSE

disable mask exponent

Definition at line 60 of file driver_opt300x_basic.h.

◆ OPT300X_BASIC_DEFAULT_RANGE

#define OPT300X_BASIC_DEFAULT_RANGE   OPT300X_RANGE_AUTO

auto range

Definition at line 58 of file driver_opt300x_basic.h.

◆ OPT300X_INTERRUPT_DEFAULT_CONVERSION_TIME

#define OPT300X_INTERRUPT_DEFAULT_CONVERSION_TIME   OPT300X_CONVERSION_TIME_800_MS

800ms

Definition at line 59 of file driver_opt300x_interrupt.h.

◆ OPT300X_INTERRUPT_DEFAULT_FAULT_COUNT

#define OPT300X_INTERRUPT_DEFAULT_FAULT_COUNT   OPT300X_FAULT_COUNT_ONE

fault count one

Definition at line 61 of file driver_opt300x_interrupt.h.

◆ OPT300X_INTERRUPT_DEFAULT_INTERRUPT_LATCH

#define OPT300X_INTERRUPT_DEFAULT_INTERRUPT_LATCH   OPT300X_BOOL_TRUE

opt300x interrupt example default definition

enable interrupt latch

Definition at line 54 of file driver_opt300x_interrupt.h.

◆ OPT300X_INTERRUPT_DEFAULT_INTERRUPT_POLARITY

#define OPT300X_INTERRUPT_DEFAULT_INTERRUPT_POLARITY   OPT300X_INTERRUPT_POLARITY_LOW

interrupt pin polarity low

Definition at line 55 of file driver_opt300x_interrupt.h.

◆ OPT300X_INTERRUPT_DEFAULT_MASK_EXPONENT

#define OPT300X_INTERRUPT_DEFAULT_MASK_EXPONENT   OPT300X_BOOL_FALSE

disable mask exponent

Definition at line 60 of file driver_opt300x_interrupt.h.

◆ OPT300X_INTERRUPT_DEFAULT_RANGE

#define OPT300X_INTERRUPT_DEFAULT_RANGE   OPT300X_RANGE_AUTO

auto range

Definition at line 58 of file driver_opt300x_interrupt.h.

◆ OPT300X_SHOT_DEFAULT_CONVERSION_TIME

#define OPT300X_SHOT_DEFAULT_CONVERSION_TIME   OPT300X_CONVERSION_TIME_800_MS

800ms

Definition at line 57 of file driver_opt300x_shot.h.

◆ OPT300X_SHOT_DEFAULT_FAULT_COUNT

#define OPT300X_SHOT_DEFAULT_FAULT_COUNT   OPT300X_FAULT_COUNT_ONE

fault count one

Definition at line 59 of file driver_opt300x_shot.h.

◆ OPT300X_SHOT_DEFAULT_MASK_EXPONENT

#define OPT300X_SHOT_DEFAULT_MASK_EXPONENT   OPT300X_BOOL_FALSE

disable mask exponent

Definition at line 58 of file driver_opt300x_shot.h.

◆ OPT300X_SHOT_DEFAULT_RANGE

#define OPT300X_SHOT_DEFAULT_RANGE   OPT300X_RANGE_AUTO

auto range

Definition at line 56 of file driver_opt300x_shot.h.

Function Documentation

◆ opt3002_basic_read()

uint8_t opt3002_basic_read ( float * nw_cm2)

basic example read

Parameters
[out]*nw_cm2pointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read failed
Note
none

Definition at line 198 of file driver_opt300x_basic.c.

Here is the call graph for this function:

◆ opt3002_interrupt_read()

uint8_t opt3002_interrupt_read ( float * nw_cm2)

interrupt example read

Parameters
[out]*nw_cm2pointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read failed
Note
none

Definition at line 326 of file driver_opt300x_interrupt.c.

Here is the call graph for this function:

◆ opt3002_shot_read()

uint8_t opt3002_shot_read ( float * nw_cm2)

shot example read

Parameters
[out]*nw_cm2pointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read failed
Note
none

Definition at line 188 of file driver_opt300x_shot.c.

Here is the call graph for this function:

◆ opt300x_basic_deinit()

uint8_t opt300x_basic_deinit ( void )

basic example deinit

Returns
status code
  • 0 success
  • 1 deinit failed
Note
none

Definition at line 218 of file driver_opt300x_basic.c.

Here is the call graph for this function:

◆ opt300x_basic_init()

uint8_t opt300x_basic_init ( opt300x_t type,
opt300x_address_t addr_pin )

basic example init

Parameters
[in]typechip type
[in]addr_piniic device address
Returns
status code
  • 0 success
  • 1 init failed
Note
none

Definition at line 50 of file driver_opt300x_basic.c.

Here is the call graph for this function:

◆ opt300x_basic_read()

uint8_t opt300x_basic_read ( float * lux)

basic example read

Parameters
[out]*luxpointer to a lux buffer
Returns
status code
  • 0 success
  • 1 read failed
Note
none

Definition at line 177 of file driver_opt300x_basic.c.

Here is the call graph for this function:

◆ opt300x_interrupt_deinit()

uint8_t opt300x_interrupt_deinit ( void )

interrupt example deinit

Returns
status code
  • 0 success
  • 1 deinit failed
Note
none

Definition at line 346 of file driver_opt300x_interrupt.c.

Here is the call graph for this function:

◆ opt300x_interrupt_init()

uint8_t opt300x_interrupt_init ( opt300x_t type,
opt300x_address_t addr_pin,
float low_threshold,
float high_threshold,
void(* callback )(uint8_t type) )

interrupt example init

Parameters
[in]typechip type
[in]addr_piniic device address
[in]low_thresholdlow threshold in lux or in nw/cm2
[in]high_thresholdhigh threshold in lux or in nw/cm2
[in]*callbackpointer to a callback function address
Returns
status code
  • 0 success
  • 1 init failed
Note
none

Definition at line 70 of file driver_opt300x_interrupt.c.

Here is the call graph for this function:

◆ opt300x_interrupt_irq_handler()

uint8_t opt300x_interrupt_irq_handler ( void )

interrupt irq

Returns
status code
  • 0 success
  • 1 run failed
Note
none

Definition at line 48 of file driver_opt300x_interrupt.c.

Here is the call graph for this function:

◆ opt300x_interrupt_read()

uint8_t opt300x_interrupt_read ( float * lux)

interrupt example read

Parameters
[out]*luxpointer to a lux buffer
Returns
status code
  • 0 success
  • 1 read failed
Note
none

Definition at line 305 of file driver_opt300x_interrupt.c.

Here is the call graph for this function:

◆ opt300x_shot_deinit()

uint8_t opt300x_shot_deinit ( void )

shot example deinit

Returns
status code
  • 0 success
  • 1 deinit failed
Note
none

Definition at line 208 of file driver_opt300x_shot.c.

Here is the call graph for this function:

◆ opt300x_shot_init()

uint8_t opt300x_shot_init ( opt300x_t type,
opt300x_address_t addr_pin )

shot example init

Parameters
[in]typechip type
[in]addr_piniic device address
Returns
status code
  • 0 success
  • 1 init failed
Note
none

Definition at line 50 of file driver_opt300x_shot.c.

Here is the call graph for this function:

◆ opt300x_shot_read()

uint8_t opt300x_shot_read ( float * lux)

shot example read

Parameters
[out]*luxpointer to a lux buffer
Returns
status code
  • 0 success
  • 1 read failed
Note
none

Definition at line 167 of file driver_opt300x_shot.c.

Here is the call graph for this function: