42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_analog_in.h"
65#define IRDISTANCE_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.out = MIKROBUS( mikrobus, MIKROBUS_AN ); \
67 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST )
void irdistance_cfg_setup(irdistance_cfg_t *cfg)
Config Object Initialization function.
err_t irdistance_init(irdistance_t *ctx, irdistance_cfg_t *cfg)
Initialization function.
void irdistance_enable_device(irdistance_t *ctx)
Enable IR sensor function.
err_t irdistance_read_adc(irdistance_t *ctx, uint16_t *data_out)
Generic read function.
void irdistance_disable_device(irdistance_t *ctx)
Disable IR sensor function.
err_t irdistance_get_pin_voltage(irdistance_t *ctx, float *data_out)
Get the voltage output of the sensor function.
Click configuration structure definition.
Definition irdistance.h:96
pin_name_t out
Definition irdistance.h:99
analog_in_resolution_t resolution
Definition irdistance.h:104
float vref
Definition irdistance.h:105
pin_name_t en
Definition irdistance.h:100
Click ctx object definition.
Definition irdistance.h:81
digital_out_t en
Definition irdistance.h:84
analog_in_t adc
Definition irdistance.h:88