hallcurrent4  2.0.0.0
Functions

Functions

void hallcurrent4_cfg_setup (hallcurrent4_cfg_t *cfg)
 Config Object Initialization function. More...
 
HALLCURRENT4_RETVAL hallcurrent4_init (hallcurrent4_t *ctx, hallcurrent4_cfg_t *cfg)
 Initialization function. More...
 
void hallcurrent4_generic_write (hallcurrent4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void hallcurrent4_generic_read (hallcurrent4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint16_t hallcurrent4_get_raw_data (hallcurrent4_t *ctx)
 Reads raw (ADC) current data. More...
 
float hallcurrent4_get_current_data (hallcurrent4_t *ctx)
 Reads current in mA. More...
 

Detailed Description

Function Documentation

◆ hallcurrent4_cfg_setup()

void hallcurrent4_cfg_setup ( hallcurrent4_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ hallcurrent4_generic_read()

void hallcurrent4_generic_read ( hallcurrent4_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

This function reads data from the desired register.

◆ hallcurrent4_generic_write()

void hallcurrent4_generic_write ( hallcurrent4_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.

This function writes data to the desired register.

◆ hallcurrent4_get_current_data()

float hallcurrent4_get_current_data ( hallcurrent4_t ctx)

Reads current in mA.

Parameters
ctxClick object.
Returns
current value

◆ hallcurrent4_get_raw_data()

uint16_t hallcurrent4_get_raw_data ( hallcurrent4_t ctx)

Reads raw (ADC) current data.

Parameters
ctxClick object.
Returns
current (12 bits) adc value
Note
The value of 1869 is 0A. Bipolar current sensor – nominal 200mV/A or 5A full scale

◆ hallcurrent4_init()

HALLCURRENT4_RETVAL hallcurrent4_init ( hallcurrent4_t ctx,
hallcurrent4_cfg_t cfg 
)

Initialization function.

Parameters
hallcurrent4Click object.
cfgClick configuration structure.

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