hallcurrent16 2.1.0.0
hallcurrent16.h File Reference

This file contains API for Hall Current 16 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  hallcurrent16_t
 Hall Current 16 Click context object. More...
 
struct  hallcurrent16_cfg_t
 Hall Current 16 Click configuration object. More...
 

Macros

#define HALLCURRENT16_ADDR_IN_CH_SEL_1   0x00
 Hall Current 16 input channel selection.
 
#define HALLCURRENT16_ADDR_IN_CH_SEL_2   0x08
 
#define HALLCURRENT16_RESOLUTION_12BIT   0x0FFFu
 Hall Current 16 resolution and vref settings.
 
#define HALLCURRENT16_VREF_3V3   3.3f
 
#define HALLCURRENT16_VREF_5V   5.0f
 
#define HALLCURRENT16_SENS_CALC_GAIN_0   26.4f
 Hall Current 16 sensitivity.
 
#define HALLCURRENT16_SENS_CALC_GAIN_1   33.0f
 
#define HALLCURRENT16_SENS_CALC_GAIN_2   39.6f
 
#define HALLCURRENT16_SENS_CALC_GAIN_3   19.8f
 
#define HALLCURRENT16_ADC_NUM_OF_MEASURE   1000u
 Hall Current 16 data values to calculate.
 
#define HALLCURRENT16_CONV_TO_MILI   1000.0f
 
#define HALLCURRENT16_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define HALLCURRENT16_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define HALLCURRENT16_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hallcurrent16_gain_t { HALLCURRENT16_GAIN_0 = 0 , HALLCURRENT16_GAIN_1 , HALLCURRENT16_GAIN_2 , HALLCURRENT16_GAIN_3 }
 Hall Current 16 Click gain value data. More...
 
enum  hallcurrent16_return_value_t { HALLCURRENT16_OK = 0 , HALLCURRENT16_ERROR = -1 }
 Hall Current 16 Click return value data. More...
 

Functions

void hallcurrent16_cfg_setup (hallcurrent16_cfg_t *cfg)
 Hall Current 16 configuration object setup function.
 
err_t hallcurrent16_init (hallcurrent16_t *ctx, hallcurrent16_cfg_t *cfg)
 Hall Current 16 initialization function.
 
err_t hallcurrent16_default_cfg (hallcurrent16_t *ctx)
 Hall Current 16 default configuration function.
 
void hallcurrent16_set_vref (hallcurrent16_t *ctx, float vref)
 Hall Current 16 set vref function.
 
void hallcurrent16_set_sens (hallcurrent16_t *ctx)
 Hall Current 16 set sens function.
 
err_t hallcurrent16_get_voltage (hallcurrent16_t *ctx, float *voltage)
 Hall Current 16 get voltage function.
 
err_t hallcurrent16_get_vout (hallcurrent16_t *ctx, float *adc_vout)
 Hall Current 16 get vout function.
 
err_t hallcurrent16_get_vref (hallcurrent16_t *ctx, float *adc_vref)
 Hall Current 16 get vout function.
 
err_t hallcurrent16_get_current (hallcurrent16_t *ctx, float *current)
 Hall Current 16 get current function.
 
uint8_t hallcurrent16_get_ovc_fault (hallcurrent16_t *ctx)
 Hall Current 16 get overcurrent fault function.
 

Detailed Description

This file contains API for Hall Current 16 Click Driver.

Enumeration Type Documentation

◆ hallcurrent16_gain_t

Hall Current 16 Click gain value data.

Predefined enum values for driver gain values.

Enumerator
HALLCURRENT16_GAIN_0 
HALLCURRENT16_GAIN_1 
HALLCURRENT16_GAIN_2 
HALLCURRENT16_GAIN_3 

◆ hallcurrent16_return_value_t

Hall Current 16 Click return value data.

Predefined enum values for driver return values.

Enumerator
HALLCURRENT16_OK 
HALLCURRENT16_ERROR