42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
55#include "drv_analog_in.h"
67#define HZTOV_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
69 cfg.vo = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS )
77#define HZTOV_RETVAL uint8_t
80#define HZTOV_INIT_ERROR 0xFF
87#define HZTOV_DEF_FREQ 5000
95#define HZTOV_DISABLE 0
103#define HZTOV_MAX_FREQ 10000
104#define HZTOV_MIN_FREQ 1000
#define HZTOV_RETVAL
Definition hztov.h:77
void hztov_cfg_setup(hztov_cfg_t *cfg)
Config Object Initialization function.
float hztov_read_voltage(hztov_t *ctx)
Read voltage function.
HZTOV_RETVAL hztov_init(hztov_t *ctx, hztov_cfg_t *cfg)
Initialization function.
void hztov_set_duty_cycle(hztov_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
void hztov_pwm_start(hztov_t *ctx)
Start PWM module.
void hztov_set_enable(hztov_t *ctx, uint8_t state)
Set enable pin state.
void hztov_pwm_stop(hztov_t *ctx)
Stop PWM module.
hztov_data_t hztov_generic_read(hztov_t *ctx)
Generic read function.
void hztov_set_input_frequency(hztov_t *ctx, uint16_t freq)
Changing the output voltage function.
uint16_t hztov_data_t
Analog data type.
Definition hztov.h:118
Click configuration structure definition.
Definition hztov.h:144
analog_in_resolution_t resolution
Definition hztov.h:156
float vref
Definition hztov.h:157
uint32_t dev_pwm_freq
Definition hztov.h:158
pin_name_t en
Definition hztov.h:152
pin_name_t vo
Definition hztov.h:148
pin_name_t pwm
Definition hztov.h:147
Click ctx object definition.
Definition hztov.h:124
uint32_t pwm_freq
Definition hztov.h:136
digital_out_t en
Definition hztov.h:127
analog_in_t adc
Definition hztov.h:132
pwm_t pwm
Definition hztov.h:131