magneto6 2.1.0.0
Magneto 6 Click Driver

API for configuring and manipulating Magneto 6 Click driver. More...

Topics

 Magneto 6 Registers List
 List of registers of Magneto 6 Click driver.
 
 Magneto 6 Registers Settings
 Settings for registers of Magneto 6 Click driver.
 
 Magneto 6 MikroBUS Map
 MikroBUS pin mapping of Magneto 6 Click driver.
 

Functions

void magneto6_cfg_setup (magneto6_cfg_t *cfg)
 Magneto 6 configuration object setup function.
 
err_t magneto6_init (magneto6_t *ctx, magneto6_cfg_t *cfg)
 Magneto 6 initialization function.
 
err_t magneto6_default_cfg (magneto6_t *ctx)
 Magneto 6 default configuration function.
 
err_t magneto6_write_reg (magneto6_t *ctx, uint8_t reg, uint8_t data_in)
 Magneto 6 write reg function.
 
err_t magneto6_read_reg (magneto6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Magneto 6 read reg function.
 
void magneto6_set_ien_pin (magneto6_t *ctx, uint8_t state)
 Magneto 6 set ien pin function.
 
uint8_t magneto6_get_int_pin (magneto6_t *ctx)
 Magneto 6 get int pin function.
 
err_t magneto6_read_data (magneto6_t *ctx, magneto6_data_t *data_out)
 Magneto 6 read data function.
 

Detailed Description

API for configuring and manipulating Magneto 6 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

◆ magneto6_cfg_setup()

void magneto6_cfg_setup ( magneto6_cfg_t * cfg)

Magneto 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ magneto6_default_cfg()

err_t magneto6_default_cfg ( magneto6_t * ctx)

Magneto 6 default configuration function.

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

Parameters
[in]ctx: Click context object. See magneto6_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.

◆ magneto6_get_int_pin()

uint8_t magneto6_get_int_pin ( magneto6_t * ctx)

Magneto 6 get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See magneto6_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ magneto6_init()

err_t magneto6_init ( magneto6_t * ctx,
magneto6_cfg_t * cfg )

Magneto 6 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See magneto6_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See magneto6_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magneto6_read_data()

err_t magneto6_read_data ( magneto6_t * ctx,
magneto6_data_t * data_out )

Magneto 6 read data function.

This function reads the measurements of the 3-axes magnetic field sensor in mT and the temperature sensor in degrees Celsius.

Parameters
[in]ctx: Click context object. See magneto6_t object definition for detailed explanation.
[out]data_out: Output read data. See magneto6_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magneto6_read_reg()

err_t magneto6_read_reg ( magneto6_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Magneto 6 read reg 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 magneto6_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magneto6_set_ien_pin()

void magneto6_set_ien_pin ( magneto6_t * ctx,
uint8_t state )

Magneto 6 set ien pin function.

This function sets the IEN pin logic state.

Parameters
[in]ctx: Click context object. See magneto6_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ magneto6_write_reg()

err_t magneto6_write_reg ( magneto6_t * ctx,
uint8_t reg,
uint8_t data_in )

Magneto 6 write reg function.

This function writes a data byte to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See magneto6_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.