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 ADC_MASK 0x0FFF
86#define ISOADC2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
87#define ISOADC2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
105#define ISOADC2_MAP_MIKROBUS( cfg, mikrobus ) \
106 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
107 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
108 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
109 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
110 cfg.crt = MIKROBUS( mikrobus, MIKROBUS_RST )
err_t isoadc2_generic_write(isoadc2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
ISO ADC 2 data writing function.
err_t isoadc2_read_adc(isoadc2_t *ctx, uint16_t *adc_val)
ISO ADC 2 ADC data reading function.
err_t isoadc2_generic_read(isoadc2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
ISO ADC 2 data reading function.
err_t isoadc2_get_mv(isoadc2_t *ctx, uint16_t *voltage)
ISO ADC 2 voltage data reading function.
err_t isoadc2_init(isoadc2_t *ctx, isoadc2_cfg_t *cfg)
ISO ADC 2 initialization function.
void isoadc2_cfg_setup(isoadc2_cfg_t *cfg)
ISO ADC 2 configuration object setup function.
isoadc2_return_value_t
ISO ADC 2 Click return value data.
Definition isoadc2.h:158
@ ISOADC2_OK
Definition isoadc2.h:159
@ ISOADC2_ERROR
Definition isoadc2.h:160
This file contains SPI specific macros, functions, etc.
ISO ADC 2 Click configuration object.
Definition isoadc2.h:136
pin_name_t crt
Definition isoadc2.h:144
spi_master_chip_select_polarity_t cs_polarity
Definition isoadc2.h:149
pin_name_t sck
Definition isoadc2.h:140
spi_master_mode_t spi_mode
Definition isoadc2.h:148
pin_name_t mosi
Definition isoadc2.h:139
uint32_t spi_speed
Definition isoadc2.h:147
pin_name_t miso
Definition isoadc2.h:138
pin_name_t cs
Definition isoadc2.h:141
ISO ADC 2 Click context object.
Definition isoadc2.h:120
spi_master_t spi
Definition isoadc2.h:125
digital_out_t crt
Definition isoadc2.h:122
pin_name_t chip_select
Definition isoadc2.h:127