gainamp3 2.0.0.0
gainamp3.h File Reference

This file contains API for GainAMP 3 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  gainamp3_t
 GainAMP 3 Click context object. More...
 
struct  gainamp3_cfg_t
 GainAMP 3 Click configuration object. More...
 

Macros

#define GAINAMP3_REG_GAIN_MUX   0x00
 GainAMP 3 register summary.
 
#define GAINAMP3_REG_RESET   0x01
 
#define GAINAMP3_REG_SYNC_CFG   0x02
 
#define GAINAMP3_REG_DIGITAL_ERR   0x03
 
#define GAINAMP3_REG_ANALOG_ERR   0x04
 
#define GAINAMP3_REG_GPIO_DATA   0x05
 
#define GAINAMP3_REG_INPUT_MUX   0x06
 
#define GAINAMP3_REG_WB_DETECT   0x07
 
#define GAINAMP3_REG_GPIO_DIR   0x08
 
#define GAINAMP3_REG_SCS   0x09
 
#define GAINAMP3_REG_ANALOG_ERR_DIS   0x0A
 
#define GAINAMP3_REG_DIGITAL_ERR_DIS   0x0B
 
#define GAINAMP3_REG_SF_CFG   0x0C
 
#define GAINAMP3_REG_ERR_CFG   0x0D
 
#define GAINAMP3_REG_TEST_MUX   0x0E
 
#define GAINAMP3_REG_EX_CURRENT_CFG   0x0F
 
#define GAINAMP3_REG_GAIN_CAL1   0x10
 
#define GAINAMP3_REG_GAIN_CAL2   0x11
 
#define GAINAMP3_REG_GAIN_CAL3   0x12
 
#define GAINAMP3_REG_GAIN_CAL4   0x13
 
#define GAINAMP3_REG_GAIN_CAL5   0x14
 
#define GAINAMP3_REG_GAIN_CAL6   0x15
 
#define GAINAMP3_REG_GAIN_CAL7   0x16
 
#define GAINAMP3_REG_GAIN_CAL8   0x17
 
#define GAINAMP3_REG_GAIN_CAL9   0x18
 
#define GAINAMP3_REG_GAIN_CAL10   0x19
 
#define GAINAMP3_REG_GAIN_CAL11   0x1A
 
#define GAINAMP3_REG_GAIN_CAL12   0x1B
 
#define GAINAMP3_REG_GAIN_CAL13   0x1C
 
#define GAINAMP3_REG_GAIN_CAL14   0x1D
 
#define GAINAMP3_REG_GAIN_CAL15   0x1E
 
#define GAINAMP3_REG_GAIN_CAL16   0x1F
 
#define GAINAMP3_REG_GAIN_CAL17   0x20
 
#define GAINAMP3_REG_GAIN_CAL18   0x21
 
#define GAINAMP3_REG_GAIN_CAL19   0x22
 
#define GAINAMP3_REG_GAIN_CAL20   0x23
 
#define GAINAMP3_REG_GAIN_CAL21   0x24
 
#define GAINAMP3_REG_GAIN_CAL22   0x25
 
#define GAINAMP3_REG_GAIN_CAL23   0x26
 
#define GAINAMP3_REG_GAIN_CAL24   0x27
 
#define GAINAMP3_REG_TRIG_CAL   0x2A
 
#define GAINAMP3_REG_M_CLK_CNT   0x2E
 
#define GAINAMP3_REG_DIE_REV_ID   0x2F
 
#define GAINAMP3_REG_PART_ID   0x64
 
#define GAINAMP3_SPI_CRC_ERR_DISABLE_BIT   0x20
 GainAMP 3 SPI CRC enable values.
 
#define GAINAMP3_SPI_CRC_ENABLE   0x01
 
#define GAINAMP3_SPI_CRC_DISABLE   0x00
 
#define GAINAMP3_DIE_REV_ID   0x30
 GainAMP 3 DIE revision identification value.
 
#define GAINAMP3_GAIN_1_OVER_16   0x00
 GainAMP 3 input amplifier gain levels values.
 
#define GAINAMP3_GAIN_1_OVER_8   0x01
 
#define GAINAMP3_GAIN_1_OVER_4   0x02
 
#define GAINAMP3_GAIN_1_OVER_2   0x03
 
#define GAINAMP3_GAIN_1   0x04
 
#define GAINAMP3_GAIN_2   0x05
 
#define GAINAMP3_GAIN_4   0x06
 
#define GAINAMP3_GAIN_8   0x07
 
#define GAINAMP3_GAIN_16   0x08
 
#define GAINAMP3_GAIN_32   0x09
 
#define GAINAMP3_GAIN_64   0x0A
 
#define GAINAMP3_GAIN_128   0x0B
 
#define GAINAMP3_GAIN_BITS_MASK   0x78
 
#define GAINAMP3_CHANNEL_1   0x00
 GainAMP 3 input channel values.
 
#define GAINAMP3_CHANNEL_2   0x01
 
#define GAINAMP3_CHANNEL_TEST   0x02
 
#define GAINAMP3_CHANNEL_SHORT_SWITCH   0x03
 
#define GAINAMP3_CHANNEL_BITS_MASK   0x60
 
#define GAINAMP3_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define GAINAMP3_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define GAINAMP3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  gainamp3_return_value_t { GAINAMP3_OK = 0 , GAINAMP3_ERROR = -1 }
 GainAMP 3 Click return value data. More...
 

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

This file contains API for GainAMP 3 Click Driver.

Enumeration Type Documentation

◆ gainamp3_return_value_t

GainAMP 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
GAINAMP3_OK 
GAINAMP3_ERROR