compass7 2.0.0.0
|
API for configuring and manipulating Compass 7 Click driver. More...
Topics | |
Compass 7 Registers List | |
List of registers of Compass 7 Click driver. | |
Compass 7 Registers Settings | |
Settings for registers of Compass 7 Click driver. | |
Compass 7 MikroBUS Map | |
MikroBUS pin mapping of Compass 7 Click driver. | |
Functions | |
void | compass7_cfg_setup (compass7_cfg_t *cfg) |
Compass 7 configuration object setup function. | |
err_t | compass7_init (compass7_t *ctx, compass7_cfg_t *cfg) |
Compass 7 initialization function. | |
err_t | compass7_default_cfg (compass7_t *ctx) |
Compass 7 default configuration function. | |
err_t | compass7_generic_write (compass7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Compass 7 I2C writing function. | |
err_t | compass7_generic_read (compass7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Compass 7 I2C reading function. | |
err_t | compass7_write_register (compass7_t *ctx, uint8_t reg, uint8_t data_in) |
Compass 7 write register function. | |
err_t | compass7_read_register (compass7_t *ctx, uint8_t reg, uint8_t *data_out) |
Compass 7 read register function. | |
err_t | compass7_check_communication (compass7_t *ctx) |
Compass 7 check communication function. | |
err_t | compass7_soft_reset (compass7_t *ctx) |
Compass 7 soft reset function. | |
err_t | compass7_set_measurement_mode (compass7_t *ctx, uint8_t mode) |
Compass 7 set measurement mode function. | |
err_t | compass7_get_magnetic_flux (compass7_t *ctx, compass7_magnetic_flux_t *flux) |
Compass 7 get magnetic flux function. | |
err_t | compass7_get_temperature (compass7_t *ctx, float *temperature) |
Compass 7 get temperature function. | |
API for configuring and manipulating Compass 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void compass7_cfg_setup | ( | compass7_cfg_t * | cfg | ) |
Compass 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See compass7_cfg_t object definition for detailed explanation. |
err_t compass7_check_communication | ( | compass7_t * | ctx | ) |
Compass 7 check communication function.
This function checks the communication by reading and verifying the product ID.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_default_cfg | ( | compass7_t * | ctx | ) |
Compass 7 default configuration function.
This function executes a default configuration of Compass 7 click board.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_generic_read | ( | compass7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Compass 7 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_generic_write | ( | compass7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Compass 7 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_get_magnetic_flux | ( | compass7_t * | ctx, |
compass7_magnetic_flux_t * | flux ) |
Compass 7 get magnetic flux function.
This function reads the raw values of X, Y, and Z axis and converts them to magnetic flux data in Gauss.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[out] | compass7_magnetic_flux_t | : Flux data of X, Y, and Z axis in Gauss. See compass7_magnetic_flux_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_get_temperature | ( | compass7_t * | ctx, |
float * | temperature ) |
Compass 7 get temperature function.
This function reads the temperature measurements in Celsius.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_init | ( | compass7_t * | ctx, |
compass7_cfg_t * | cfg ) |
Compass 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See compass7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_read_register | ( | compass7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Compass 7 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_set_measurement_mode | ( | compass7_t * | ctx, |
uint8_t | mode ) |
Compass 7 set measurement mode function.
This function sets the control and ODR registers for the selected measurement mode.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[in] | mode | : Measurement mode:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_soft_reset | ( | compass7_t * | ctx | ) |
Compass 7 soft reset function.
This function performs the software reset by setting a desired bit in the Control 1 register.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t compass7_write_register | ( | compass7_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Compass 7 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See compass7_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.