gainamp2 2.0.0.0
Public function

Functions

void gainamp2_cfg_setup (gainamp2_cfg_t *cfg)
 Config Object Initialization function.
 
GAINAMP2_RETVAL gainamp2_init (gainamp2_t *ctx, gainamp2_cfg_t *cfg)
 Initialization function.
 
void gainamp2_generic_transfer (gainamp2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void gainamp2_write_command (gainamp2_t *ctx, uint8_t instruction, uint8_t input)
 Send Command.
 
void gainamp2_set_channel_gain (gainamp2_t *ctx, uint8_t channel, uint8_t gain)
 Set the channel gain.
 
float gainamp2_get_voltage (gainamp2_t *ctx)
 Return voltage measured from OUT pin.
 

Detailed Description

Function Documentation

◆ gainamp2_cfg_setup()

void gainamp2_cfg_setup ( gainamp2_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.

◆ gainamp2_generic_transfer()

void gainamp2_generic_transfer ( gainamp2_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ gainamp2_get_voltage()

float gainamp2_get_voltage ( gainamp2_t * ctx)

Return voltage measured from OUT pin.

Parameters
ctxClick object.

@description This function returns voltage measured from OUT pin.

◆ gainamp2_init()

GAINAMP2_RETVAL gainamp2_init ( gainamp2_t * ctx,
gainamp2_cfg_t * cfg )

Initialization function.

Parameters
gainamp2Click object.
cfgClick configuration structure.

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

◆ gainamp2_set_channel_gain()

void gainamp2_set_channel_gain ( gainamp2_t * ctx,
uint8_t channel,
uint8_t gain )

Set the channel gain.

Parameters
ctxClick object.
channel
gain

@description This function sets the channel gain.

◆ gainamp2_write_command()

void gainamp2_write_command ( gainamp2_t * ctx,
uint8_t instruction,
uint8_t input )

Send Command.

Parameters
ctxClick object.
instruction
input

Function setup amplifier according to provided command.