magneto10 2.0.0.0
|
API for configuring and manipulating Magneto 10 Click driver. More...
Topics | |
Magneto 10 Registers List | |
List of registers of Magneto 10 Click driver. | |
Magneto 10 Registers Settings | |
Settings for registers of Magneto 10 Click driver. | |
Magneto 10 MikroBUS Map | |
MikroBUS pin mapping of Magneto 10 Click driver. | |
Functions | |
void | magneto10_cfg_setup (magneto10_cfg_t *cfg) |
Magneto 10 configuration object setup function. | |
err_t | magneto10_init (magneto10_t *ctx, magneto10_cfg_t *cfg) |
Magneto 10 initialization function. | |
err_t | magneto10_default_cfg (magneto10_t *ctx) |
Magneto 10 default configuration function. | |
err_t | magneto10_mem_write_single (magneto10_t *ctx, uint8_t reg, uint8_t tx_data) |
Magneto 10 mem write single function. | |
err_t | magneto10_mem_write_multiple (magneto10_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Magneto 10 mem write multiple function. | |
err_t | magneto10_mem_direct_read (magneto10_t *ctx, uint8_t *rx_buf, uint8_t rx_len) |
Magneto 10 mem direct read function. | |
err_t | magneto10_mem_read (magneto10_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Magneto 10 mem read function. | |
err_t | magneto10_check_communication (magneto10_t *ctx) |
Magneto 10 check communication function. | |
err_t | magneto10_check_data_ready (magneto10_t *ctx) |
Magneto 10 check data ready function. | |
err_t | magneto10_get_magnetic_flux (magneto10_t *ctx, float *x_axis, float *y_axis, float *z_axis) |
Magneto 10 get magnetic flux function. | |
err_t | magneto10_get_temperature (magneto10_t *ctx, float *temperature) |
Magneto 10 get temperature function. | |
err_t | magneto10_reset (magneto10_t *ctx) |
Magneto 10 reset function. | |
err_t | magneto10_set_operating_mode (magneto10_t *ctx, uint8_t mode) |
Magneto 10 set operating mode function. | |
err_t | magneto10_enable_temperature_sensor (magneto10_t *ctx, uint8_t enable) |
Magneto 10 enable temperature sensor function. | |
API for configuring and manipulating Magneto 10 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void magneto10_cfg_setup | ( | magneto10_cfg_t * | cfg | ) |
Magneto 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneto10_cfg_t object definition for detailed explanation. |
err_t magneto10_check_communication | ( | magneto10_t * | ctx | ) |
Magneto 10 check communication function.
This function checks the communication by reading and verifying the company and device identification registers.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto10_check_data_ready | ( | magneto10_t * | ctx | ) |
Magneto 10 check data ready function.
This function checks if the data is ready.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
1
- Data is ready, 0
- Data is not ready, -1
- Error.err_t magneto10_default_cfg | ( | magneto10_t * | ctx | ) |
Magneto 10 default configuration function.
This function executes a default configuration of Magneto 10 click board.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto10_enable_temperature_sensor | ( | magneto10_t * | ctx, |
uint8_t | enable ) |
Magneto 10 enable temperature sensor function.
This function enables or disables the internal temperature sensor
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[in] | enable | :
|
0
- Success, -1
- Error.err_t magneto10_get_magnetic_flux | ( | magneto10_t * | ctx, |
float * | x_axis, | ||
float * | y_axis, | ||
float * | z_axis ) |
Magneto 10 get magnetic flux function.
This function reads the raw values of X, Y, and Z axis and converts them to magnetic flux data in microTesla.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[out] | x_axis | : X-axis data in microTesla. |
[out] | y_axis | : Y-axis data in microTesla. |
[out] | z_axis | : Z-axis data in microTesla. |
0
- Success, -1
- Error.err_t magneto10_get_temperature | ( | magneto10_t * | ctx, |
float * | temperature ) |
Magneto 10 get temperature function.
This function reads the raw temperature value and converts it to Celsius.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[out] | temperature | : Internal temperature data in Celsius. |
0
- Success, -1
- Error.err_t magneto10_init | ( | magneto10_t * | ctx, |
magneto10_cfg_t * | cfg ) |
Magneto 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneto10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto10_mem_direct_read | ( | magneto10_t * | ctx, |
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Magneto 10 mem direct read function.
This function reads a desired number of data bytes starting from the register at address 0x00 by using I2C serial interface.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t magneto10_mem_read | ( | magneto10_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Magneto 10 mem read 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 magneto10_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 magneto10_mem_write_multiple | ( | magneto10_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Magneto 10 mem write multiple 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 magneto10_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.err_t magneto10_mem_write_single | ( | magneto10_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_data ) |
Magneto 10 mem write single function.
This function writes a single data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_data | : Data to be written. |
0
- Success, -1
- Error.err_t magneto10_reset | ( | magneto10_t * | ctx | ) |
Magneto 10 reset function.
This function resets the device to factory settings.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto10_set_operating_mode | ( | magneto10_t * | ctx, |
uint8_t | mode ) |
Magneto 10 set operating mode function.
This function sets the device operating mode.
[in] | ctx | : Click context object. See magneto10_t object definition for detailed explanation. |
[in] | mode | : Operating mode. See Magneto 10 operating mode values macros definition for detailed explanation. |
0
- Success, -1
- Error.