compass3 2.0.0.0
Public function

Functions

void compass3_cfg_setup (compass3_cfg_t *cfg)
 Config Object Initialization function.
 
COMPASS3_RETVAL compass3_init (compass3_t *ctx, compass3_cfg_t *cfg)
 Initialization function.
 
void compass3_default_cfg (compass3_t *ctx)
 Click Default Configuration function.
 
void compass3_generic_write (compass3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void compass3_generic_read (compass3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void compass3_full_measurement (compass3_t *ctx, float *x_val, float *y_val, float *z_val)
 Full measurement function.
 
float compass3_read_temp (compass3_t *ctx)
 Read temperature function.
 
uint8_t compass3_check_int (compass3_t *ctx)
 Check interrupt function.
 

Detailed Description

Function Documentation

◆ compass3_cfg_setup()

void compass3_cfg_setup ( compass3_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.

◆ compass3_check_int()

uint8_t compass3_check_int ( compass3_t * ctx)

Check interrupt function.

Parameters
ctxClick object.
Returns
1 - Interrupt has occured / 0 - Interrupt has not occured

@description Function checks interrupt occurence.

◆ compass3_default_cfg()

void compass3_default_cfg ( compass3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Compass3 click.

◆ compass3_full_measurement()

void compass3_full_measurement ( compass3_t * ctx,
float * x_val,
float * y_val,
float * z_val )

Full measurement function.

Parameters
ctxClick object.
x_valfloat value of magnetic field across X-axis
y_valfloat value of magnetic field across Y-axis
z_valfloat value of magnetic field across Z-axis

@description Measures magnetic field surrounding the device.

◆ compass3_generic_read()

void compass3_generic_read ( compass3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

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

@description This function reads data from the desired register.

◆ compass3_generic_write()

void compass3_generic_write ( compass3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

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

@description This function writes data to the desired register.

◆ compass3_init()

COMPASS3_RETVAL compass3_init ( compass3_t * ctx,
compass3_cfg_t * cfg )

Initialization function.

Parameters
compass3Click object.
cfgClick configuration structure.

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

◆ compass3_read_temp()

float compass3_read_temp ( compass3_t * ctx)

Read temperature function.

Parameters
ctxClick object.
Returns
float temperature value.

@description Function is used to measure temperature.