gainamp3 2.0.0.0
GainAMP 3 Click Driver

API for configuring and manipulating GainAMP 3 Click driver. More...

Topics

 GainAMP 3 Registers List
 List of registers of GainAMP 3 Click driver.
 
 GainAMP 3 Registers Settings
 Settings for registers of GainAMP 3 Click driver.
 
 GainAMP 3 MikroBUS Map
 MikroBUS pin mapping of GainAMP 3 Click driver.
 

Functions

void gainamp3_cfg_setup (gainamp3_cfg_t *cfg)
 GainAMP 3 configuration object setup function.
 
err_t gainamp3_init (gainamp3_t *ctx, gainamp3_cfg_t *cfg)
 GainAMP 3 initialization function.
 
err_t gainamp3_default_cfg (gainamp3_t *ctx)
 GainAMP 3 default configuration function.
 
err_t gainamp3_continuous_write (gainamp3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 GainAMP 3 continuous write function.
 
err_t gainamp3_continuous_read (gainamp3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 GainAMP 3 continuous read function.
 
err_t gainamp3_write_register (gainamp3_t *ctx, uint8_t reg, uint8_t data_in)
 GainAMP 3 write register function.
 
err_t gainamp3_read_register (gainamp3_t *ctx, uint8_t reg, uint8_t *data_out)
 GainAMP 3 read register function.
 
err_t gainamp3_verify_communication (gainamp3_t *ctx)
 GainAMP 3 verify communication function.
 
err_t gainamp3_set_amplifier_gain (gainamp3_t *ctx, uint8_t gain)
 GainAMP 3 set amplifier gain function.
 
err_t gainamp3_set_input_channel (gainamp3_t *ctx, uint8_t channel)
 GainAMP 3 set input channel function.
 
err_t gainamp3_software_reset (gainamp3_t *ctx)
 GainAMP 3 software reset function.
 

Detailed Description

API for configuring and manipulating GainAMP 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ gainamp3_cfg_setup()

void gainamp3_cfg_setup ( gainamp3_cfg_t * cfg)

GainAMP 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See gainamp3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ gainamp3_continuous_read()

err_t gainamp3_continuous_read ( gainamp3_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

GainAMP 3 continuous read function.

This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_continuous_write()

err_t gainamp3_continuous_write ( gainamp3_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

GainAMP 3 continuous write function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_default_cfg()

err_t gainamp3_default_cfg ( gainamp3_t * ctx)

GainAMP 3 default configuration function.

This function executes a default configuration of GainAMP 3 click board.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ gainamp3_init()

err_t gainamp3_init ( gainamp3_t * ctx,
gainamp3_cfg_t * cfg )

GainAMP 3 initialization function.

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

Parameters
[out]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See gainamp3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_read_register()

err_t gainamp3_read_register ( gainamp3_t * ctx,
uint8_t reg,
uint8_t * data_out )

GainAMP 3 read register function.

This function reads a data byte from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_set_amplifier_gain()

err_t gainamp3_set_amplifier_gain ( gainamp3_t * ctx,
uint8_t gain )

GainAMP 3 set amplifier gain function.

This function sets the amplifier gain level.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]gain: Amplifier gain level [0x00-0x0B].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_set_input_channel()

err_t gainamp3_set_input_channel ( gainamp3_t * ctx,
uint8_t channel )

GainAMP 3 set input channel function.

This function sets the input channel.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]channel: Input channel [0x00-0x03].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_software_reset()

err_t gainamp3_software_reset ( gainamp3_t * ctx)

GainAMP 3 software reset function.

This function performs the software reset.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_verify_communication()

err_t gainamp3_verify_communication ( gainamp3_t * ctx)

GainAMP 3 verify communication function.

This function verifies the communication by reading and verifying the DIE revision ID number.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ gainamp3_write_register()

err_t gainamp3_write_register ( gainamp3_t * ctx,
uint8_t reg,
uint8_t data_in )

GainAMP 3 write register function.

This function writes a data byte to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See gainamp3_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.