c3dhall6 2.0.0.0
|
Functions | |
void | c3dhall6_cfg_setup (c3dhall6_cfg_t *cfg) |
Config Object Initialization function. More... | |
C3DHALL6_RETVAL | c3dhall6_init (c3dhall6_t *ctx, c3dhall6_cfg_t *cfg) |
Initialization function. More... | |
void | c3dhall6_default_cfg (c3dhall6_t *ctx) |
Click Default Configuration function. More... | |
void | c3dhall6_generic_transfer (c3dhall6_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. More... | |
void | c3dhall6_spi_get (c3dhall6_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t n_bytes) |
Getting raw data function. More... | |
void | c3dhall6_set_reference_values (c3dhall6_t *ctx, float reference_voltage, float ref_adc_ch0, float ref_adc_ch1, float ref_adc_ch2, float ref_adc_ch3) |
Setting reference values function. More... | |
void | c3dhall6_get_adc_value (c3dhall6_t *ctx, uint8_t channel_no, uint16_t *adc_value) |
Getting ADC value on each channel function. More... | |
void | c3dhall6_get_volt (c3dhall6_t *ctx, uint8_t channel_no, float *channel_voltage) |
Getting voltage on each channel function. More... | |
void | c3dhall6_get_angle_deg (c3dhall6_t *ctx, uint8_t die, float *angle_value) |
GGetting angle value function. More... | |
void | c3dhall6_get_angle_rad (c3dhall6_t *ctx, uint8_t die, float *angle_value) |
GGetting angle value function. More... | |
void c3dhall6_cfg_setup | ( | c3dhall6_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void c3dhall6_default_cfg | ( | c3dhall6_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for 3D Hall 6 click.
void c3dhall6_generic_transfer | ( | c3dhall6_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len | ||
) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
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. |
@description 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). |
@description 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). |
@description 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. |
@description This function reads ADC value on selected channel and converts that value to Volts or miliVolts - depending on reference voltage setting.
C3DHALL6_RETVAL c3dhall6_init | ( | c3dhall6_t * | ctx, |
c3dhall6_cfg_t * | cfg | ||
) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void c3dhall6_set_reference_values | ( | c3dhall6_t * | ctx, |
float | reference_voltage, | ||
float | ref_adc_ch0, | ||
float | ref_adc_ch1, | ||
float | ref_adc_ch2, | ||
float | ref_adc_ch3 | ||
) |
Setting reference values function.
ctx | Click object. |
reference_voltage | Reference voltage in Volts or miliVolts ( measure this voltage between GND and 3V3 pin ). |
ref_adc_ch0 | Reference adc value from channel 0 - perform adc measurement on channel 0 with no permanent magnet. |
ref_adc_ch1 | Reference adc value from channel 1 - perform adc measurement on channel 1 with no permanent magnet. |
ref_adc_ch2 | Reference adc value from channel 2 - perform adc measurement on channel 2 with no permanent magnet. |
ref_adc_ch3 | Reference adc value from channel 3 - perform adc measurement on channel 3 with no permanent magnet. |
@description This function sets reference values for voltage and angle calculations.
void c3dhall6_spi_get | ( | c3dhall6_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t * | data_out, | ||
uint8_t | n_bytes | ||
) |
Getting raw data function.
ctx | Click object. |
data_in | Input data buffer. |
data_out | Output data buffer. |
n_bytes | Number of bytes to transfer. |
@description This function gets raw data from device.