magneto10 2.0.0.0
Magneto 10 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ magneto10_cfg_setup()

void magneto10_cfg_setup ( magneto10_cfg_t * cfg)

Magneto 10 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See magneto10_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ magneto10_check_communication()

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.

Parameters
[in]ctx: Click context object. See magneto10_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_check_data_ready()

err_t magneto10_check_data_ready ( magneto10_t * ctx)

Magneto 10 check data ready function.

This function checks if the data is ready.

Parameters
[in]ctx: Click context object. See magneto10_t object definition for detailed explanation.
Returns
  • 1 - Data is ready,
  • 0 - Data is not ready,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_default_cfg()

err_t magneto10_default_cfg ( magneto10_t * ctx)

Magneto 10 default configuration function.

This function executes a default configuration of Magneto 10 click board.

Parameters
[in]ctx: Click context object. See magneto10_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ magneto10_enable_temperature_sensor()

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

Parameters
[in]ctx: Click context object. See magneto10_t object definition for detailed explanation.
[in]enable:
  • 1 - Enable,
  • 0 - Disable.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_get_magnetic_flux()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_get_temperature()

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.

Parameters
[in]ctx: Click context object. See magneto10_t object definition for detailed explanation.
[out]temperature: Internal temperature data in Celsius.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_mem_direct_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_mem_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_mem_write_multiple()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_mem_write_single()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_reset()

err_t magneto10_reset ( magneto10_t * ctx)

Magneto 10 reset function.

This function resets the device to factory settings.

Parameters
[in]ctx: Click context object. See magneto10_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto10_set_operating_mode()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.