geomagnetic  2.0.0.0
Functions

Functions

void geomagnetic_cfg_setup (geomagnetic_cfg_t *cfg)
 Config Object Initialization function. More...
 
GEOMAGNETIC_RETVAL geomagnetic_init (geomagnetic_t *ctx, geomagnetic_cfg_t *cfg)
 Initialization function. More...
 
void geomagnetic_default_cfg (geomagnetic_t *ctx)
 Click Default Configuration function. More...
 
void geomagnetic_generic_write (geomagnetic_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void geomagnetic_generic_read (geomagnetic_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
GEOMAGNETIC_RETVAL geomagnetic_write_byte (geomagnetic_t *ctx, uint8_t input_data, uint8_t address)
 Write byte function. More...
 
GEOMAGNETIC_RETVAL geomagnetic_read_data (geomagnetic_t *ctx, uint8_t *out_buf, uint8_t address, uint8_t len)
 Read data function. More...
 
uint8_t geomagnetic_check_ready (geomagnetic_t *ctx)
 Check ready function. More...
 
void geomagnetic_read_axis_data (geomagnetic_t *ctx, geomagnetic_axis_t *geomag_axis, uint16_t *resolution_hall)
 Read axis data function. More...
 
GEOMAGNETIC_RETVAL geomagnetic_check_interrupt (geomagnetic_t *ctx)
 Check interrupt function. More...
 
uint8_t get_interrupt (geomagnetic_t *ctx)
 Get interrupt function. More...
 
void geomagnetic_software_reset (geomagnetic_t *ctx)
 Software reset function. More...
 
void geomagnetic_power_on_reset (geomagnetic_t *ctx)
 Power ON reset function. More...
 

Detailed Description

Function Documentation

◆ geomagnetic_cfg_setup()

void geomagnetic_cfg_setup ( geomagnetic_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ geomagnetic_check_interrupt()

GEOMAGNETIC_RETVAL geomagnetic_check_interrupt ( geomagnetic_t ctx)

Check interrupt function.

Parameters
ctxClick object.

This function returns 1/0 depeinding on the input from the INT pin.

◆ geomagnetic_check_ready()

uint8_t geomagnetic_check_ready ( geomagnetic_t ctx)

Check ready function.

Parameters
ctxClick object.

This function gives feedback on whether the device is ready to measure or not.

◆ geomagnetic_default_cfg()

void geomagnetic_default_cfg ( geomagnetic_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for geomagnetic click.

◆ geomagnetic_generic_read()

void geomagnetic_generic_read ( geomagnetic_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.

This function reads data from the desired register.

◆ geomagnetic_generic_write()

void geomagnetic_generic_write ( geomagnetic_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

This function writes data to the desired register.

◆ geomagnetic_init()

GEOMAGNETIC_RETVAL geomagnetic_init ( geomagnetic_t ctx,
geomagnetic_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ geomagnetic_power_on_reset()

void geomagnetic_power_on_reset ( geomagnetic_t ctx)

Power ON reset function.

Parameters
ctxClick object.

This function configures some click module registers after the device has been reset.

◆ geomagnetic_read_axis_data()

void geomagnetic_read_axis_data ( geomagnetic_t ctx,
geomagnetic_axis_t geomag_axis,
uint16_t *  resolution_hall 
)

Read axis data function.

Parameters
ctxClick object.
geomag_axisAxis structures pointer.
resolution_hallHall effect digital resolution value.

This function sets the x/y/z axis and hall resolution value.

◆ geomagnetic_read_data()

GEOMAGNETIC_RETVAL geomagnetic_read_data ( geomagnetic_t ctx,
uint8_t *  out_buf,
uint8_t  address,
uint8_t  len 
)

Read data function.

Parameters
ctxClick object.
out_bufOutput buffer.
addressAddress variable.
lenSize of the output buffer.

This function reads n bytes of data from the specified address.

◆ geomagnetic_software_reset()

void geomagnetic_software_reset ( geomagnetic_t ctx)

Software reset function.

Parameters
ctxClick object.

This function resets the click module.

◆ geomagnetic_write_byte()

GEOMAGNETIC_RETVAL geomagnetic_write_byte ( geomagnetic_t ctx,
uint8_t  input_data,
uint8_t  address 
)

Write byte function.

Parameters
ctxClick object.
input_dataInput data variable.
addressAddress variable.

This function writes one byte of data to the specified address.

◆ get_interrupt()

uint8_t get_interrupt ( geomagnetic_t ctx)

Get interrupt function.

Parameters
ctxClick object.

This function returns the input value from the INT pin.