digipot3 2.0.0.0
digipot3.h File Reference

This file contains API for DIGI POT 3 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  digipot3_t
 Click ctx object definition. More...
 
struct  digipot3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DIGIPOT3_MAP_MIKROBUS(cfg, mikrobus)
 
#define DIGIPOT3_RETVAL   uint8_t
 
#define DIGIPOT3_OK   0x00
 
#define DIGIPOT3_INIT_ERROR   0xFF
 
#define DIGIPOT3_DO_NOTHING_COMM   0x00
 
#define DIGIPOT3_RESTORE_EEMEM_TO_RDAC_COMM   0x01
 
#define DIGIPOT3_STORE_RDAC_TO_EEMEM_COMM   0x02
 
#define DIGIPOT3_DECREMENT_RDAC_6DB_COMM   0x04
 
#define DIGIPOT3_DECREMENT_RDAC_ONESTEP_COMM   0x06
 
#define DIGIPOT3_RESTORE_RDAC_WITH_EEMEM_COMM   0x08
 
#define DIGIPOT3_INCREMENT_RDAC_6DB_COMM   0x0C
 
#define DIGIPOT3_INCREMENT_RDAC_ONESTEP_COMM   0x0E
 
#define DIGIPOT3_RDAC_EEMEM_LOC   0x00
 
#define DIGIPOT3_O1_O2_EEMEM_LOC   0x01
 
#define DIGIPOT3_USER1_EEMEM_LOC   0x02
 
#define DIGIPOT3_USER2_EEMEM_LOC   0x03
 
#define DIGIPOT3_USER3_EEMEM_LOC   0x04
 
#define DIGIPOT3_USER4_EEMEM_LOC   0x05
 
#define DIGIPOT3_USER5_EEMEM_LOC   0x06
 
#define DIGIPOT3_USER6_EEMEM_LOC   0x07
 
#define DIGIPOT3_USER7_EEMEM_LOC   0x08
 
#define DIGIPOT3_USER8_EEMEM_LOC   0x09
 
#define DIGIPOT3_USER9_EEMEM_LOC   0x0A
 
#define DIGIPOT3_USER10_EEMEM_LOC   0x0B
 
#define DIGIPOT3_USER11_EEMEM_LOC   0x0C
 
#define DIGIPOT3_USER12_EEMEM_LOC   0x0D
 
#define DIGIPOT3_USER13_EEMEM_LOC   0x0E
 
#define DIGIPOT3_USER14_EEMEM_LOC   0x0F
 
#define DIGIPOT3_ZERO_SCALE   0x0000
 
#define DIGIPOT3_QUARTER_SCALE   0x0100
 
#define DIGIPOT3_HALF_SCALE   0x0200
 
#define DIGIPOT3_THREE_QUARTERS_SCALE   0x0300
 
#define DIGIPOT3_FULL_SCALE   0x03FF
 

Functions

void digipot3_cfg_setup (digipot3_cfg_t *cfg)
 Config Object Initialization function.
 
DIGIPOT3_RETVAL digipot3_init (digipot3_t *ctx, digipot3_cfg_t *cfg)
 Initialization function.
 
void digipot2_generic_transfer (digipot3_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint8_t digipot3_send_command (digipot3_t *ctx, uint8_t command_byte)
 Command Send function.
 
uint8_t digipot3_store_eemem (digipot3_t *ctx, uint8_t location_address, uint16_t transfer_data)
 EEMEM Store function.
 
uint8_t digipot3_read_eemem (digipot3_t *ctx, uint8_t location_address, uint16_t *data_out)
 EEMEM Read function.
 
uint8_t digipot3_write_dac (digipot3_t *ctx, uint16_t value_dac)
 DAC Write function.
 
void digipot3_read_dac (digipot3_t *ctx, uint16_t *data_out)
 DAC Read function.
 
uint8_t digipot3_check_data_ready (digipot3_t *ctx)
 Data Ready Check function.
 

Detailed Description

This file contains API for DIGI POT 3 Click driver.