compass6 2.0.0.0
Compass 6 Click Driver

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

Topics

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

Functions

void compass6_cfg_setup (compass6_cfg_t *cfg)
 Compass 6 configuration object setup function.
 
err_t compass6_init (compass6_t *ctx, compass6_cfg_t *cfg)
 Compass 6 initialization function.
 
err_t compass6_default_cfg (compass6_t *ctx)
 Compass 6 default configuration function.
 
err_t compass6_generic_write (compass6_t *ctx, uint8_t reg, uint8_t tx_data)
 Compass 6 I2C writing function.
 
err_t compass6_generic_read (compass6_t *ctx, uint8_t reg, uint8_t *rx_data)
 Compass 6 I2C reading function.
 
uint8_t compass6_data_ready (compass6_t *ctx)
 Get data ready pin state.
 
err_t compass6_get_axes_data (compass6_t *ctx, compass6_axes_t *axes_data)
 Magnetic axes data reading.
 

Detailed Description

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

◆ compass6_cfg_setup()

void compass6_cfg_setup ( compass6_cfg_t * cfg)

Compass 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ compass6_data_ready()

uint8_t compass6_data_ready ( compass6_t * ctx)

Get data ready pin state.

This function reads logic state of data ready(interrupt) pin.

Parameters
[in]ctx: Click context object. See #accel4_t object definition for detailed explanation.
Returns
State of data ready.

◆ compass6_default_cfg()

err_t compass6_default_cfg ( compass6_t * ctx)

Compass 6 default configuration function.

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

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

◆ compass6_generic_read()

err_t compass6_generic_read ( compass6_t * ctx,
uint8_t reg,
uint8_t * rx_data )

Compass 6 I2C reading function.

This function reads a byte from the selected register.

Parameters
[in]ctx: Click context object. See compass6_t object definition for detailed explanation.
[in]reg: Register address.
[out]rx_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ compass6_generic_write()

err_t compass6_generic_write ( compass6_t * ctx,
uint8_t reg,
uint8_t tx_data )

Compass 6 I2C writing function.

This function writes a byte to the selected register.

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

◆ compass6_get_axes_data()

err_t compass6_get_axes_data ( compass6_t * ctx,
compass6_axes_t * axes_data )

Magnetic axes data reading.

This function reads a magnetic axes data.

Parameters
[in]ctx: Click context object. See compass6_t object definition for detailed explanation.
[out]axes: Axes data object. See compass6_axes_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ compass6_init()

err_t compass6_init ( compass6_t * ctx,
compass6_cfg_t * cfg )

Compass 6 initialization function.

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

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