capwheel2 2.0.0.0

Functions

void capwheel2_cfg_setup (capwheel2_cfg_t *cfg)
 Config Object Initialization function.
 
CAPWHEEL2_RETVAL capwheel2_init (capwheel2_t *ctx, capwheel2_cfg_t *cfg)
 Initialization function.
 
uint8_t capwheel2_default_cfg (capwheel2_t *ctx)
 Click Default Configuration function.
 
void capwheel2_i2c_write_no_wait (capwheel2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Write function.
 
void capwheel2_i2c_read_no_wait (capwheel2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Read function.
 
uint8_t capwheel2_int_get (capwheel2_t *ctx)
 Getingg state of INT pin.
 
uint8_t capwheel2_wait_for_rdy (capwheel2_t *ctx)
 Waiting for RDY (INT) pin.
 
uint8_t capwheel2_i2c_read_wait (capwheel2_t *ctx, uint8_t register_address, uint8_t *read_buffer, uint8_t n_bytes)
 Read wait function.
 
uint8_t capwheel2_i2c_write_wait (capwheel2_t *ctx, uint8_t register_address, uint8_t *register_values, uint8_t n_bytes)
 Write wait function.
 

Detailed Description

Function Documentation

◆ capwheel2_cfg_setup()

void capwheel2_cfg_setup ( capwheel2_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.

◆ capwheel2_default_cfg()

uint8_t capwheel2_default_cfg ( capwheel2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Returns
Data buffer setted to default values.

@description This function executes default configuration for CapWheel2 click.

◆ capwheel2_i2c_read_no_wait()

void capwheel2_i2c_read_no_wait ( capwheel2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

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.

◆ capwheel2_i2c_read_wait()

uint8_t capwheel2_i2c_read_wait ( capwheel2_t * ctx,
uint8_t register_address,
uint8_t * read_buffer,
uint8_t n_bytes )

Read wait function.

Parameters
ctxClick object.
register_addressRegister address.
read_bufferBuffer to store register byte(s).
lenNumber of the bytes to be read.
Returns
0 if no error occured during setup, or 1 if error occured.

@description This function reads data from the desired register.

◆ capwheel2_i2c_write_no_wait()

void capwheel2_i2c_write_no_wait ( capwheel2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

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.

◆ capwheel2_i2c_write_wait()

uint8_t capwheel2_i2c_write_wait ( capwheel2_t * ctx,
uint8_t register_address,
uint8_t * register_values,
uint8_t n_bytes )

Write wait function.

Parameters
ctxClick object.
register_addressRegister address.
register_valuesBuffer to store register value(s).
lenNumber of the bytes in data buf.
Returns
0 if no error occured during setup, or 1 if error occured.

@description This function sets register content.

Note
This function waits for RDY pin to go from HIGH to LOW in order to get register contents

◆ capwheel2_init()

CAPWHEEL2_RETVAL capwheel2_init ( capwheel2_t * ctx,
capwheel2_cfg_t * cfg )

Initialization function.

Parameters
capwheel2Click object.
cfgClick configuration structure.

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

◆ capwheel2_int_get()

uint8_t capwheel2_int_get ( capwheel2_t * ctx)

Getingg state of INT pin.

Parameters
ctxClick object.
Returns
1 for HIGH pin state, or 0 for LOW pin state.

@description This function gets state of INT pin.

◆ capwheel2_wait_for_rdy()

uint8_t capwheel2_wait_for_rdy ( capwheel2_t * ctx)

Waiting for RDY (INT) pin.

Parameters
ctxClick object.
Returns
0 if RDY pin went from HIGH to LOW state, or 1 if it did not go from HIGH to LOW state within 4,294,967,295(2^32 - 1) iterations.

@description This function waits for RDY pin to transition from HIGH to LOW state.