digipot7 2.0.0.0
digipot7.h File Reference

This file contains API for DIGI POT 7 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  digipot7_t
 DIGI POT 7 Click context object. More...
 
struct  digipot7_cfg_t
 DIGI POT 7 Click configuration object. More...
 

Macros

#define DIGIPOT7_COMMAND_NOP   0x00
 DIGI POT 7 description setting.
 
#define DIGIPOT7_COMMAND_WRITE_RDAC   0x04
 
#define DIGIPOT7_COMMAND_READ_RDAC   0x08
 
#define DIGIPOT7_COMMAND_STORE_WIPER   0x0C
 
#define DIGIPOT7_COMMAND_SW_RESET   0x10
 
#define DIGIPOT7_COMMAND_READ_50TP   0x14
 
#define DIGIPOT7_COMMAND_READ_MEMORY   0x18
 
#define DIGIPOT7_COMMAND_WRITE_MEMORY   0x1C
 
#define DIGIPOT7_COMMAND_READ_CONTROL   0x20
 
#define DIGIPOT7_COMMAND_SW_SHUTDOWN   0x24
 
#define DIGIPOT7_SHUTDOWN_BIT_MASK   0x01
 DIGI POT 7 device software shutdown setting.
 
#define DIGIPOT7_NORMAL_MODE   0x00
 
#define DIGIPOT7_SHUTDOWN_MODE   0x01
 
#define DIGIPOT7_CTRL_REG_BIT_MASK   0x0B
 DIGI POT 7 device bit map setting.
 
#define DIGIPOT7_FUSE_PROGRAM_SUCCESSFUL   0x00
 
#define DIGIPOT7_FUSE_PROGRAM_UNSUCCESSFUL   0x08
 
#define DIGIPOT7_WIPER_POS_FROZEN   0x00
 
#define DIGIPOT7_UPDATE_WIPER_POS   0x02
 
#define DIGIPOT7_50T_PROGRAM_DISABLED   0x00
 
#define DIGIPOT7_50T_PROGRAM_ENABLE   0x01
 
#define DIGIPOT7_10_BIT   0x03FF
 DIGI POT 7 device state setting.
 
#define DIGIPOT7_DUMMY   0x0000
 
#define DIGIPOT7_I2C_SLAVE_ADDRESS_GND   0x2F
 DIGI POT 7 device address setting.
 
#define DIGIPOT7_I2C_SLAVE_ADDRESS_VCC   0x2C
 
#define DIGIPOT7_I2C_SLAVE_ADDRESS_NC   0x2E
 
#define DIGIPOT7_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  digipot7_return_value_t { DIGIPOT7_OK = 0 , DIGIPOT7_ERROR = -1 }
 DIGI POT 7 Click return value data. More...
 

Functions

void digipot7_cfg_setup (digipot7_cfg_t *cfg)
 DIGI POT 7 configuration object setup function.
 
err_t digipot7_init (digipot7_t *ctx, digipot7_cfg_t *cfg)
 DIGI POT 7 initialization function.
 
void digipot7_generic_write (digipot7_t *ctx, uint8_t cmd, uint16_t data_byte)
 DIGI POT 7 I2C writing function.
 
uint16_t digipot7_generic_read (digipot7_t *ctx, uint8_t cmd, uint8_t wiper_pos)
 DIGI POT 7 I2C reading function.
 
void digipot7_hw_reset (digipot7_t *ctx)
 Hardware reset function.
 
void digipot7_enable_write (digipot7_t *ctx)
 Enable write function.
 
uint16_t digipot7_read_rdac (digipot7_t *ctx)
 Read RDAC function.
 
void digipot7_write_rdac (digipot7_t *ctx, uint16_t rdac_data)
 Write RDAC function.
 
err_t digipot7_set_resistance (digipot7_t *ctx, uint16_t res_ohm)
 Set resistance function.
 
void digipot7_sw_reset (digipot7_t *ctx)
 Software reset function.
 
void digipot7_store_wiper (digipot7_t *ctx)
 Store wiper setting function.
 
void digipot7_operating_mode (digipot7_t *ctx, uint8_t mode)
 Set operating mode function.
 
uint16_t digipot7_next_frame_read (digipot7_t *ctx, uint8_t wiper_location)
 Next frame read function.
 
uint16_t digipot7_read_memory (digipot7_t *ctx)
 Read memory function.
 
uint8_t digipot7_read_control (digipot7_t *ctx)
 Read control register function.
 

Detailed Description

This file contains API for DIGI POT 7 Click Driver.

Enumeration Type Documentation

◆ digipot7_return_value_t

DIGI POT 7 Click return value data.

Predefined enum values for driver return values.

Enumerator
DIGIPOT7_OK 
DIGIPOT7_ERROR