currentsens2 2.1.0.0
currentsens2.h File Reference

This file contains API for Current Sens 2 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  currentsens2_t
 Current Sens 2 Click context object. More...
 
struct  currentsens2_cfg_t
 Current Sens 2 Click configuration object. More...
 

Macros

#define CURRENTSENS2_CONV_FACTOR   12.5f
 Current Sens 2 description setting.
 
#define CURRENTSENS2_NUM_CONVERSIONS   10
 
#define CURRENTSENS2_NUM_OF_PASSES_1   1
 
#define CURRENTSENS2_NUM_OF_PASSES_2   2
 
#define CURRENTSENS2_NUM_OF_PASSES_3   3
 
#define CURRENTSENS2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  currentsens2_return_value_t { CURRENTSENS2_OK = 0 , CURRENTSENS2_ERROR = -1 }
 Current Sens 2 Click return value data. More...
 

Functions

void currentsens2_cfg_setup (currentsens2_cfg_t *cfg)
 Current Sens 2 configuration object setup function.
 
err_t currentsens2_init (currentsens2_t *ctx, currentsens2_cfg_t *cfg)
 Current Sens 2 initialization function.
 
err_t currentsens2_read_an_pin_value (currentsens2_t *ctx, uint16_t *data_out)
 Current Sens 2 read AN pin value function.
 
err_t currentsens2_read_an_pin_vol (currentsens2_t *ctx, float *data_out)
 Current Sens 2 read AN pin voltage level function.
 
uint8_t currentsens2_get_int_pin (currentsens2_t *ctx)
 Current Sens 2 get int pin state function.
 
void currentsens2_set_prim_turn_no (currentsens2_t *ctx, uint8_t turns)
 Current Sens 2 set number of primary coil turns function.
 
err_t currentsens2_tare (currentsens2_t *ctx)
 Current Sens 2 tare function.
 
err_t currentsens2_get_current (currentsens2_t *ctx, float *current)
 Current Sens 2 read current function.
 

Detailed Description

This file contains API for Current Sens 2 Click Driver.

Enumeration Type Documentation

◆ currentsens2_return_value_t

Current Sens 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
CURRENTSENS2_OK 
CURRENTSENS2_ERROR