magneto5 2.0.0.0
Public function

Functions

void magneto5_cfg_setup (magneto5_cfg_t *cfg)
 Config Object Initialization function.
 
MAGNETO5_RETVAL magneto5_init (magneto5_t *ctx, magneto5_cfg_t *cfg)
 Initialization function.
 
void magneto5_default_cfg (magneto5_t *ctx)
 Click Default Configuration function.
 
void magneto5_generic_write (magneto5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void magneto5_generic_read (magneto5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t magneto5_set_status_reg (magneto5_t *ctx)
 Functions reads status register.
 
uint8_t magneto5_get_product_id (magneto5_t *ctx)
 Functions reads product ID from register.
 
void magneto5_get_axis_data (magneto5_t *ctx, int16_t *axis_buffer, uint8_t max_resolution)
 Functions reads axis data.
 
float magneto5_get_axis_value (magneto5_t *ctx, uint8_t axis, uint8_t max_resolution)
 Functions reads axis data value.
 
void magneto5_config_register_0 (magneto5_t *ctx, uint8_t config_data)
 Functions sets configuration register 0.
 
void magneto5_config_register_1 (magneto5_t *ctx, uint8_t config_data)
 Functions sets configuration register 1.
 
void magneto5_reset (magneto5_t *ctx)
 Functions for reset data.
 

Detailed Description

Function Documentation

◆ magneto5_cfg_setup()

void magneto5_cfg_setup ( magneto5_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.

◆ magneto5_config_register_0()

void magneto5_config_register_0 ( magneto5_t * ctx,
uint8_t config_data )

Functions sets configuration register 0.

Parameters
ctxClick object.
config_dataData which be set.

@description Options for set: Take measurement, Continuous Measurement Mode, Frequency in continuous measurement mode (1.5Hz, 13Hz, 25Hz or 50 Hz), No Boost ( disable the charge pump ) SET / RESET Refill Cap.

◆ magneto5_config_register_1()

void magneto5_config_register_1 ( magneto5_t * ctx,
uint8_t config_data )

Functions sets configuration register 1.

Parameters
ctxClick object.
config_dataData which be set.

@description Options for set: X/Y/Z channel measurements, Self Test, Temperature test, Soft reset.

◆ magneto5_default_cfg()

void magneto5_default_cfg ( magneto5_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Magneto5 click.

◆ magneto5_generic_read()

void magneto5_generic_read ( magneto5_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.

◆ magneto5_generic_write()

void magneto5_generic_write ( magneto5_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.

◆ magneto5_get_axis_data()

void magneto5_get_axis_data ( magneto5_t * ctx,
int16_t * axis_buffer,
uint8_t max_resolution )

Functions reads axis data.

Parameters
ctxClick object.
axis_bufferBuffer in which axis data will be written.
max_resolutionMaximum resolution axis value.

@description This function gets axis data.

◆ magneto5_get_axis_value()

float magneto5_get_axis_value ( magneto5_t * ctx,
uint8_t axis,
uint8_t max_resolution )

Functions reads axis data value.

Parameters
ctxClick object.
axisAxis which be read.
max_resolutionMaximum resolution axis value.

@description This function float axis value.

◆ magneto5_get_product_id()

uint8_t magneto5_get_product_id ( magneto5_t * ctx)

Functions reads product ID from register.

Parameters
ctxClick object.

@description The function gets product id.

◆ magneto5_init()

MAGNETO5_RETVAL magneto5_init ( magneto5_t * ctx,
magneto5_cfg_t * cfg )

Initialization function.

Parameters
magneto5Click object.
cfgClick configuration structure.

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

◆ magneto5_reset()

void magneto5_reset ( magneto5_t * ctx)

Functions for reset data.

Parameters
ctxClick object.

@description This function is reset.

◆ magneto5_set_status_reg()

uint8_t magneto5_set_status_reg ( magneto5_t * ctx)

Functions reads status register.

Parameters
ctxClick object.

@description The function is used to check if the chip is ready to read data and measurment data.