digipot14 2.1.0.0
digipot14.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  digipot14_t
 DIGI POT 14 Click context object. More...
 
struct  digipot14_cfg_t
 DIGI POT 14 Click configuration object. More...
 

Macros

#define DIGIPOT14_VOLATILE_REG_WRA   0x00
 DIGI POT 14 description register.
 
#define DIGIPOT14_VOLATILE_REG_WRB   0x01
 
#define DIGIPOT14_VOLATILE_REG_ACR   0x10
 
#define DIGIPOT14_NON_VOLATILE_REG_IVRA   0x00
 
#define DIGIPOT14_NON_VOLATILE_REG_IVRB   0x01
 
#define DIGIPOT14_VOLATILE_REG_WRITE   0x80
 DIGI POT 14 Access Control Register values setting.
 
#define DIGIPOT14_NON_VOLATILE_REG_WRITE   0x00
 
#define DIGIPOT14_DISABLE_SHUT_DOWN   0x40
 
#define DIGIPOT14_ENABLE_SHUT_DOWN   0x00
 
#define DIGIPOT14_NON_VOLATILE_WR_IN_PROGRESS   0x20
 
#define DIGIPOT14_NON_VOLATILE_WR_NOT_IN_PROGRESS   0x00
 
#define DIGIPOT14_MAX_RESISTANCE_KOHM   100.0
 
#define DIGIPOT14_MAX_POSITION   255
 
#define DIGIPOT14_MAX_POSITION_NUM   256.0
 
#define DIGIPOT14_MIN_POSITION   0
 
#define DIGIPOT14_DEVICE_ADDRESS_000   0x50
 DIGI POT 14 device address setting.
 
#define DIGIPOT14_DEVICE_ADDRESS_001   0x51
 
#define DIGIPOT14_DEVICE_ADDRESS_010   0x52
 
#define DIGIPOT14_DEVICE_ADDRESS_011   0x53
 
#define DIGIPOT14_DEVICE_ADDRESS_100   0x54
 
#define DIGIPOT14_DEVICE_ADDRESS_101   0x55
 
#define DIGIPOT14_DEVICE_ADDRESS_110   0x56
 
#define DIGIPOT14_DEVICE_ADDRESS_111   0x57
 
#define DIGIPOT14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  digipot14_return_value_t { DIGIPOT14_OK = 0 , DIGIPOT14_ERROR = -1 }
 DIGI POT 14 Click return value data. More...
 

Functions

void digipot14_cfg_setup (digipot14_cfg_t *cfg)
 DIGI POT 14 configuration object setup function.
 
err_t digipot14_init (digipot14_t *ctx, digipot14_cfg_t *cfg)
 DIGI POT 14 initialization function.
 
err_t digipot14_default_cfg (digipot14_t *ctx)
 DIGI POT 14 default configuration function.
 
err_t digipot14_generic_write (digipot14_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 DIGI POT 14 I2C writing function.
 
err_t digipot14_generic_read (digipot14_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 DIGI POT 14 I2C reading function.
 
err_t digipot14_reg_write (digipot14_t *ctx, uint8_t reg, uint8_t data_in)
 DIGI POT 14 register write function.
 
err_t digipot14_reg_read (digipot14_t *ctx, uint8_t reg, uint8_t *data_out)
 DIGI POT 14 register reading function.
 
err_t digipot14_set_pot_a_wiper (digipot14_t *ctx, uint8_t wiper_pos)
 DIGI POT 14 set the wiper position of potentiometer A function.
 
err_t digipot14_set_pot_b_wiper (digipot14_t *ctx, uint8_t wiper_pos)
 DIGI POT 14 set the wiper position of potentiometer B function.
 

Detailed Description

This file contains API for DIGI POT 14 Click Driver.

Enumeration Type Documentation

◆ digipot14_return_value_t

DIGI POT 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
DIGIPOT14_OK 
DIGIPOT14_ERROR