c3dhall10 2.0.0.0
3D Hall 10 Click Driver

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

Topics

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

Functions

void c3dhall10_cfg_setup (c3dhall10_cfg_t *cfg)
 3D Hall 10 configuration object setup function.
 
err_t c3dhall10_init (c3dhall10_t *ctx, c3dhall10_cfg_t *cfg)
 3D Hall 10 initialization function.
 
err_t c3dhall10_default_cfg (c3dhall10_t *ctx)
 3D Hall 10 default configuration function.
 
err_t c3dhall10_write_frame (c3dhall10_t *ctx, uint8_t reg_addr, uint16_t data_in)
 3D Hall 10 write frame function.
 
err_t c3dhall10_read_frame (c3dhall10_t *ctx, uint8_t reg_addr, uint16_t *data_out, uint16_t *status)
 3D Hall 10 read frame function.
 
err_t c3dhall10_read_data (c3dhall10_t *ctx, c3dhall10_data_t *data_out)
 3D Hall 10 read data function.
 
uint8_t c3dhall10_get_alert_pin (c3dhall10_t *ctx)
 3D Hall 10 get alert pin function.
 

Detailed Description

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

◆ c3dhall10_cfg_setup()

void c3dhall10_cfg_setup ( c3dhall10_cfg_t * cfg)

3D Hall 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ c3dhall10_default_cfg()

err_t c3dhall10_default_cfg ( c3dhall10_t * ctx)

3D Hall 10 default configuration function.

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

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

◆ c3dhall10_get_alert_pin()

uint8_t c3dhall10_get_alert_pin ( c3dhall10_t * ctx)

3D Hall 10 get alert pin function.

This function returns the alert (ALR) pin logic state. The alert pin is configured as a conversion complete interrupt by default.

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

◆ c3dhall10_init()

err_t c3dhall10_init ( c3dhall10_t * ctx,
c3dhall10_cfg_t * cfg )

3D Hall 10 initialization function.

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

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

◆ c3dhall10_read_data()

err_t c3dhall10_read_data ( c3dhall10_t * ctx,
c3dhall10_data_t * data_out )

3D Hall 10 read data function.

This function reads new data which consists of X, Y, and Z axis values in mT, and temperature in Celsius. It also reads the angle in Degrees between X and Y by default, and magnitude data as well.

Parameters
[in]ctx: Click context object. See c3dhall10_t object definition for detailed explanation.
[out]data_out: 16-bit data output read. See c3dhall10_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall10_read_frame()

err_t c3dhall10_read_frame ( c3dhall10_t * ctx,
uint8_t reg_addr,
uint16_t * data_out,
uint16_t * status )

3D Hall 10 read frame function.

This function reads data and status from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See c3dhall10_t object definition for detailed explanation.
[in]reg_addr: Register address.
[out]data_out: 16-bit data output read.
[out]status: 12-bit status output read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The CRC must be enabled and CMD bits are fixed to 0.

◆ c3dhall10_write_frame()

err_t c3dhall10_write_frame ( c3dhall10_t * ctx,
uint8_t reg_addr,
uint16_t data_in )

3D Hall 10 write frame function.

This function writes a desired data to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See c3dhall10_t object definition for detailed explanation.
[in]reg_addr: Register address.
[in]data_in: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
CMD bits are fixed to 0.