ambient5 2.0.0.0
Public function

Functions

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

Detailed Description

Function Documentation

◆ ambient5_cfg_setup()

void ambient5_cfg_setup ( ambient5_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description 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.

@description This function checks INT pin state.

◆ ambient5_default_cfg()

void ambient5_default_cfg ( ambient5_t * ctx)

Default configuration function.

Parameters
ambient5Click object.

@description 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.

@description 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.

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

◆ ambient5_get_register()

uint16_t ambient5_get_register ( ambient5_t * ctx,
uint8_t reg )

Get register function.

Parameters
ctxClick object.
regRegister address.

@description This function reads data from the desired register.

◆ ambient5_get_resolution()

float ambient5_get_resolution ( ambient5_t * ctx)

Get resolution.

Parameters
ctxClick object.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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. @description This function writes register value to the desired register.