compass2 2.0.0.0
|
Functions | |
void | compass2_cfg_setup (compass2_cfg_t *cfg) |
Config Object Initialization function. | |
COMPASS2_RETVAL | compass2_init (compass2_t *ctx, compass2_cfg_t *cfg) |
Initialization function. | |
void | compass2_default_cfg (compass2_t *ctx) |
Click Default Configuration function. | |
void | compass2_generic_write (compass2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | compass2_generic_read (compass2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | compass2_write_byte (compass2_t *ctx, uint8_t reg, uint8_t data_buf) |
Write byte function. | |
uint8_t | compass2_read_byte (compass2_t *ctx, uint8_t reg) |
Read byte function. | |
void | compass2_reset (compass2_t *ctx) |
Hardware reset function. | |
void | compass2_i2c_disable (compass2_t *ctx) |
Switch from I2C to SPI mode function. | |
void | compass2_software_reset (compass2_t *ctx) |
Software reset function. | |
float | compass2_get_resolution_parameter (uint8_t res) |
Get resolution function. | |
uint8_t | compass2_get_rdy (compass2_t *ctx) |
Get ready function. | |
uint8_t | compass2_get_data_overrun (compass2_t *ctx) |
Get data overrun function. | |
void | compass2_get_adjustment (compass2_t *ctx, uint8_t *x, uint8_t *y, uint8_t *z) |
Get axis adjustment function. | |
void | compass2_set_out_resolution (compass2_t *ctx, uint8_t res) |
Set output resolution function. | |
void | compass2_set_mode (compass2_t *ctx, uint8_t mode) |
Set output resolution function. | |
void | compass2_get_all_data (compass2_t *ctx, int16_t *x, int16_t *y, int16_t *z) |
Get all data function. | |
int16_t | compass2_get_axis_data (compass2_t *ctx, uint8_t axis) |
Get one axis data function. | |
void | compass2_new_measurement (compass2_t *ctx) |
New measurement function. | |
void compass2_cfg_setup | ( | compass2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void compass2_default_cfg | ( | compass2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Compass 2 click.
void compass2_generic_read | ( | compass2_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 compass2_generic_write | ( | compass2_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.
void compass2_get_adjustment | ( | compass2_t * | ctx, |
uint8_t * | x, | ||
uint8_t * | y, | ||
uint8_t * | z ) |
Get axis adjustment function.
ctx | Click object. |
*x | Pointer fox x. |
*y | Pointer for y. |
*z | Pointer for z. |
@description This function does adjustments to the axes.
void compass2_get_all_data | ( | compass2_t * | ctx, |
int16_t * | x, | ||
int16_t * | y, | ||
int16_t * | z ) |
Get all data function.
ctx | Click object. |
x | X axis. |
y | Y axis. |
z | Z axis. |
@description This function gets the data from all axes.
int16_t compass2_get_axis_data | ( | compass2_t * | ctx, |
uint8_t | axis ) |
Get one axis data function.
ctx | Click object. |
axis | Axis selector. |
@description This function gets the data from one specified axis.
uint8_t compass2_get_data_overrun | ( | compass2_t * | ctx | ) |
Get data overrun function.
ctx | Click object. |
@description This function returns the data overrun status.
uint8_t compass2_get_rdy | ( | compass2_t * | ctx | ) |
Get ready function.
ctx | Click object. |
@description This function returns the ready status.
float compass2_get_resolution_parameter | ( | uint8_t | res | ) |
Get resolution function.
res | Resolution mode selector. |
@description This function returns a 14 or 16 bit resolution transformation coefficient.
void compass2_i2c_disable | ( | compass2_t * | ctx | ) |
Switch from I2C to SPI mode function.
ctx | Click object. |
@description This function reads one byte from the desired register.
COMPASS2_RETVAL compass2_init | ( | compass2_t * | ctx, |
compass2_cfg_t * | cfg ) |
Initialization function.
compass2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void compass2_new_measurement | ( | compass2_t * | ctx | ) |
New measurement function.
ctx | Click object. |
@description This function prepares the device for a new measurement.
uint8_t compass2_read_byte | ( | compass2_t * | ctx, |
uint8_t | reg ) |
Read byte function.
ctx | Click object. |
reg | Register address. |
@description This function reads one byte from the desired register.
void compass2_reset | ( | compass2_t * | ctx | ) |
Hardware reset function.
ctx | Click object. |
@description This function does a hardware reset of the device.
void compass2_set_mode | ( | compass2_t * | ctx, |
uint8_t | mode ) |
Set output resolution function.
ctx | Click object. |
mode | Mode value. |
@description This function sets the output resolution mode.
void compass2_set_out_resolution | ( | compass2_t * | ctx, |
uint8_t | res ) |
Set output resolution function.
ctx | Click object. |
res | Resolution value. |
@description This function sets the output resolution.
void compass2_software_reset | ( | compass2_t * | ctx | ) |
Software reset function.
ctx | Click object. |
@description This function does a software reset of the module.
void compass2_write_byte | ( | compass2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_buf ) |
Write byte function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
@description This function writes one byte to the desired register.