39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
72#define LIGHTHZ_PIN_STATE_LOW 0
73#define LIGHTHZ_PIN_STATE_HIGH 1
79#define LIGHTHZ_SENS_POWER_DOWN 0
80#define LIGHTHZ_SENS_1X 1
81#define LIGHTHZ_SENS_10X 2
82#define LIGHTHZ_SENS_100X 3
88#define LIGHTHZ_FSCALE_1 0
89#define LIGHTHZ_FSCALE_2 1
90#define LIGHTHZ_FSCALE_10 2
91#define LIGHTHZ_FSCALE_100 3
97#define LIGHTHZ_DELAY_US 10
98#define LIGHTHZ_MAX_COUNTS_PER_S 100000ul
99#define LIGHTHZ_SAMPLE_COUNTS 100
117#define LIGHTHZ_MAP_MIKROBUS( cfg, mikrobus ) \
118 cfg.s1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
119 cfg.s3 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
120 cfg.s2 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
121 cfg.s0 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
122 cfg.freq = MIKROBUS( mikrobus, MIKROBUS_INT )
void lighthz_set_sensitivity(lighthz_t *ctx, uint8_t mode)
LightHz set sensitivity function.
void lighthz_set_s1_pin(lighthz_t *ctx, uint8_t state)
LightHz set s1 pin function.
err_t lighthz_init(lighthz_t *ctx, lighthz_cfg_t *cfg)
LightHz initialization function.
uint8_t lighthz_get_freq_pin(lighthz_t *ctx)
LightHz get freq pin function.
void lighthz_set_frequency_scaling(lighthz_t *ctx, uint8_t mode)
LightHz set frequency scaling function.
void lighthz_set_s3_pin(lighthz_t *ctx, uint8_t state)
LightHz set s3 pin function.
void lighthz_cfg_setup(lighthz_cfg_t *cfg)
LightHz configuration object setup function.
void lighthz_set_s0_pin(lighthz_t *ctx, uint8_t state)
LightHz set s0 pin function.
void lighthz_set_s2_pin(lighthz_t *ctx, uint8_t state)
LightHz set s2 pin function.
lighthz_return_value_t
LightHz Click return value data.
Definition lighthz.h:161
@ LIGHTHZ_ERROR
Definition lighthz.h:163
@ LIGHTHZ_OK
Definition lighthz.h:162
LightHz Click configuration object.
Definition lighthz.h:147
pin_name_t s2
Definition lighthz.h:150
pin_name_t s3
Definition lighthz.h:149
pin_name_t s0
Definition lighthz.h:151
pin_name_t s1
Definition lighthz.h:148
pin_name_t freq
Definition lighthz.h:152
LightHz Click context object.
Definition lighthz.h:132
digital_out_t s3
Definition lighthz.h:134
digital_out_t s2
Definition lighthz.h:135
digital_out_t s1
Definition lighthz.h:133
digital_out_t s0
Definition lighthz.h:136
digital_in_t freq
Definition lighthz.h:138