current7 2.0.0.0
current7.h File Reference

This file contains API for Current 7 Click Driver. More...

#include "drv_i2c_master.h"
#include "drv_analog_in.h"

Go to the source code of this file.

Data Structures

struct  current7_s
 Current 7 Click context object. More...
 
struct  current7_cfg_t
 Current 7 Click configuration object. More...
 

Macros

#define CURRENT7_NUM_CONVERSIONS   100
 Current 7 Current calculation values.
 
#define CURRENT7_SENSITIVITY_V_TO_A   0.8f
 
#define CURRENT7_ADC_RESOLUTION   0x0FFF
 Current 7 ADC setting.
 
#define CURRENT7_VREF_3V3   3.3
 
#define CURRENT7_VREF_5V   5.0
 
#define CURRENT7_SET_DEV_ADDR   0x4D
 Current 7 device address setting.
 
#define CURRENT7_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct current7_s current7_t
 Current 7 Click context object.
 

Enumerations

enum  current7_drv_t { CURRENT7_DRV_SEL_ADC , CURRENT7_DRV_SEL_I2C }
 Current 7 Click driver selector. More...
 
enum  current7_return_value_t { CURRENT7_OK = 0 , CURRENT7_ERROR = -1 }
 Current 7 Click return value data. More...
 

Functions

void current7_cfg_setup (current7_cfg_t *cfg)
 Current 7 configuration object setup function.
 
void current7_drv_interface_selection (current7_cfg_t *cfg, current7_drv_t drv_sel)
 Current 7 driver interface setup function.
 
err_t current7_init (current7_t *ctx, current7_cfg_t *cfg)
 Current 7 initialization function.
 
err_t current7_read_raw_adc (current7_t *ctx, uint16_t *raw_adc)
 Current 7 read raw ADC value function.
 
err_t current7_read_voltage (current7_t *ctx, float *voltage)
 Current 7 read voltage level function.
 
err_t current7_set_vref (current7_t *ctx, float vref)
 Current 7 set vref function.
 
err_t current7_get_current (current7_t *ctx, float *current)
 Current 7 get current function.
 

Detailed Description

This file contains API for Current 7 Click Driver.

Typedef Documentation

◆ current7_t

typedef struct current7_s current7_t

Current 7 Click context object.

Context object definition of Current 7 Click driver.

Enumeration Type Documentation

◆ current7_drv_t

Current 7 Click driver selector.

Selects target driver interface of Current 7 Click driver.

Enumerator
CURRENT7_DRV_SEL_ADC 

ADC driver descriptor.

CURRENT7_DRV_SEL_I2C 

I2C driver descriptor.

◆ current7_return_value_t

Current 7 Click return value data.

Predefined enum values for driver return values.

Enumerator
CURRENT7_OK 
CURRENT7_ERROR