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_i2c_master.h"
66#define RMSTODC_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS )
77#define RMSTODC_RETVAL uint8_t
79#define RMSTODC_OK 0x00
80#define RMSTODC_INIT_ERROR 0xFF
87#define ADC_RESOLUTION 4096
88#define RMS2DC_DEVICE_ADDR 0x4D
95#define RMS2DC_DEVICE_EN 0x00
96#define RMS2DC_DEVICE_DIS 0x01
103#define RMS2DC_VCC_3V3 3300
104#define RMS2DC_VCC_5V 5000
#define RMSTODC_RETVAL
Definition rmstodc.h:77
void rms2dc_enable(rmstodc_t *ctx, uint8_t state)
Enable function.
uint16_t rms2dc_read_adc(rmstodc_t *ctx)
ADC Read function.
uint16_t rms2dc_vout_adc(rmstodc_t *ctx, uint16_t vcc_sel)
Get Output Voltage function.
void rmstodc_cfg_setup(rmstodc_cfg_t *cfg)
Config Object Initialization function.
RMSTODC_RETVAL rmstodc_init(rmstodc_t *ctx, rmstodc_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition rmstodc.h:137
uint32_t i2c_speed
Definition rmstodc.h:149
pin_name_t scl
Definition rmstodc.h:140
pin_name_t en
Definition rmstodc.h:145
pin_name_t sda
Definition rmstodc.h:141
uint8_t i2c_address
Definition rmstodc.h:150
Click ctx object definition.
Definition rmstodc.h:118
i2c_master_t i2c
Definition rmstodc.h:125
digital_out_t en
Definition rmstodc.h:121
uint8_t slave_address
Definition rmstodc.h:129