accel7 2.0.0.0
Public function

Functions

void accel7_cfg_setup (accel7_cfg_t *cfg)
 Config Object Initialization function.
 
ACCEL7_RETVAL accel7_init (accel7_t *ctx, accel7_cfg_t *cfg)
 Initialization function.
 
void accel7_default_cfg (accel7_t *ctx, uint8_t resolution, uint8_t range)
 Click Default Configuration function.
 
void accel7_generic_write (accel7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void accel7_generic_read (accel7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void accel7_write_byte (accel7_t *ctx, uint8_t reg, uint8_t input_data)
 Write byte function.
 
uint8_t accel7_read_byte (accel7_t *ctx, uint8_t reg)
 Read byte function.
 
int16_t accel7_get_axis (accel7_t *ctx, uint8_t axis)
 Get axi function.
 
void accel7_res_range_cfg (accel7_t *ctx, uint8_t *resolution, uint8_t *range)
 Resolution/range configuration function.
 
uint8_t accel7_get_interrupt_state (accel7_t *ctx)
 Get interrupt state function.
 

Detailed Description

Function Documentation

◆ accel7_cfg_setup()

void accel7_cfg_setup ( accel7_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.

◆ accel7_default_cfg()

void accel7_default_cfg ( accel7_t * ctx,
uint8_t resolution,
uint8_t range )

Click Default Configuration function.

Parameters
ctxClick object.
resolutionResolution variable.
rangeRange variable.

@description This function executes default configuration for Accel7 click.

◆ accel7_generic_read()

void accel7_generic_read ( accel7_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.

◆ accel7_generic_write()

void accel7_generic_write ( accel7_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.

◆ accel7_get_axis()

int16_t accel7_get_axis ( accel7_t * ctx,
uint8_t axis )

Get axi function.

Parameters
ctxClick object.
axisAxis register address.

@description This function reads two bytes of data from the desired axis register.

◆ accel7_get_interrupt_state()

uint8_t accel7_get_interrupt_state ( accel7_t * ctx)

Get interrupt state function.

Parameters
ctxClick object.

@description This function reads the state of the interrupt pin.

◆ accel7_init()

ACCEL7_RETVAL accel7_init ( accel7_t * ctx,
accel7_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ accel7_read_byte()

uint8_t accel7_read_byte ( accel7_t * ctx,
uint8_t reg )

Read byte function.

Parameters
ctxClick object.
regRegister address.

@description This function reads one byte of data from the desired register.

◆ accel7_res_range_cfg()

void accel7_res_range_cfg ( accel7_t * ctx,
uint8_t * resolution,
uint8_t * range )

Resolution/range configuration function.

Parameters
ctxClick object.
resolutionResolution pointer.
rangeRange pointer.

@description This function calculates the resolution and range values which are used in the default_cfg() function.

◆ accel7_write_byte()

void accel7_write_byte ( accel7_t * ctx,
uint8_t reg,
uint8_t input_data )

Write byte function.

Parameters
ctxClick object.
regRegister address.
input_dataByte to be written.

@description This function writes one byte of data to the desired register.