ambient23 2.1.0.0
Ambient 23 Click Driver

API for configuring and manipulating Ambient 23 Click driver. More...

Topics

 Ambient 23 Registers List
 List of registers of Ambient 23 Click driver.
 
 Ambient 23 Registers Settings
 Settings for registers of Ambient 23 Click driver.
 
 Ambient 23 MikroBUS Map
 MikroBUS pin mapping of Ambient 23 Click driver.
 

Functions

void ambient23_cfg_setup (ambient23_cfg_t *cfg)
 Ambient 23 configuration object setup function.
 
err_t ambient23_init (ambient23_t *ctx, ambient23_cfg_t *cfg)
 Ambient 23 initialization function.
 
err_t ambient23_default_cfg (ambient23_t *ctx)
 Ambient 23 default configuration function.
 
err_t ambient23_generic_write (ambient23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Ambient 23 I2C writing function.
 
err_t ambient23_generic_read (ambient23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Ambient 23 I2C reading function.
 
err_t ambient23_reg_write (ambient23_t *ctx, uint8_t reg, uint16_t data_in)
 Ambient 23 register data writing function.
 
err_t ambient23_reg_read (ambient23_t *ctx, uint8_t reg, uint16_t *data_out)
 Ambient 23 register reading function.
 
err_t ambient23_calculate_res (ambient23_t *ctx, float *conversion_mul)
 Ambient 23 get conversion data function.
 
err_t ambient23_read_light_data (ambient23_t *ctx, float *light_data)
 Ambient 23 get light data function.
 

Detailed Description

API for configuring and manipulating Ambient 23 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ambient23_calculate_res()

err_t ambient23_calculate_res ( ambient23_t * ctx,
float * conversion_mul )

Ambient 23 get conversion data function.

This function is used to get the conversion multiplier necessary for converting raw ADC value into lux.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[out]conversion_mul: Conversion multiplier.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient23_cfg_setup()

void ambient23_cfg_setup ( ambient23_cfg_t * cfg)

Ambient 23 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ambient23_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ambient23_default_cfg()

err_t ambient23_default_cfg ( ambient23_t * ctx)

Ambient 23 default configuration function.

This function executes a default configuration of Ambient 23 click board.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ambient23_generic_read()

err_t ambient23_generic_read ( ambient23_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Ambient 23 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient23_generic_write()

err_t ambient23_generic_write ( ambient23_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Ambient 23 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient23_init()

err_t ambient23_init ( ambient23_t * ctx,
ambient23_cfg_t * cfg )

Ambient 23 initialization function.

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

Parameters
[out]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ambient23_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient23_read_light_data()

err_t ambient23_read_light_data ( ambient23_t * ctx,
float * light_data )

Ambient 23 get light data function.

This function is used to measure light level in lux.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[out]light_data: Measured light level.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient23_reg_read()

err_t ambient23_reg_read ( ambient23_t * ctx,
uint8_t reg,
uint16_t * data_out )

Ambient 23 register reading function.

This function reads a 16 bytes of data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient23_reg_write()

err_t ambient23_reg_write ( ambient23_t * ctx,
uint8_t reg,
uint16_t data_in )

Ambient 23 register data writing function.

This function writes a 16 bytes of data into the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient23_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.