hallcurrent6 2.0.0.0
hallcurrent6.h File Reference

This file contains API for Hall Current 6 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  hallcurrent6_t
 Click ctx object definition. More...
 
struct  hallcurrent6_cfg_t
 Click configuration structure definition. More...
 

Macros

#define HALLCURRENT6_MAP_MIKROBUS(cfg, mikrobus)
 
#define HALLCURRENT6_RETVAL   uint8_t
 
#define HALLCURRENT6_OK   0x00
 
#define HALLCURRENT6_INIT_ERROR   0xFF
 

Functions

void hallcurrent6_cfg_setup (hallcurrent6_cfg_t *cfg)
 Config Object Initialization function.
 
HALLCURRENT6_RETVAL hallcurrent6_init (hallcurrent6_t *ctx, hallcurrent6_cfg_t *cfg)
 Initialization function.
 
void hallcurrent6_generic_write (hallcurrent6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void hallcurrent6_generic_read (hallcurrent6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t hallcurrent6_read_data (hallcurrent6_t *ctx)
 Reads ADC current data.
 
float hallcurrent6_get_current (hallcurrent6_t *ctx)
 Reads current data.
 

Detailed Description

This file contains API for Hall Current 6 Click driver.

Function Documentation

◆ hallcurrent6_cfg_setup()

void hallcurrent6_cfg_setup ( hallcurrent6_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ hallcurrent6_generic_read()

void hallcurrent6_generic_read ( hallcurrent6_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ hallcurrent6_generic_write()

void hallcurrent6_generic_write ( hallcurrent6_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf.
lenNumber of the bytes to be read

@description This function writes data from the desired register.

◆ hallcurrent6_get_current()

float hallcurrent6_get_current ( hallcurrent6_t * ctx)

Reads current data.

Parameters
Currentdata in [mA]
ctxClick object.

@description Bipolar current sensor – nominal 400mV/A or 5A full scale

◆ hallcurrent6_init()

HALLCURRENT6_RETVAL hallcurrent6_init ( hallcurrent6_t * ctx,
hallcurrent6_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ hallcurrent6_read_data()

uint16_t hallcurrent6_read_data ( hallcurrent6_t * ctx)

Reads ADC current data.

Parameters
(12bits) adc value
ctxClick object.

@description The value of 2065 is 0A