ambient5  2.0.0.0
Functions
Public function

Functions

void ambient5_cfg_setup (ambient5_cfg_t *cfg)
 Config Object Initialization function. More...
 
AMBIENT5_RETVAL ambient5_init (ambient5_t *ctx, ambient5_cfg_t *cfg)
 Initialization function. More...
 
void ambient5_default_cfg (ambient5_t *ctx)
 Default configuration function. More...
 
void ambient5_set_register (ambient5_t *ctx, uint8_t reg_addr, uint16_t reg_value)
 Set register function. More...
 
int16_t ambient5_get_register (ambient5_t *ctx, uint8_t reg)
 Get register function. More...
 
float ambient5_get_resolution (ambient5_t *ctx)
 Get resolution. More...
 
uint16_t ambient5_get_refresh_time (ambient5_t *ctx)
 Get refresh time. More...
 
float ambient5_get_high_resolution_light_level (ambient5_t *ctx)
 Get high resolution light level. More...
 
float ambient5_get_white_channel_light_level (ambient5_t *ctx)
 Get white channel light level. More...
 
void ambient5_set_low_light_level_threshold (ambient5_t *ctx, float low_light_level_threshold)
 Set low light level threshold. More...
 
void ambient5_set_high_light_level_threshold (ambient5_t *ctx, float high_light_level_threshold)
 Set high light level threshold. More...
 
void ambient5_power_on (ambient5_t *ctx)
 Set high light level threshold. More...
 
uint8_t ambient5_checkIntPin (ambient5_t *ctx)
 Checking INT pin state. More...
 

Detailed Description

Function Documentation

◆ ambient5_cfg_setup()

void ambient5_cfg_setup ( ambient5_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ambient5_checkIntPin()

uint8_t ambient5_checkIntPin ( ambient5_t ctx)

Checking INT pin state.

Parameters
ctxClick object.
Returns
INT pin state; 0-LOW, 1-HIGH.

This function checks INT pin state.

◆ ambient5_default_cfg()

void ambient5_default_cfg ( ambient5_t ctx)

Default configuration function.

Parameters
ambient5Click object.

This function sets default configuration for the module.

◆ ambient5_get_high_resolution_light_level()

float ambient5_get_high_resolution_light_level ( ambient5_t ctx)

Get high resolution light level.

Parameters
ctxClick object.
Returns
Light level.

This function calculates light level (lux) read from "high resolution output data" register.

◆ ambient5_get_refresh_time()

uint16_t ambient5_get_refresh_time ( ambient5_t ctx)

Get refresh time.

Parameters
ctxClick object.
Returns
Refresh time.

This function calculates refresh time, based on user settings for integration time and power saving mode.

◆ ambient5_get_register()

int16_t ambient5_get_register ( ambient5_t ctx,
uint8_t  reg 
)

Get register function.

Parameters
ctxClick object.
regRegister address.

This function reads data from the desired register.

◆ ambient5_get_resolution()

float ambient5_get_resolution ( ambient5_t ctx)

Get resolution.

Parameters
ctxClick object.

This function calculates resolution of output data in "high resolution" and "white channel" registers.

◆ ambient5_get_white_channel_light_level()

float ambient5_get_white_channel_light_level ( ambient5_t ctx)

Get white channel light level.

Parameters
ctxClick object.
Returns
Light level.

This function calculates light level (lux) read from "white channel output data" register.

◆ ambient5_init()

AMBIENT5_RETVAL ambient5_init ( ambient5_t ctx,
ambient5_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ ambient5_power_on()

void ambient5_power_on ( ambient5_t ctx)

Set high light level threshold.

Parameters
ctxClick object.

This function powers device on and sets basic settings.

◆ ambient5_set_high_light_level_threshold()

void ambient5_set_high_light_level_threshold ( ambient5_t ctx,
float  high_light_level_threshold 
)

Set high light level threshold.

Parameters
ctxClick object.
high_light_level_thresholdHigh light level threshold.

This function sets high light level threshold (lux) by setting "high threshold windows setting" register.

◆ ambient5_set_low_light_level_threshold()

void ambient5_set_low_light_level_threshold ( ambient5_t ctx,
float  low_light_level_threshold 
)

Set low light level threshold.

Parameters
ctxClick object.
low_light_level_thresholdLow light level threshold.

This function calculates light level (lux) read from "white channel output data" register.

◆ ambient5_set_register()

void ambient5_set_register ( ambient5_t ctx,
uint8_t  reg_addr,
uint16_t  reg_value 
)

Set register function.

Parameters
ctxClick object.
reg_addrRegister address.
reg_valueRegister value to be written. This function writes register value to the desired register.