c3dhall5 2.0.0.0
Public function

Functions

void c3dhall5_cfg_setup (c3dhall5_cfg_t *cfg)
 Config Object Initialization function.
 
C3DHALL5_RETVAL c3dhall5_init (c3dhall5_t *ctx, c3dhall5_cfg_t *cfg)
 Initialization function.
 
void c3dhall5_default_cfg (c3dhall5_t *ctx)
 Click Default Configuration function.
 
void c3dhall5_generic_write (c3dhall5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void c3dhall5_generic_read (c3dhall5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t c3dhall5_get_device_id (c3dhall5_t *ctx)
 Device ID.
 
float c3dhall5_get_temperature_data (c3dhall5_t *ctx)
 Temperature data.
 
uint8_t c3dhall5_get_interrupt_state (c3dhall5_t *ctx)
 Interrupt state.
 
void c3dhall5_set_offset (c3dhall5_t *ctx, uint8_t offset_axis, int16_t offset)
 Set offest.
 
int16_t c3dhall5_get_axis_data (c3dhall5_t *ctx, uint8_t axis)
 Axis data.
 

Detailed Description

Function Documentation

◆ c3dhall5_cfg_setup()

void c3dhall5_cfg_setup ( c3dhall5_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ c3dhall5_default_cfg()

void c3dhall5_default_cfg ( c3dhall5_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for 3DHall5 click.

Note
Default configuration of the chip contains the settings : Config A:
  • C3DHALL5_CFG_A_COMP_TEMP_ENABLE Config C:
    • C3DHALL5_CFG_C_DRDY_ON_PIN

◆ c3dhall5_generic_read()

void c3dhall5_generic_read ( c3dhall5_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function reads data from the desired register.

◆ c3dhall5_generic_write()

void c3dhall5_generic_write ( c3dhall5_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function writes data to the desired register.

◆ c3dhall5_get_axis_data()

int16_t c3dhall5_get_axis_data ( c3dhall5_t * ctx,
uint8_t axis )

Axis data.

Parameters
ctxClick object.
axisThe axis to be read
Returns
Axis data

◆ c3dhall5_get_device_id()

uint8_t c3dhall5_get_device_id ( c3dhall5_t * ctx)

Device ID.

Parameters
ctxClick object.
Returns
Device ID ( C3DHALL5_I_AM )

@description You can use this function as a check to communicate a click with your MCU.

◆ c3dhall5_get_interrupt_state()

uint8_t c3dhall5_get_interrupt_state ( c3dhall5_t * ctx)

Interrupt state.

Parameters
ctxClick object.
Returns
Interrupt state on INT pin

◆ c3dhall5_get_temperature_data()

float c3dhall5_get_temperature_data ( c3dhall5_t * ctx)

Temperature data.

Parameters
ctxClick object.
Returns
Temperature data in C

@description Function for checking and reading temperature.

◆ c3dhall5_init()

C3DHALL5_RETVAL c3dhall5_init ( c3dhall5_t * ctx,
c3dhall5_cfg_t * cfg )

Initialization function.

Parameters
c3dhall5Click object.
cfgClick configuration structure.

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

◆ c3dhall5_set_offset()

void c3dhall5_set_offset ( c3dhall5_t * ctx,
uint8_t offset_axis,
int16_t offset )

Set offest.

Parameters
ctxClick object.
offset_axisThe axis for which you set off
offsetOffset data to be set