42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_analog_in.h"
67#define AMBIENT_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.an_pin = MIKROBUS( mikrobus, MIKROBUS_AN )
76#define AMBIENT_ERROR -1
83#define AMBIENT_VCC_5_0 5.0f
84#define AMBIENT_VCC_3_3 3.3f
85#define AMBIENT_VOLTS_TO_MILLIVOLTS 1000.0f
err_t ambient_init(ambient_t *ctx, ambient_cfg_t *cfg)
Initialization function.
err_t ambient_read_an_pin_voltage(ambient_t *ctx, float *data_out)
Ambient read AN pin voltage level function.
uint16_t ambient_get_light_intensity(ambient_t *ctx)
Calculate light intensity function.
err_t ambient_read_an_pin_value(ambient_t *ctx, uint16_t *data_out)
Ambient read AN pin value function.
void ambient_cfg_setup(ambient_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition ambient.h:110
analog_in_resolution_t resolution
Definition ambient.h:115
float vref
Definition ambient.h:116
pin_name_t an_pin
Definition ambient.h:112
Click ctx object definition.
Definition ambient.h:100
analog_in_t adc
Definition ambient.h:102