hallcurrent13 2.0.0.0
hallcurrent13.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_analog_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  hallcurrent13_t
 Hall Current 13 Click context object. More...
 
struct  hallcurrent13_cfg_t
 Hall Current 13 Click configuration object. More...
 

Macros

#define HALLCURRENT13_SENSITIVITY_V_TO_A   0.1
 Hall Current 13 Current calculation values.
 
#define HALLCURRENT13_ZERO_CURRENT_OFFSET   0.1
 
#define HALLCURRENT13_NUM_CONVERSIONS   100
 
#define HALLCURRENT13_ADC_RESOLUTION   0x0FFF
 Hall Current 13 ADC setting.
 
#define HALLCURRENT13_VREF_3V3   3.3
 
#define HALLCURRENT13_VREF_5V   5.0
 
#define HALLCURRENT13_SET_DEV_ADDR   0x4D
 Hall Current 13 device address setting.
 
#define HALLCURRENT13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hallcurrent13_drv_t { HALLCURRENT13_DRV_SEL_ADC , HALLCURRENT13_DRV_SEL_I2C }
 Hall Current 13 Click driver selector. More...
 
enum  hallcurrent13_return_value_t { HALLCURRENT13_OK = 0 , HALLCURRENT13_ERROR = -1 }
 Hall Current 13 Click return value data. More...
 

Functions

void hallcurrent13_cfg_setup (hallcurrent13_cfg_t *cfg)
 Hall Current 13 configuration object setup function.
 
void hallcurrent13_drv_interface_selection (hallcurrent13_cfg_t *cfg, hallcurrent13_drv_t drv_sel)
 Hall Current 13 driver interface setup function.
 
err_t hallcurrent13_init (hallcurrent13_t *ctx, hallcurrent13_cfg_t *cfg)
 Hall Current 13 initialization function.
 
err_t hallcurrent13_read_raw_adc (hallcurrent13_t *ctx, uint16_t *raw_adc)
 Hall Current 13 read raw ADC value function.
 
err_t hallcurrent13_read_voltage (hallcurrent13_t *ctx, float *voltage)
 Hall Current 13 read voltage level function.
 
err_t hallcurrent13_set_vref (hallcurrent13_t *ctx, float vref)
 Hall Current 13 set vref function.
 
err_t hallcurrent13_read_current (hallcurrent13_t *ctx, float *current)
 Hall Current 13 read current function.
 

Detailed Description

This file contains API for Hall Current 13 Click Driver.

Enumeration Type Documentation

◆ hallcurrent13_drv_t

Hall Current 13 Click driver selector.

Selects target driver interface of Hall Current 13 Click driver.

Enumerator
HALLCURRENT13_DRV_SEL_ADC 

ADC driver descriptor.

HALLCURRENT13_DRV_SEL_I2C 

I2C driver descriptor.

◆ hallcurrent13_return_value_t

Hall Current 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
HALLCURRENT13_OK 
HALLCURRENT13_ERROR