hallcurrent14 2.0.0.0
hallcurrent14.h File Reference

This file contains API for Hall Current 14 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  hallcurrent14_t
 Hall Current 14 Click context object. More...
 
struct  hallcurrent14_cfg_t
 Hall Current 14 Click configuration object. More...
 

Macros

#define HALLCURRENT14_SENSITIVITY_V_TO_A   0.08
 Hall Current 14 Current calculation values.
 
#define HALLCURRENT14_ZERO_CURRENT_OFFSET   0.5
 
#define HALLCURRENT14_NUM_CONVERSIONS   1000
 
#define HALLCURRENT14_ADC_RESOLUTION   0x0FFF
 Hall Current 14 ADC setting.
 
#define HALLCURRENT14_VREF_5V   5.0
 
#define HALLCURRENT14_SET_DEV_ADDR   0x4D
 Hall Current 14 device address setting.
 
#define HALLCURRENT14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hallcurrent14_drv_t { HALLCURRENT14_DRV_SEL_ADC , HALLCURRENT14_DRV_SEL_I2C }
 Hall Current 14 Click driver selector. More...
 
enum  hallcurrent14_return_value_t { HALLCURRENT14_OK = 0 , HALLCURRENT14_ERROR = -1 }
 Hall Current 14 Click return value data. More...
 

Functions

void hallcurrent14_cfg_setup (hallcurrent14_cfg_t *cfg)
 Hall Current 14 configuration object setup function.
 
void hallcurrent14_drv_interface_selection (hallcurrent14_cfg_t *cfg, hallcurrent14_drv_t drv_sel)
 Hall Current 14 driver interface setup function.
 
err_t hallcurrent14_init (hallcurrent14_t *ctx, hallcurrent14_cfg_t *cfg)
 Hall Current 14 initialization function.
 
err_t hallcurrent14_read_raw_adc (hallcurrent14_t *ctx, uint16_t *raw_adc)
 Hall Current 14 read raw ADC value function.
 
err_t hallcurrent14_read_voltage (hallcurrent14_t *ctx, float *voltage)
 Hall Current 14 read voltage level function.
 
err_t hallcurrent14_set_vref (hallcurrent14_t *ctx, float vref)
 Hall Current 14 set vref function.
 
err_t hallcurrent14_read_current (hallcurrent14_t *ctx, float *current)
 Hall Current 14 read current function.
 

Detailed Description

This file contains API for Hall Current 14 Click Driver.

Enumeration Type Documentation

◆ hallcurrent14_drv_t

Hall Current 14 Click driver selector.

Selects target driver interface of Hall Current 14 Click driver.

Enumerator
HALLCURRENT14_DRV_SEL_ADC 

ADC driver descriptor.

HALLCURRENT14_DRV_SEL_I2C 

I2C driver descriptor.

◆ hallcurrent14_return_value_t

Hall Current 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
HALLCURRENT14_OK 
HALLCURRENT14_ERROR