compass4 2.0.0.0
|
Functions | |
void | compass4_cfg_setup (compass4_cfg_t *cfg) |
Config Object Initialization function. | |
COMPASS4_RETVAL | compass4_init (compass4_t *ctx, compass4_cfg_t *cfg) |
Initialization function. | |
void | compass4_generic_write (compass4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | compass4_generic_read (compass4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | compass4_hardware_reset (compass4_t *ctx) |
Hardware reset function. | |
void | compass4_set_rst_pin_state (compass4_t *ctx, uint8_t state) |
Sets RST pin state. | |
void | compass4_software_reset (compass4_t *ctx) |
Software reset function. | |
void | compass4_configuration (compass4_t *ctx, uint8_t cfg1, uint8_t cfg2) |
Configuration function. | |
uint8_t | compass4_get_status (compass4_t *ctx, uint8_t status) |
Get status. | |
uint8_t | compass4_check_device (compass4_t *ctx) |
Check device function. | |
uint8_t | compass4_get_interrupt (compass4_t *ctx) |
Gets INT pin state (DRDY pin) | |
uint8_t | compass4_get_axis (compass4_t *ctx, compass4_axis_t *axis) |
Gets X\Y\Z Axis value. | |
uint8_t | compass4_get_single_axis (compass4_t *ctx, uint8_t axis_reg, int16_t *axis_data) |
Gets single axis value. | |
uint8_t | compass4_get_magnetic_flux (compass4_t *ctx, compass4_flux_t *flux) |
Gets magnetic flux of X\Y\Z axis value. | |
uint8_t | compass4_get_single_magnetic_flux (compass4_t *ctx, uint8_t axis, float *flux_data) |
Gets single axis flux value. | |
void compass4_cfg_setup | ( | compass4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t compass4_check_device | ( | compass4_t * | ctx | ) |
Check device function.
ctx | Click object. |
@description This function reads device and company id, because tests communication
void compass4_configuration | ( | compass4_t * | ctx, |
uint8_t | cfg1, | ||
uint8_t | cfg2 ) |
Configuration function.
ctx | Click object. |
cfg1 | Config data for configuration register 1 |
cfg2 | Config data for configuration register 2 |
@description Used this function for configuration module
void compass4_generic_read | ( | compass4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function reads data from the desired register.
void compass4_generic_write | ( | compass4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function writes data to the desired register.
uint8_t compass4_get_axis | ( | compass4_t * | ctx, |
compass4_axis_t * | axis ) |
Gets X\Y\Z Axis value.
ctx | Click object. |
axis | Raw axis data object |
@description Used this function for reads current axis data
uint8_t compass4_get_interrupt | ( | compass4_t * | ctx | ) |
Gets INT pin state (DRDY pin)
ctx | Click object. |
@description Used this function for getting current interrupt pin state
uint8_t compass4_get_magnetic_flux | ( | compass4_t * | ctx, |
compass4_flux_t * | flux ) |
Gets magnetic flux of X\Y\Z axis value.
ctx | Click object. |
flux | Magnetic flux of axis data |
@description Used this function for reads magnetic flux of axis data
uint8_t compass4_get_single_axis | ( | compass4_t * | ctx, |
uint8_t | axis_reg, | ||
int16_t * | axis_data ) |
Gets single axis value.
ctx | Click object. |
axis_reg | Axis register ( LSB ) |
axis_data | axis data that reads from the register |
@description Used this function for reads current single axis data
uint8_t compass4_get_single_magnetic_flux | ( | compass4_t * | ctx, |
uint8_t | axis, | ||
float * | flux_data ) |
Gets single axis flux value.
ctx | Click object. |
axis | Axis register ( LSB ) |
flux_data | Flux data that reads and calculate |
@description Used this function for reads current single flux or axis data
uint8_t compass4_get_status | ( | compass4_t * | ctx, |
uint8_t | status ) |
Get status.
ctx | Click object. |
cfg1 | Config data for configuration register 1 |
cfg2 | Config data for configuration register 2 |
@description Used this function for configuration module
void compass4_hardware_reset | ( | compass4_t * | ctx | ) |
Hardware reset function.
ctx | Click object. |
@description Used this function for start hardware reset module
COMPASS4_RETVAL compass4_init | ( | compass4_t * | ctx, |
compass4_cfg_t * | cfg ) |
Initialization function.
compass4 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void compass4_set_rst_pin_state | ( | compass4_t * | ctx, |
uint8_t | state ) |
Sets RST pin state.
ctx | Click object. |
state | New pin state @description Used this function for set RST pin state |
void compass4_software_reset | ( | compass4_t * | ctx | ) |
Software reset function.
ctx | Click object. |
@description Used this function for start software reset module