magneto7 2.0.0.0
Public function

Functions

void magneto7_cfg_setup (magneto7_cfg_t *cfg)
 Config Object Initialization function.
 
MAGNETO7_RETVAL magneto7_init (magneto7_t *ctx, magneto7_cfg_t *cfg)
 Initialization function.
 
uint8_t magneto7_default_cfg (magneto7_t *ctx)
 Click Default Configuration function.
 
void magneto7_generic_write (magneto7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void magneto7_generic_read (magneto7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t magneto7_int_get (magneto7_t *ctx)
 Getting INT pin state function.
 
uint8_t magneto7_get_register (magneto7_t *ctx, uint8_t register_address, uint8_t *data_buffer, uint8_t n_data)
 Getting register value(s) function.
 
uint8_t magneto7_set_register (magneto7_t *ctx, uint8_t register_address, uint8_t *data_buffer, uint8_t n_data)
 Setting register value(s) function.
 
uint8_t magneto7_set_offset (magneto7_t *ctx, uint8_t offset_axis, uint8_t offset_value)
 Setting offset values function.
 
void magneto7_get_temperature (magneto7_t *ctx, uint16_t *device_temperature)
 Getting raw device temperature value function.
 
void magneto7_get_data (magneto7_t *ctx, int16_t *x_axis, int16_t *y_axis, int16_t *z_axis)
 Getting data function.
 
void magneto7_get_fine_data (magneto7_t *ctx, uint16_t *x_axis, uint16_t *y_axis, uint16_t *z_axis)
 Getting fine data function.
 
float magneto7_convert_to_ut (magneto7_t *ctx, int16_t raw_data, uint8_t sensor_resolution)
 Getting fine data function.
 
void magneto7_get_gain_para (magneto7_t *ctx, uint16_t *x_axis, uint16_t *y_axis, uint16_t *z_axis)
 Getting gain data function.
 

Detailed Description

Function Documentation

◆ magneto7_cfg_setup()

void magneto7_cfg_setup ( magneto7_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.

◆ magneto7_convert_to_ut()

float magneto7_convert_to_ut ( magneto7_t * ctx,
int16_t raw_data,
uint8_t sensor_resolution )

Getting fine data function.

Parameters
ctxClick object.
raw_dataRaw data.
sensor_resolutionsSensor resolution.

@description This function converts raw data by dividing raw data with 6 or 24 for 12bit or 14bit data.

◆ magneto7_default_cfg()

uint8_t magneto7_default_cfg ( magneto7_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Magneto7 click.

◆ magneto7_generic_read()

void magneto7_generic_read ( magneto7_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.

◆ magneto7_generic_write()

void magneto7_generic_write ( magneto7_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.

◆ magneto7_get_data()

void magneto7_get_data ( magneto7_t * ctx,
int16_t * x_axis,
int16_t * y_axis,
int16_t * z_axis )

Getting data function.

Parameters
ctxClick object.
x_axisAddress of a variable to store x-axis data.
y_axisAddress of a variable to store y-axis data.
z_axisAddress of a variable to store z-axis data.

@description This function gets data register values and sorts thair content into signed 16bit values.

◆ magneto7_get_fine_data()

void magneto7_get_fine_data ( magneto7_t * ctx,
uint16_t * x_axis,
uint16_t * y_axis,
uint16_t * z_axis )

Getting fine data function.

Parameters
ctxClick object.
x_axisAddress of a variable to store x-axis data.
y_axisAddress of a variable to store y-axis data.
z_axisAddress of a variable to store z-axis data.

@description This function gets fine data register values and sorts thair content into unsigned 16bit values.

◆ magneto7_get_gain_para()

void magneto7_get_gain_para ( magneto7_t * ctx,
uint16_t * x_axis,
uint16_t * y_axis,
uint16_t * z_axis )

Getting gain data function.

Parameters
ctxClick object.
x_axisAddress of a variable to store x-axis data.
y_axisAddress of a variable to store y-axis data.
z_axisAddress of a variable to store z-axis data.

@description This function gets gain data.

◆ magneto7_get_register()

uint8_t magneto7_get_register ( magneto7_t * ctx,
uint8_t register_address,
uint8_t * data_buffer,
uint8_t n_data )

Getting register value(s) function.

Parameters
ctxClick object.
register_addressRegister address.
data_bufferData buffer.
n_dataNumber of the bytes to be read

@description This function gets register value(s).

◆ magneto7_get_temperature()

void magneto7_get_temperature ( magneto7_t * ctx,
uint16_t * device_temperature )

Getting raw device temperature value function.

Parameters
ctxClick object.
device_temperatureAddress of a variable to store raw device temperature value.

@description This function gets raw device temperature value.

◆ magneto7_init()

MAGNETO7_RETVAL magneto7_init ( magneto7_t * ctx,
magneto7_cfg_t * cfg )

Initialization function.

Parameters
magneto7Click object.
cfgClick configuration structure.

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

◆ magneto7_int_get()

uint8_t magneto7_int_get ( magneto7_t * ctx)

Getting INT pin state function.

Parameters
ctxClick object.

@description This function returns INT pin state.

◆ magneto7_set_offset()

uint8_t magneto7_set_offset ( magneto7_t * ctx,
uint8_t offset_axis,
uint8_t offset_value )

Setting offset values function.

Parameters
ctxClick object.
offset_axisOffset axis.
offset_valueOffset value.

@description This function sets offset values.

◆ magneto7_set_register()

uint8_t magneto7_set_register ( magneto7_t * ctx,
uint8_t register_address,
uint8_t * data_buffer,
uint8_t n_data )

Setting register value(s) function.

Parameters
ctxClick object.
register_addressRegister address.
data_bufferData buffer.
n_dataNumber of the bytes to be read

@description This function sets register value(s).