lighthz 2.1.0.0
LightHz Click Driver

API for configuring and manipulating LightHz Click driver. More...

Topics

 LightHz Settings
 Settings for LightHz Click driver.
 
 LightHz MikroBUS Map
 MikroBUS pin mapping of LightHz Click driver.
 

Functions

void lighthz_cfg_setup (lighthz_cfg_t *cfg)
 LightHz configuration object setup function.
 
err_t lighthz_init (lighthz_t *ctx, lighthz_cfg_t *cfg)
 LightHz initialization function.
 
void lighthz_set_s0_pin (lighthz_t *ctx, uint8_t state)
 LightHz set s0 pin function.
 
void lighthz_set_s1_pin (lighthz_t *ctx, uint8_t state)
 LightHz set s1 pin function.
 
void lighthz_set_s2_pin (lighthz_t *ctx, uint8_t state)
 LightHz set s2 pin function.
 
void lighthz_set_s3_pin (lighthz_t *ctx, uint8_t state)
 LightHz set s3 pin function.
 
void lighthz_set_sensitivity (lighthz_t *ctx, uint8_t mode)
 LightHz set sensitivity function.
 
void lighthz_set_frequency_scaling (lighthz_t *ctx, uint8_t mode)
 LightHz set frequency scaling function.
 
uint8_t lighthz_get_freq_pin (lighthz_t *ctx)
 LightHz get freq pin function.
 

Detailed Description

API for configuring and manipulating LightHz 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

◆ lighthz_cfg_setup()

void lighthz_cfg_setup ( lighthz_cfg_t * cfg)

LightHz configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ lighthz_get_freq_pin()

uint8_t lighthz_get_freq_pin ( lighthz_t * ctx)

LightHz get freq pin function.

This function returns the freq pin logic state.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ lighthz_init()

err_t lighthz_init ( lighthz_t * ctx,
lighthz_cfg_t * cfg )

LightHz initialization function.

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

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

◆ lighthz_set_frequency_scaling()

void lighthz_set_frequency_scaling ( lighthz_t * ctx,
uint8_t mode )

LightHz set frequency scaling function.

This function sets the sensor frequency scaling.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
[in]mode:
  • 0 - 1,
  • 1 - 2,
  • 2 - 10,
  • 3 - 100.
Returns
None.
Note
None.

◆ lighthz_set_s0_pin()

void lighthz_set_s0_pin ( lighthz_t * ctx,
uint8_t state )

LightHz set s0 pin function.

This function sets the s0 pin logic state.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ lighthz_set_s1_pin()

void lighthz_set_s1_pin ( lighthz_t * ctx,
uint8_t state )

LightHz set s1 pin function.

This function sets the s1 pin logic state.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ lighthz_set_s2_pin()

void lighthz_set_s2_pin ( lighthz_t * ctx,
uint8_t state )

LightHz set s2 pin function.

This function sets the s2 pin logic state.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ lighthz_set_s3_pin()

void lighthz_set_s3_pin ( lighthz_t * ctx,
uint8_t state )

LightHz set s3 pin function.

This function sets the s3 pin logic state.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ lighthz_set_sensitivity()

void lighthz_set_sensitivity ( lighthz_t * ctx,
uint8_t mode )

LightHz set sensitivity function.

This function sets the sensor sensitivity.

Parameters
[in]ctx: Click context object. See lighthz_t object definition for detailed explanation.
[in]mode:
  • 0 - Power down,
  • 1 - 1X,
  • 2 - 10X,
  • 3 - 100X.
Returns
None.
Note
None.