c3dhall8 2.0.0.0
3D Hall 8 Click Driver

API for configuring and manipulating 3D Hall 8 Click driver. More...

Topics

 3D Hall 8 Registers List
 List of registers of 3D Hall 8 Click driver.
 
 3D Hall 8 Registers Settings
 Settings for registers of 3D Hall 8 Click driver.
 
 3D Hall 8 MikroBUS Map
 MikroBUS pin mapping of 3D Hall 8 Click driver.
 

Functions

void c3dhall8_cfg_setup (c3dhall8_cfg_t *cfg)
 3D Hall 8 configuration object setup function.
 
err_t c3dhall8_init (c3dhall8_t *ctx, c3dhall8_cfg_t *cfg)
 3D Hall 8 initialization function.
 
err_t c3dhall8_default_cfg (c3dhall8_t *ctx)
 3D Hall 8 default configuration function.
 
err_t c3dhall8_generic_write (c3dhall8_t *ctx, uint8_t reg, uint8_t tx_buf)
 3D Hall 8 I2C writing function.
 
err_t c3dhall8_generic_read (c3dhall8_t *ctx, uint8_t reg, uint8_t *rx_buf)
 3D Hall 8 I2C reading function.
 
void c3dhall8_read_sensor_data (c3dhall8_t *ctx, c3dhall8_data_t *sensor_data)
 Reading sensor data function.
 
float c3dhall8_get_xyz_magnetic_matching (c3dhall8_t *ctx, c3dhall8_data_t sensor_data)
 Calculating magnetic matching.
 
float c3dhall8_get_xy_magnetic_matching (c3dhall8_t *ctx, c3dhall8_data_t sensor_data)
 Calculating magnetic matching.
 

Detailed Description

API for configuring and manipulating 3D Hall 8 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

◆ c3dhall8_cfg_setup()

void c3dhall8_cfg_setup ( c3dhall8_cfg_t * cfg)

3D Hall 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ c3dhall8_default_cfg()

err_t c3dhall8_default_cfg ( c3dhall8_t * ctx)

3D Hall 8 default configuration function.

This function executes a default configuration of 3D Hall 8 click board.

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

◆ c3dhall8_generic_read()

err_t c3dhall8_generic_read ( c3dhall8_t * ctx,
uint8_t reg,
uint8_t * rx_buf )

3D Hall 8 I2C reading function.

This function reads a data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See c3dhall8_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall8_generic_write()

err_t c3dhall8_generic_write ( c3dhall8_t * ctx,
uint8_t reg,
uint8_t tx_buf )

3D Hall 8 I2C writing function.

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

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

◆ c3dhall8_get_xy_magnetic_matching()

float c3dhall8_get_xy_magnetic_matching ( c3dhall8_t * ctx,
c3dhall8_data_t sensor_data )

Calculating magnetic matching.

This function calculates magnetic matching from data sensor_data for x and y axes.

Parameters
[in]ctx: Click context object. See c3dhall8_t object definition for detailed explanation.
[in]sensor_data: Read sensor data. See c3dhall8_data_t object definition for detailed explanation.
Returns
Calculated magnetic matching. See #err_t definition for detailed explanation.

◆ c3dhall8_get_xyz_magnetic_matching()

float c3dhall8_get_xyz_magnetic_matching ( c3dhall8_t * ctx,
c3dhall8_data_t sensor_data )

Calculating magnetic matching.

This function calculates magnetic matching from data sensor_data for x, y and z axes.

Parameters
[in]ctx: Click context object. See c3dhall8_t object definition for detailed explanation.
[in]sensor_data: Read sensor data. See c3dhall8_data_t object definition for detailed explanation.
Returns
Calculated magnetic matching. See #err_t definition for detailed explanation.

◆ c3dhall8_init()

err_t c3dhall8_init ( c3dhall8_t * ctx,
c3dhall8_cfg_t * cfg )

3D Hall 8 initialization function.

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

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

◆ c3dhall8_read_sensor_data()

void c3dhall8_read_sensor_data ( c3dhall8_t * ctx,
c3dhall8_data_t * sensor_data )

Reading sensor data function.

This function reads x, y, z axes and temperature from device.

Parameters
[in]ctx: Click context object. See c3dhall8_t object definition for detailed explanation.
[out]sensor_data: Output sensor data. See c3dhall8_data_t object definition for detailed explanation.
Returns
Nothing. See #err_t definition for detailed explanation.