Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_spi_master.h"
59 #define ISOADC5_REG_PROD_ID 0x00
60 #define ISOADC5_REG_ADC_1 0x01
61 #define ISOADC5_REG_ADC_2 0x02
62 #define ISOADC5_REG_ADC_3 0x03
63 #define ISOADC5_REG_ADC_4 0x04
64 #define ISOADC5_REG_FADC_1 0x05
65 #define ISOADC5_REG_FADC_2 0x06
66 #define ISOADC5_REG_FADC_3 0x07
67 #define ISOADC5_REG_FADC_4 0x08
68 #define ISOADC5_REG_COUNTHI_1 0x09
69 #define ISOADC5_REG_COUNTHI_2 0x0A
70 #define ISOADC5_REG_COUNTHI_3 0x0B
71 #define ISOADC5_REG_COUNTHI_4 0x0C
72 #define ISOADC5_REG_COUNTLO_1 0x0D
73 #define ISOADC5_REG_COUNTLO_2 0x0E
74 #define ISOADC5_REG_COUNTLO_3 0x0F
75 #define ISOADC5_REG_COUNTLO_4 0x10
76 #define ISOADC5_REG_COUT_STATUS 0x11
77 #define ISOADC5_REG_INTERRUPT_STATUS 0x12
78 #define ISOADC5_REG_INTERRUPT_ENABLE 0x13
79 #define ISOADC5_REG_CONTROL 0x14
97 #define ISOADC5_DEVICE_ID 0x00
98 #define ISOADC5_NORMAL_OPERATION 0x00
99 #define ISOADC5_WAKE_UP_FROM_POR 0x80
100 #define ISOADC5_DEVICE_REV 0x01
106 #define ISOADC5_ADC_NOT_UPDATED 0x8000
107 #define ISOADC5_ADC_12BIT_MASK 0x0FFF
113 #define ISOADC5_CO_MODE_STATUS 0x80
114 #define ISOADC5_CO_IN_SEL_FILTERED_ADC 0x40
120 #define ISOADC5_STATUS_CO_4 0x08
121 #define ISOADC5_STATUS_CO_3 0x04
122 #define ISOADC5_STATUS_CO_2 0x02
123 #define ISOADC5_STATUS_CO_1 0x01
129 #define ISOADC5_INT_STATUS_EOC 0x1000
130 #define ISOADC5_INT_STATUS_ADCF 0x0800
131 #define ISOADC5_INT_STATUS_FLD 0x0400
132 #define ISOADC5_INT_STATUS_SPIFRM 0x0200
133 #define ISOADC5_INT_STATUS_SPICRC 0x0100
134 #define ISOADC5_INT_STATUS_CO_POS_4 0x0080
135 #define ISOADC5_INT_STATUS_CO_POS_3 0x0040
136 #define ISOADC5_INT_STATUS_CO_POS_2 0x0020
137 #define ISOADC5_INT_STATUS_CO_POS_1 0x0010
138 #define ISOADC5_INT_STATUS_CO_NEG_4 0x0008
139 #define ISOADC5_INT_STATUS_CO_NEG_3 0x0004
140 #define ISOADC5_INT_STATUS_CO_NEG_2 0x0002
141 #define ISOADC5_INT_STATUS_CO_NEG_1 0x0001
147 #define ISOADC5_EN_CRC 0x8000
148 #define ISOADC5_EN_COMMON_COMP 0x4000
149 #define ISOADC5_CLEAR_FLT_4 0x0080
150 #define ISOADC5_CLEAR_FLT_3 0x0040
151 #define ISOADC5_CLEAR_FLT_2 0x0020
152 #define ISOADC5_CLEAR_FLT_1 0x0010
153 #define ISOADC5_DISABLE_PWR 0x0008
154 #define ISOADC5_CLEAR_POR 0x0004
155 #define ISOADC5_SOFT_RESET 0x0002
156 #define ISOADC5_HARD_RESET 0x0001
162 #define ISOADC5_ADC_CHANNEL_1 0x01
163 #define ISOADC5_ADC_CHANNEL_2 0x02
164 #define ISOADC5_ADC_CHANNEL_3 0x03
165 #define ISOADC5_ADC_CHANNEL_4 0x04
171 #define ISOADC5_ADC_UNFILTERED 0x00
172 #define ISOADC5_ADC_FILTERED 0x01
178 #define ISOADC5_MAX_VOLTAGE 48.0
184 #define ISOADC5_SPI_READ 0x00
185 #define ISOADC5_SPI_WRITE 0x02
186 #define ISOADC5_SPI_BURST 0x01
204 #define ISOADC5_MAP_MIKROBUS( cfg, mikrobus ) \
205 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
206 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
207 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
208 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
209 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
220 digital_in_t int_pin;
225 pin_name_t chip_select;
246 spi_master_mode_t spi_mode;
247 spi_master_chip_select_polarity_t cs_polarity;
Definition: isoadc5.h:271
err_t isoadc5_write_register(isoadc5_t *ctx, uint8_t reg, uint16_t data_in)
ISO ADC 5 write register function.
isoadc5_return_value_t
ISO ADC 5 Click return value data.
Definition: isoadc5.h:268
ISO ADC 5 Click burst payload structure object.
Definition: isoadc5.h:254
ISO ADC 5 Click context object.
Definition: isoadc5.h:217
err_t isoadc5_init(isoadc5_t *ctx, isoadc5_cfg_t *cfg)
ISO ADC 5 initialization function.
ISO ADC 5 Click configuration object.
Definition: isoadc5.h:232
Definition: isoadc5.h:270
err_t isoadc5_read_register(isoadc5_t *ctx, uint8_t reg, uint16_t *data_out)
ISO ADC 5 read register function.
uint8_t isoadc5_get_int_pin(isoadc5_t *ctx)
ISO ADC 5 get int pin function.
err_t isoadc5_read_voltage(isoadc5_t *ctx, uint8_t filt, uint8_t ch, float *volt)
ISO ADC 5 read voltage function.
void isoadc5_cfg_setup(isoadc5_cfg_t *cfg)
ISO ADC 5 configuration object setup function.
err_t isoadc5_read_register_burst(isoadc5_t *ctx, uint8_t filt, isoadc5_burst_payload_t *payload)
ISO ADC 5 read register function.