c3dhall6 2.0.0.0
|
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. | |
void c3dhall6_cfg_setup | ( | c3dhall6_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void c3dhall6_default_cfg | ( | c3dhall6_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
This function executes default configuration for 3D Hall 6 click.
void c3dhall6_get_adc_value | ( | c3dhall6_t * | ctx, |
uint8_t | channel_no, | ||
uint16_t * | adc_value ) |
Getting ADC value on each channel function.
ctx | Click object. |
channel_no | Channel number (channels: CH0, CH1, CH2, CH3). |
adc_value | ADC value on selected channel. |
This function reads ADC value on selected channel.
void c3dhall6_get_angle_deg | ( | c3dhall6_t * | ctx, |
uint8_t | die, | ||
float * | angle_value ) |
GGetting angle value function.
ctx | Click object. |
die | Device uses two dies for measurement (dies: die A, die B). |
angle_value | Calculated angle value (range: from -180 to 180 degrees). |
This function reads ADC values for selected die and calculates angle value in degrees.
void c3dhall6_get_angle_rad | ( | c3dhall6_t * | ctx, |
uint8_t | die, | ||
float * | angle_value ) |
GGetting angle value function.
ctx | Click object. |
die | Device uses two dies for measurement (dies: die A, die B). |
angle_value | Calculated angle value (range: from -1 to 1 pi radians). |
This function reads ADC values for selected die and calculates angle value in radians.
void c3dhall6_get_volt | ( | c3dhall6_t * | ctx, |
uint8_t | channel_no, | ||
float * | channel_voltage ) |
Getting voltage on each channel function.
ctx | Click object. |
channel_no | Channel number (channels: CH0, CH1, CH2, CH3). |
channel_voltage | voltage 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.
err_t c3dhall6_init | ( | c3dhall6_t * | ctx, |
c3dhall6_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void c3dhall6_set_reference_values | ( | c3dhall6_t * | ctx, |
c3dhall6_aux_ref_t | ref_val ) |
Setting reference values function.
ctx | Click object. |
ref_val | Reference 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.