39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define ISOADC_VEXT_MIN 4.5f
75#define ISOADC_VEXT_5V 5.0f
76#define ISOADC_VEXT_MAX 5.5f
77#define ISOADC_ADC_RESOLUTION 65535
78#define ISOADC_ADC_FSR 320
79#define ISOADC_ADC_2FSR ( ISOADC_ADC_FSR * 2 )
80#define ISOADC_ADC_NUM_AVERAGES 65535
81#define ISOADC_VOLTAGE_NUM_AVERAGES 10
82#define ISOADC_TIMEOUT_COUNT 1000
83#define ISOADC_VOLTAGE_TO_CURRENT 0.1f
84#define ISOADC_MILLI_TO_ONE 1000
94#define ISOADC_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
95#define ISOADC_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
113#define ISOADC_MAP_MIKROBUS( cfg, mikrobus ) \
114 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
115 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
116 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK );
err_t isoadc_read_voltage(isoadc_t *ctx, float *voltage)
ISO ADC read voltage function.
float isoadc_get_power(isoadc_t *ctx, float voltage)
ISO ADC get power function.
void isoadc_cfg_setup(isoadc_cfg_t *cfg)
ISO ADC configuration object setup function.
err_t isoadc_init(isoadc_t *ctx, isoadc_cfg_t *cfg)
ISO ADC initialization function.
err_t isoadc_read_raw_adc(isoadc_t *ctx, uint16_t *data_out)
ISO ADC read raw ADC function.
void isoadc_set_vext(isoadc_t *ctx, float vext)
ISO ADC set vext function.
float isoadc_get_current(float voltage)
ISO ADC get current function.
isoadc_return_value_t
ISO ADC Click return value data.
Definition isoadc.h:156
@ ISOADC_ERROR
Definition isoadc.h:158
@ ISOADC_OK
Definition isoadc.h:157
This file contains SPI specific macros, functions, etc.
ISO ADC Click configuration object.
Definition isoadc.h:139
pin_name_t sck
Definition isoadc.h:143
spi_master_mode_t spi_mode
Definition isoadc.h:147
pin_name_t mosi
Definition isoadc.h:142
uint32_t spi_speed
Definition isoadc.h:146
pin_name_t miso
Definition isoadc.h:141
ISO ADC Click context object.
Definition isoadc.h:126
spi_master_t spi
Definition isoadc.h:128
float vext
Definition isoadc.h:130