lighthz 2.1.0.0
lighthz.h File Reference

This file contains API for LightHz Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"

Go to the source code of this file.

Data Structures

struct  lighthz_t
 LightHz Click context object. More...
 
struct  lighthz_cfg_t
 LightHz Click configuration object. More...
 

Macros

#define LIGHTHZ_PIN_STATE_LOW   0
 LightHz pin logic state setting.
 
#define LIGHTHZ_PIN_STATE_HIGH   1
 
#define LIGHTHZ_SENS_POWER_DOWN   0
 LightHz sensitivity setting.
 
#define LIGHTHZ_SENS_1X   1
 
#define LIGHTHZ_SENS_10X   2
 
#define LIGHTHZ_SENS_100X   3
 
#define LIGHTHZ_FSCALE_1   0
 LightHz frequency scaling setting.
 
#define LIGHTHZ_FSCALE_2   1
 
#define LIGHTHZ_FSCALE_10   2
 
#define LIGHTHZ_FSCALE_100   3
 
#define LIGHTHZ_DELAY_US   10
 LightHz frequency measurement setting.
 
#define LIGHTHZ_MAX_COUNTS_PER_S   100000ul
 
#define LIGHTHZ_SAMPLE_COUNTS   100
 
#define LIGHTHZ_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  lighthz_return_value_t { LIGHTHZ_OK = 0 , LIGHTHZ_ERROR = -1 }
 LightHz Click return value data. More...
 

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

This file contains API for LightHz Click Driver.

Enumeration Type Documentation

◆ lighthz_return_value_t

LightHz Click return value data.

Predefined enum values for driver return values.

Enumerator
LIGHTHZ_OK 
LIGHTHZ_ERROR