Go to the documentation of this file.
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
94 #define HZTOV_ENABLE 1
95 #define HZTOV_DISABLE 0
103 #define HZTOV_MAX_FREQ 10000
104 #define HZTOV_MIN_FREQ 1000
HZTOV_RETVAL hztov_init(hztov_t *ctx, hztov_cfg_t *cfg)
Initialization function.
analog_in_resolution_t resolution
Definition: hztov.h:156
pin_name_t en
Definition: hztov.h:152
pin_name_t pwm
Definition: hztov.h:147
void hztov_cfg_setup(hztov_cfg_t *cfg)
Config Object Initialization function.
pin_name_t vo
Definition: hztov.h:148
float vref
Definition: hztov.h:157
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
pwm_t pwm
Definition: hztov.h:131
analog_in_t adc
Definition: hztov.h:132
#define HZTOV_RETVAL
Definition: hztov.h:77
void hztov_set_enable(hztov_t *ctx, uint8_t state)
Set enable pin state.
Click configuration structure definition.
Definition: hztov.h:144
Click ctx object definition.
Definition: hztov.h:124
uint32_t dev_pwm_freq
Definition: hztov.h:158
void hztov_set_duty_cycle(hztov_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
digital_out_t en
Definition: hztov.h:127
float hztov_read_voltage(hztov_t *ctx)
Read voltage function.
uint32_t pwm_freq
Definition: hztov.h:136
void hztov_pwm_stop(hztov_t *ctx)
Stop PWM module.
void hztov_pwm_start(hztov_t *ctx)
Start PWM module.
hztov_data_t hztov_generic_read(hztov_t *ctx)
Generic read function.