digipot2 2.0.0.0
digipot2.h File Reference

This file contains API for DIGI POT 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  digipot2_t
 DIGI POT 2 Click context object. More...
 
struct  digipot2_cfg_t
 DIGI POT 2 Click configuration object. More...
 

Macros

#define DIGIPOT2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 
#define DIGIPOT2_DATA_EEPROM_6   0x06
 DIGI POT 2 EEPROM data.
 
#define DIGIPOT2_DATA_EEPROM_7   0x07
 
#define DIGIPOT2_DATA_EEPROM_8   0x08
 
#define DIGIPOT2_DATA_EEPROM_9   0x09
 
#define DIGIPOT2_DATA_EEPROM_A   0x0A
 
#define DIGIPOT2_DATA_EEPROM_B   0x0B
 
#define DIGIPOT2_DATA_EEPROM_C   0x0C
 
#define DIGIPOT2_DATA_EEPROM_D   0x0D
 
#define DIGIPOT2_DATA_EEPROM_E   0x0E
 
#define DIGIPOT2_DATA_EEPROM_F   0x0F
 
#define DIGIPOT2_DATA_WRITE_CMD   0x20
 
#define DIGIPOT2_VOLATILE_WIPER_0   0x00
 DIGI POT 2 DIGIPOT2 Command.
 
#define DIGIPOT2_VOLATILE_WIPER_1   0x01
 
#define DIGIPOT2_NON_VOLATILE_WIPER_0   0x02
 
#define DIGIPOT2_NON_VOLATILE_WIPER_1   0x03
 
#define DIGIPOT2_VOLATILE_TCON_REGISTER   0x04
 
#define DIGIPOT2_STATUS_REGISTER   0x05
 

Enumerations

enum  digipot2_return_value_t { DIGIPOT2_OK = 0 , DIGIPOT2_ERROR = -1 }
 DIGI POT 2 Click return value data. More...
 

Functions

void digipot2_cfg_setup (digipot2_cfg_t *cfg)
 DIGI POT 2 configuration object setup function.
 
err_t digipot2_init (digipot2_t *ctx, digipot2_cfg_t *cfg)
 DIGI POT 2 initialization function.
 
void digipot2_generic_transfer (digipot2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void digipot2_set_wiper_positions (digipot2_t *ctx, uint8_t wiper_pos)
 Set wiper position.
 
float digipot2_convert_output (uint16_t adc_val, float v_ref)
 Convert ADC value to volatage.
 

Detailed Description

This file contains API for DIGI POT 2 Click Driver.

Enumeration Type Documentation

◆ digipot2_return_value_t

DIGI POT 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
DIGIPOT2_OK 
DIGIPOT2_ERROR