gainamp2 2.0.0.0
gainamp2.h File Reference

This file contains API for GainAMP 2 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  gainamp2_t
 Click ctx object definition. More...
 
struct  gainamp2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define GAINAMP2_MAP_MIKROBUS(cfg, mikrobus)
 
#define GAINAMP2_RETVAL   uint8_t
 
#define GAINAMP2_OK   0x00
 
#define GAINAMP2_INIT_ERROR   0xFF
 
#define GAINAMP2_NOP_INS   0x00
 
#define GAINAMP2_SHUTDOWN_INS   0x20
 
#define GAINAMP2_WRITE_INS   0x40
 
#define GAINAMP2_CH   0x01
 
#define GAINAMP2_GAIN   0x00
 
#define GAINAMP2_GAIN_1X   0x00
 
#define GAINAMP2_GAIN_2X   0x01
 
#define GAINAMP2_GAIN_4X   0x02
 
#define GAINAMP2_GAIN_5X   0x03
 
#define GAINAMP2_GAIN_8X   0x04
 
#define GAINAMP2_GAIN_10X   0x05
 
#define GAINAMP2_GAIN_16X   0x06
 
#define GAINAMP2_GAIN_32X   0x07
 
#define GAINAMP2_CH0   0x00
 
#define GAINAMP2_CH1   0x01
 
#define GAINAMP2_CH2   0x02
 
#define GAINAMP2_CH3   0x03
 
#define GAINAMP2_CH4   0x04
 
#define GAINAMP2_CH5   0x05
 

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

This file contains API for GainAMP 2 Click driver.