c3dhall6 2.0.0.0
Public function

Functions

void c3dhall6_cfg_setup (c3dhall6_cfg_t *cfg)
 Config Object Initialization function.
 
err_t c3dhall6_init (c3dhall6_t *ctx, c3dhall6_cfg_t *cfg)
 Initialization function.
 
void c3dhall6_default_cfg (c3dhall6_t *ctx)
 Click Default Configuration function.
 
void c3dhall6_set_reference_values (c3dhall6_t *ctx, c3dhall6_aux_ref_t ref_val)
 Setting reference values function.
 
void c3dhall6_get_adc_value (c3dhall6_t *ctx, uint8_t channel_no, uint16_t *adc_value)
 Getting ADC value on each channel function.
 
void c3dhall6_get_volt (c3dhall6_t *ctx, uint8_t channel_no, float *channel_voltage)
 Getting voltage on each channel function.
 
void c3dhall6_get_angle_deg (c3dhall6_t *ctx, uint8_t die, float *angle_value)
 GGetting angle value function.
 
void c3dhall6_get_angle_rad (c3dhall6_t *ctx, uint8_t die, float *angle_value)
 GGetting angle value function.
 

Detailed Description

Function Documentation

◆ c3dhall6_cfg_setup()

void c3dhall6_cfg_setup ( c3dhall6_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.

◆ c3dhall6_default_cfg()

void c3dhall6_default_cfg ( c3dhall6_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for 3D Hall 6 click.

◆ c3dhall6_get_adc_value()

void c3dhall6_get_adc_value ( c3dhall6_t * ctx,
uint8_t channel_no,
uint16_t * adc_value )

Getting ADC value on each channel function.

Parameters
ctxClick object.
channel_noChannel number (channels: CH0, CH1, CH2, CH3).
adc_valueADC value on selected channel.

This function reads ADC value on selected channel.

◆ c3dhall6_get_angle_deg()

void c3dhall6_get_angle_deg ( c3dhall6_t * ctx,
uint8_t die,
float * angle_value )

GGetting angle value function.

Parameters
ctxClick object.
dieDevice uses two dies for measurement (dies: die A, die B).
angle_valueCalculated angle value (range: from -180 to 180 degrees).

This function reads ADC values for selected die and calculates angle value in degrees.

◆ c3dhall6_get_angle_rad()

void c3dhall6_get_angle_rad ( c3dhall6_t * ctx,
uint8_t die,
float * angle_value )

GGetting angle value function.

Parameters
ctxClick object.
dieDevice uses two dies for measurement (dies: die A, die B).
angle_valueCalculated angle value (range: from -1 to 1 pi radians).

This function reads ADC values for selected die and calculates angle value in radians.

◆ c3dhall6_get_volt()

void c3dhall6_get_volt ( c3dhall6_t * ctx,
uint8_t channel_no,
float * channel_voltage )

Getting voltage on each channel function.

Parameters
ctxClick object.
channel_noChannel number (channels: CH0, CH1, CH2, CH3).
channel_voltagevoltage value on selected channel.

This function reads ADC value on selected channel and converts that value to Volts or miliVolts - depending on reference voltage setting.

◆ c3dhall6_init()

err_t c3dhall6_init ( c3dhall6_t * ctx,
c3dhall6_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ c3dhall6_set_reference_values()

void c3dhall6_set_reference_values ( c3dhall6_t * ctx,
c3dhall6_aux_ref_t ref_val )

Setting reference values function.

Parameters
ctxClick object.
ref_valReference voltage in Volts or miliVolts ( measure this voltage between GND and 3V3 pin ). Reference adc value from channel 0 - perform adc measurement on channel 0 with no permanent magnet. Reference adc value from channel 1 - perform adc measurement on channel 1 with no permanent magnet. Reference adc value from channel 2 - perform adc measurement on channel 2 with no permanent magnet. Reference adc value from channel 3 - perform adc measurement on channel 3 with no permanent magnet.

This function sets reference values for voltage and angle calculations.