ambient2  2.0.0.0
Functions
Public Functions

Functions

void ambient2_cfg_setup (ambient2_cfg_t *cfg)
 Configuration Object Setup function. More...
 
ambient2_err_t ambient2_init (ambient2_t *ctx, ambient2_cfg_t *cfg)
 Click Initialization function. More...
 
void ambient2_default_cfg (ambient2_t *ctx)
 Click Default Configuration function. More...
 
void ambient2_generic_write (ambient2_t *ctx, ambient2_reg_addr_t reg_addr, ambient2_data_t data_in)
 Generic Write function. More...
 
ambient2_data_t ambient2_generic_read (ambient2_t *ctx, ambient2_reg_addr_t reg_addr)
 Generic Read function. More...
 
void ambient2_get_sens_results (ambient2_t *ctx)
 Sensor Results Read function. More...
 
uint8_t ambient2_get_int (ambient2_t *ctx)
 INT Pin Check function. More...
 

Detailed Description

Function Documentation

◆ ambient2_cfg_setup()

void ambient2_cfg_setup ( ambient2_cfg_t cfg)

Configuration Object Setup function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to initial state.

Note
All used pins will be set to unconnected state.

◆ ambient2_default_cfg()

void ambient2_default_cfg ( ambient2_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes a default configuration for Ambient 2 click.

◆ ambient2_generic_read()

ambient2_data_t ambient2_generic_read ( ambient2_t ctx,
ambient2_reg_addr_t  reg_addr 
)

Generic Read function.

Parameters
ctxClick object.
reg_addrRegister address.
Returns
A 16-bit read data.

@description This function allows user to perform a 16-bit data reading operation from the desired register.

◆ ambient2_generic_write()

void ambient2_generic_write ( ambient2_t ctx,
ambient2_reg_addr_t  reg_addr,
ambient2_data_t  data_in 
)

Generic Write function.

Parameters
ctxClick object.
reg_addrRegister address.
data_inData to be written.

@description This function allows user to perform a 16-bit data writing operation to the desired register.

◆ ambient2_get_int()

uint8_t ambient2_get_int ( ambient2_t ctx)

INT Pin Check function.

Parameters
ctxClick object.
Returns
Pin state [bool].

@description This function returns the state of the INT pin.

◆ ambient2_get_sens_results()

void ambient2_get_sens_results ( ambient2_t ctx)

Sensor Results Read function.

Parameters
ctxClick object.

@description This function allows user to get sensor results data which consists of the ambient light measured data [lux], ambient light range data [lux] and ambient light data in percents.

◆ ambient2_init()

ambient2_err_t ambient2_init ( ambient2_t ctx,
ambient2_cfg_t cfg 
)

Click Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0x0 - Ok, 0xFE - Driver init error, 0xFF - Unsupported pin.

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