gainamp 2.0.0.0
gainamp.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  gainamp_t
 GainAMP Click context object. More...
 
struct  gainamp_cfg_t
 GainAMP Click configuration object. More...
 

Macros

#define GAINAMP_CHANNEL_A_x0   0x00
 GainAMP description setting.
 
#define GAINAMP_CHANNEL_A_x1   0x01
 
#define GAINAMP_CHANNEL_A_x2   0x02
 
#define GAINAMP_CHANNEL_A_x5   0x03
 
#define GAINAMP_CHANNEL_A_x10   0x04
 
#define GAINAMP_CHANNEL_A_x20   0x05
 
#define GAINAMP_CHANNEL_A_x50   0x06
 
#define GAINAMP_CHANNEL_A_x100   0x07
 
#define GAINAMP_CHANNEL_A_SHUTDOWN   0x08
 
#define GAINAMP_CHANNEL_B_x0   0x00
 
#define GAINAMP_CHANNEL_B_x1   0x10
 
#define GAINAMP_CHANNEL_B_x2   0x20
 
#define GAINAMP_CHANNEL_B_x5   0x30
 
#define GAINAMP_CHANNEL_B_x10   0x40
 
#define GAINAMP_CHANNEL_B_x20   0x50
 
#define GAINAMP_CHANNEL_B_x50   0x60
 
#define GAINAMP_CHANNEL_B_x100   0x70
 
#define GAINAMP_CHANNEL_B_SHUTDOWN   0x80
 
#define GAINAMP_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define GAINAMP_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define GAINAMP_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  gainamp_return_value_t { GAINAMP_OK = 0 , GAINAMP_ERROR = -1 }
 GainAMP Click return value data. More...
 

Functions

void gainamp_cfg_setup (gainamp_cfg_t *cfg)
 GainAMP configuration object setup function.
 
err_t gainamp_init (gainamp_t *ctx, gainamp_cfg_t *cfg)
 GainAMP initialization function.
 
err_t gainamp_generic_write (gainamp_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 GainAMP data writing function.
 
err_t gainamp_generic_read (gainamp_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 GainAMP data reading function.
 
err_t gainamp_read_an_pin_value (gainamp_t *ctx, uint16_t *data_out)
 GainAMP read AN pin value function.
 
err_t gainamp_read_an_pin_voltage (gainamp_t *ctx, float *data_out)
 GainAMP read AN pin voltage level function.
 
void gainamp_reset (gainamp_t *ctx)
 Function for reset chip of the GainAMP Click.
 
void gainamp_set_gain (gainamp_t *ctx, uint8_t gain)
 Function for sets gain of the GainAMP Click.
 

Detailed Description

This file contains API for GainAMP Click Driver.

Enumeration Type Documentation

◆ gainamp_return_value_t

GainAMP Click return value data.

Predefined enum values for driver return values.

Enumerator
GAINAMP_OK 
GAINAMP_ERROR