compass5 2.0.0.0
|
API for configuring and manipulating Compass 5 Click driver. More...
Topics | |
Compass 5 Registers List | |
List of registers of Compass 5 Click driver. | |
Compass 5 Registers Settings | |
Settings for registers of Compass 5 Click driver. | |
Compass 5 MikroBUS Map | |
MikroBUS pin mapping of Compass 5 Click driver. | |
Functions | |
void | compass5_cfg_setup (compass5_cfg_t *cfg) |
Compass 5 configuration object setup function. | |
err_t | compass5_init (compass5_t *ctx, compass5_cfg_t *cfg) |
Compass 5 initialization function. | |
err_t | compass5_generic_write (compass5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Compass 5 I2C writing function. | |
err_t | compass5_generic_read (compass5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Compass 5 I2C reading function. | |
void | compass5_write_byte (compass5_t *ctx, uint8_t reg, uint8_t tx_data) |
Compass 5 write byte function. | |
uint8_t | compass5_read_byte (compass5_t *ctx, uint8_t reg) |
Compass 5 read 1 byte function. | |
void | compass5_sw_reset (compass5_t *ctx) |
Compass 5 software reset function. | |
void | compass5_get_id (compass5_t *ctx, uint8_t *company_id, uint8_t *device_id) |
Compass 5 get ID function. | |
uint8_t | compass5_check_data_ready (compass5_t *ctx) |
Compass 5 check data ready function. | |
uint8_t | compass5_check_data_overrun (compass5_t *ctx) |
Compass 5 check data overrun function. | |
uint8_t | compass5_set_operation_mode (compass5_t *ctx, uint8_t op_mode) |
Compass 5 set operation mode function. | |
uint8_t | compass5_get_operation_mode (compass5_t *ctx) |
Compass 5 get operation mode function. | |
void | compass5_measurement_axis (compass5_t *ctx, int16_t *axis_x, int16_t *axis_y, int16_t *axis_z) |
Compass 5 full measurement axis function. | |
void | compass5_get_mag_data (compass5_t *ctx, int16_t *axis_x, int16_t *axis_y, int16_t *axis_z) |
Compass 5 full measurement axis function. | |
API for configuring and manipulating Compass 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void compass5_cfg_setup | ( | compass5_cfg_t * | cfg | ) |
Compass 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See compass5_cfg_t object definition for detailed explanation. |
uint8_t compass5_check_data_overrun | ( | compass5_t * | ctx | ) |
Compass 5 check data overrun function.
This function for check data overrun.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
uint8_t compass5_check_data_ready | ( | compass5_t * | ctx | ) |
Compass 5 check data ready function.
This function for check data ready.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
err_t compass5_generic_read | ( | compass5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Compass 5 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 compass5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t compass5_generic_write | ( | compass5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Compass 5 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 compass5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.void compass5_get_id | ( | compass5_t * | ctx, |
uint8_t * | company_id, | ||
uint8_t * | device_id ) |
Compass 5 get ID function.
This function for get ID.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
[out] | company_id | : Company ID - WIA1. |
[out] | device_id | : Device ID - WIA2. |
void compass5_get_mag_data | ( | compass5_t * | ctx, |
int16_t * | axis_x, | ||
int16_t * | axis_y, | ||
int16_t * | axis_z ) |
Compass 5 full measurement axis function.
This function for full measurement axis.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
[out] | axis_x | : x-axis. |
[out] | axis_y | : y-axis. |
[out] | axis_z | : z-axis. |
uint8_t compass5_get_operation_mode | ( | compass5_t * | ctx | ) |
Compass 5 get operation mode function.
This function for get operation mode.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
err_t compass5_init | ( | compass5_t * | ctx, |
compass5_cfg_t * | cfg ) |
Compass 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See compass5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See compass5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void compass5_measurement_axis | ( | compass5_t * | ctx, |
int16_t * | axis_x, | ||
int16_t * | axis_y, | ||
int16_t * | axis_z ) |
Compass 5 full measurement axis function.
This function for full measurement axis.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
[out] | axis_x | : x-axis. |
[out] | axis_y | : y-axis. |
[out] | axis_z | : z-axis. |
uint8_t compass5_read_byte | ( | compass5_t * | ctx, |
uint8_t | reg ) |
Compass 5 read 1 byte function.
This function read 1 byte.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
[out] | reg | : 8-bit register address. |
uint8_t compass5_set_operation_mode | ( | compass5_t * | ctx, |
uint8_t | op_mode ) |
Compass 5 set operation mode function.
This function for set operation mode.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
[in] | op_mode | : Operation mode. |
0
- Success, -1
- Error. void compass5_sw_reset | ( | compass5_t * | ctx | ) |
Compass 5 software reset function.
This function for software reset.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
void compass5_write_byte | ( | compass5_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_data ) |
Compass 5 write byte function.
This function write byte.
[out] | ctx | : Click configuration structure. See compass5_t object definition for detailed explanation. |
[in] | reg | : 8-bit register address. |
[in] | tx_data | : 8-bit write data. |