tiltnshake 2.0.0.0

Functions

void tiltnshake_cfg_setup (tiltnshake_cfg_t *cfg)
 Config Object Initialization function.
 
err_t tiltnshake_init (tiltnshake_t *ctx, tiltnshake_cfg_t *cfg)
 Initialization function.
 
void tiltnshake_generic_write (tiltnshake_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void tiltnshake_generic_read (tiltnshake_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void tiltnshake_enable (tiltnshake_t *ctx)
 Function for enabling chip.
 
void tiltnshake_disable (tiltnshake_t *ctx)
 Function for disabling chip.
 
void tiltnshake_read_status_and_axis (tiltnshake_t *ctx, uint8_t *status, float *out_x, float *out_y, float *out_z)
 Function for read status and axis.
 

Detailed Description

Function Documentation

◆ tiltnshake_cfg_setup()

void tiltnshake_cfg_setup ( tiltnshake_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.

◆ tiltnshake_disable()

void tiltnshake_disable ( tiltnshake_t * ctx)

Function for disabling chip.

Parameters
ctxClick object.

Disables chip

◆ tiltnshake_enable()

void tiltnshake_enable ( tiltnshake_t * ctx)

Function for enabling chip.

Parameters
ctxClick object.

Enables chip

◆ tiltnshake_generic_read()

void tiltnshake_generic_read ( tiltnshake_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

This function reads data from the desired register.

◆ tiltnshake_generic_write()

void tiltnshake_generic_write ( tiltnshake_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.

This function writes data to the desired register.

◆ tiltnshake_init()

err_t tiltnshake_init ( tiltnshake_t * ctx,
tiltnshake_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ tiltnshake_read_status_and_axis()

void tiltnshake_read_status_and_axis ( tiltnshake_t * ctx,
uint8_t * status,
float * out_x,
float * out_y,
float * out_z )

Function for read status and axis.

Parameters
ctxClick object.
statusStatus register value
out_xAxis x
out_yAxis y
out_zAxis z

Reads status register and then reads axis X Y Z like 14 bit data and places them in addresses