c3dhall14  2.1.0.0
Modules | Functions
3D Hall 14 Click Driver

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

Modules

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

Functions

void c3dhall14_cfg_setup (c3dhall14_cfg_t *cfg)
 3D Hall 14 configuration object setup function. More...
 
err_t c3dhall14_init (c3dhall14_t *ctx, c3dhall14_cfg_t *cfg)
 3D Hall 14 initialization function. More...
 
err_t c3dhall14_default_cfg (c3dhall14_t *ctx)
 3D Hall 14 default configuration function. More...
 
err_t c3dhall14_mem_write_single (c3dhall14_t *ctx, uint8_t reg, uint8_t data_in)
 3D Hall 14 mem write single function. More...
 
err_t c3dhall14_mem_write_multi (c3dhall14_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 3D Hall 14 mem write multi function. More...
 
err_t c3dhall14_mem_direct_read (c3dhall14_t *ctx, uint8_t *data_out, uint8_t len)
 3D Hall 14 mem direct read function. More...
 
err_t c3dhall14_mem_read (c3dhall14_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 3D Hall 14 mem read function. More...
 
err_t c3dhall14_check_communication (c3dhall14_t *ctx)
 3D Hall 14 check communication function. More...
 
uint8_t c3dhall14_get_int_pin (c3dhall14_t *ctx)
 3D Hall 14 get int pin function. More...
 
err_t c3dhall14_check_data_ready (c3dhall14_t *ctx)
 3D Hall 14 check data ready function. More...
 
err_t c3dhall14_get_magnetic_flux (c3dhall14_t *ctx, float *x_axis, float *y_axis, float *z_axis)
 3D Hall 14 get magnetic flux function. More...
 
err_t c3dhall14_get_temperature (c3dhall14_t *ctx, float *temperature)
 3D Hall 14 get temperature function. More...
 
err_t c3dhall14_reset (c3dhall14_t *ctx)
 3D Hall 14 reset function. More...
 
err_t c3dhall14_set_operating_mode (c3dhall14_t *ctx, uint8_t mode)
 3D Hall 14 set operating mode function. More...
 
err_t c3dhall14_set_range (c3dhall14_t *ctx, uint8_t range)
 3D Hall 14 set range function. More...
 
err_t c3dhall14_enable_temp_sensor (c3dhall14_t *ctx, uint8_t enable)
 3D Hall 14 enable temp sensor function. More...
 
err_t c3dhall14_enable_drdy_int (c3dhall14_t *ctx, uint8_t enable)
 3D Hall 14 enable drdy int function. More...
 

Detailed Description

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

◆ c3dhall14_cfg_setup()

void c3dhall14_cfg_setup ( c3dhall14_cfg_t cfg)

3D Hall 14 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ c3dhall14_check_communication()

err_t c3dhall14_check_communication ( c3dhall14_t ctx)

3D Hall 14 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 c3dhall14_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall14_check_data_ready()

err_t c3dhall14_check_data_ready ( c3dhall14_t ctx)

3D Hall 14 check data ready function.

This function checks if the data is ready.

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

◆ c3dhall14_default_cfg()

err_t c3dhall14_default_cfg ( c3dhall14_t ctx)

3D Hall 14 default configuration function.

This function executes a default configuration of 3D Hall 14 Click board.

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

◆ c3dhall14_enable_drdy_int()

err_t c3dhall14_enable_drdy_int ( c3dhall14_t ctx,
uint8_t  enable 
)

3D Hall 14 enable drdy int function.

This function enables or disables the data ready interrupt output.

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

◆ c3dhall14_enable_temp_sensor()

err_t c3dhall14_enable_temp_sensor ( c3dhall14_t ctx,
uint8_t  enable 
)

3D Hall 14 enable temp sensor function.

This function enables or disables the internal temperature sensor.

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

◆ c3dhall14_get_int_pin()

uint8_t c3dhall14_get_int_pin ( c3dhall14_t ctx)

3D Hall 14 get int pin function.

This function returns the INT pin logic state.

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

◆ c3dhall14_get_magnetic_flux()

err_t c3dhall14_get_magnetic_flux ( c3dhall14_t ctx,
float *  x_axis,
float *  y_axis,
float *  z_axis 
)

3D Hall 14 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 c3dhall14_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.

◆ c3dhall14_get_temperature()

err_t c3dhall14_get_temperature ( c3dhall14_t ctx,
float *  temperature 
)

3D Hall 14 get temperature function.

This function reads the raw temperature value and converts it to Celsius.

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

◆ c3dhall14_init()

err_t c3dhall14_init ( c3dhall14_t ctx,
c3dhall14_cfg_t cfg 
)

3D Hall 14 initialization function.

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

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

◆ c3dhall14_mem_direct_read()

err_t c3dhall14_mem_direct_read ( c3dhall14_t ctx,
uint8_t *  data_out,
uint8_t  len 
)

3D Hall 14 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 c3dhall14_t object definition for detailed explanation.
[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.

◆ c3dhall14_mem_read()

err_t c3dhall14_mem_read ( c3dhall14_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

3D Hall 14 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 c3dhall14_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.

◆ c3dhall14_mem_write_multi()

err_t c3dhall14_mem_write_multi ( c3dhall14_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

3D Hall 14 mem write multi 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 c3dhall14_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall14_mem_write_single()

err_t c3dhall14_mem_write_single ( c3dhall14_t ctx,
uint8_t  reg,
uint8_t  data_in 
)

3D Hall 14 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 c3dhall14_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall14_reset()

err_t c3dhall14_reset ( c3dhall14_t ctx)

3D Hall 14 reset function.

This function resets the device to factory settings.

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

◆ c3dhall14_set_operating_mode()

err_t c3dhall14_set_operating_mode ( c3dhall14_t ctx,
uint8_t  mode 
)

3D Hall 14 set operating mode function.

This function sets the device operating mode.

Parameters
[in]ctx: Click context object. See c3dhall14_t object definition for detailed explanation.
[in]mode: Operating mode. See 3D Hall 14 operating mode values macros definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall14_set_range()

err_t c3dhall14_set_range ( c3dhall14_t ctx,
uint8_t  range 
)

3D Hall 14 set range function.

This function sets the magnetic flux measurement range.

Parameters
[in]ctx: Click context object. See c3dhall14_t object definition for detailed explanation.
[in]range:
  • 0 - Low current,
  • 1 - Low noise,
  • 2 - High range.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.