magneto11 2.0.0.0
|
API for configuring and manipulating Magneto 11 Click driver. More...
Topics | |
Magneto 11 Registers List | |
List of registers of Magneto 11 Click driver. | |
Magneto 11 Registers Settings | |
Settings for registers of Magneto 11 Click driver. | |
Magneto 11 MikroBUS Map | |
MikroBUS pin mapping of Magneto 11 Click driver. | |
Functions | |
void | magneto11_cfg_setup (magneto11_cfg_t *cfg) |
Magneto 11 configuration object setup function. | |
err_t | magneto11_init (magneto11_t *ctx, magneto11_cfg_t *cfg) |
Magneto 11 initialization function. | |
err_t | magneto11_default_cfg (magneto11_t *ctx) |
Magneto 11 default configuration function. | |
err_t | magneto11_generic_write (magneto11_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Magneto 11 I2C writing function. | |
err_t | magneto11_generic_read (magneto11_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Magneto 11 I2C reading function. | |
err_t | magneto11_get_magnetic_field (magneto11_t *ctx, float *mag_field) |
Magneto 11 get magnetic field function. | |
err_t | magneto11_get_offset (magneto11_t *ctx, uint16_t *offset) |
Magneto 11 get offset function. | |
err_t | magneto11_set_config (magneto11_t *ctx, uint8_t config) |
Magneto 11 set config function. | |
err_t | magneto11_set_sensitivity (magneto11_t *ctx, uint8_t sensitivity) |
Magneto 11 set sensitivity function. | |
API for configuring and manipulating Magneto 11 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void magneto11_cfg_setup | ( | magneto11_cfg_t * | cfg | ) |
Magneto 11 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneto11_cfg_t object definition for detailed explanation. |
err_t magneto11_default_cfg | ( | magneto11_t * | ctx | ) |
Magneto 11 default configuration function.
This function executes a default configuration of Magneto 11 click board.
[in] | ctx | : Click context object. See magneto11_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto11_generic_read | ( | magneto11_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Magneto 11 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 magneto11_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 magneto11_generic_write | ( | magneto11_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Magneto 11 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 magneto11_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 magneto11_get_magnetic_field | ( | magneto11_t * | ctx, |
float * | mag_field ) |
Magneto 11 get magnetic field function.
This function reads the magnetic field strength in milliTesla.
[in] | ctx | : Click context object. See magneto11_t object definition for detailed explanation. |
[out] | mag_field | : Magnetic field strength in milliTesla. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto11_get_offset | ( | magneto11_t * | ctx, |
uint16_t * | offset ) |
Magneto 11 get offset function.
This function reads the offset register value.
[in] | ctx | : Click context object. See magneto11_t object definition for detailed explanation. |
[out] | offset | : Offset register value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto11_init | ( | magneto11_t * | ctx, |
magneto11_cfg_t * | cfg ) |
Magneto 11 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneto11_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneto11_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto11_set_config | ( | magneto11_t * | ctx, |
uint8_t | config ) |
Magneto 11 set config function.
This function writes specified data to the config register.
[in] | ctx | : Click context object. See magneto11_t object definition for detailed explanation. |
[in] | config | : Config register value [bit 2 - speed mode, bit 1 - polarity, bit 0 - operating mode]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto11_set_sensitivity | ( | magneto11_t * | ctx, |
uint8_t | sensitivity ) |
Magneto 11 set sensitivity function.
This function writes specified data to the sensitivity register.
[in] | ctx | : Click context object. See magneto11_t object definition for detailed explanation. |
[in] | sensitivity | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation.