28#ifndef HALLCURRENT17_H
29#define HALLCURRENT17_H
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 HALLCURRENT17_ADDR_IN_CH_SEL_1 0x00
75#define HALLCURRENT17_ADDR_IN_CH_SEL_2 0x08
94#define HALLCURRENT17_RESOLUTION_12BIT 0x0FFFu
100#define HALLCURRENT17_VREF_3V3 3.3f
101#define HALLCURRENT17_VREF_5V 5.0f
107#define HALLCURRENT17_RES_R5_R7_100_KOHM 100.0f
108#define HALLCURRENT17_RES_R6_R8_100_KOHM 100.0f
114#define HALLCURRENT17_NUM_OF_MEASURE 1000u
115#define HALLCURRENT17_CONV_V_TO_MV 1000.0f
121#define HALLCURRENT17_SENSITIVITY_MV_A 40.0f
131#define HALLCURRENT17_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
132#define HALLCURRENT17_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
150#define HALLCURRENT17_MAP_MIKROBUS( cfg, mikrobus ) \
151 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
152 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
153 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
154 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
void hallcurrent17_cfg_setup(hallcurrent17_cfg_t *cfg)
Hall Current 17 configuration object setup function.
err_t hallcurrent17_get_current(hallcurrent17_t *ctx, float *current)
Hall Current 17 get current function.
void hallcurrent17_set_adc_vref(hallcurrent17_t *ctx, float vref)
Hall Current 17 set voltage reference function.
err_t hallcurrent17_get_vout(hallcurrent17_t *ctx, float *adc_vout)
Hall Current 17 get Vout function.
err_t hallcurrent17_get_vref(hallcurrent17_t *ctx, float *adc_vref)
Hall Current 17 get Vref function.
err_t hallcurrent17_get_voltage(hallcurrent17_t *ctx, float *voltage)
Hall Current 17 get voltage function.
err_t hallcurrent17_default_cfg(hallcurrent17_t *ctx)
Hall Current 17 default configuration function.
err_t hallcurrent17_init(hallcurrent17_t *ctx, hallcurrent17_cfg_t *cfg)
Hall Current 17 initialization function.
hallcurrent17_return_value_t
Hall Current 17 Click return value data.
Definition hallcurrent17.h:198
@ HALLCURRENT17_OK
Definition hallcurrent17.h:199
@ HALLCURRENT17_ERROR
Definition hallcurrent17.h:200
This file contains SPI specific macros, functions, etc.
Hall Current 17 Click configuration object.
Definition hallcurrent17.h:179
spi_master_chip_select_polarity_t cs_polarity
Definition hallcurrent17.h:189
pin_name_t sck
Definition hallcurrent17.h:183
spi_master_mode_t spi_mode
Definition hallcurrent17.h:188
pin_name_t mosi
Definition hallcurrent17.h:182
uint32_t spi_speed
Definition hallcurrent17.h:187
pin_name_t miso
Definition hallcurrent17.h:181
pin_name_t cs
Definition hallcurrent17.h:184
Hall Current 17 Click context object.
Definition hallcurrent17.h:164
spi_master_t spi
Definition hallcurrent17.h:166
float vref
Definition hallcurrent17.h:170
pin_name_t chip_select
Definition hallcurrent17.h:168