digipot9 2.0.0.0
digipot9.h File Reference

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

Macros

#define DIGIPOT9_CMD_NOP   0
 DIGI POT 9 command bits list.
 
#define DIGIPOT9_CMD_RESTORE_EEMEM   1
 
#define DIGIPOT9_CMD_STORE_RDAC   2
 
#define DIGIPOT9_CMD_STORE_USER_DATA   3
 
#define DIGIPOT9_CMD_DECREMENT_6DB   4
 
#define DIGIPOT9_CMD_DECREMENT_ALL_6DB   5
 
#define DIGIPOT9_CMD_DECREMENT_ONE_STEP   6
 
#define DIGIPOT9_CMD_DECREMENT_ALL_ONE_STEP   7
 
#define DIGIPOT9_CMD_RESET_EEMEM   8
 
#define DIGIPOT9_CMD_READ_EEMEM   9
 
#define DIGIPOT9_CMD_READ_RDAC   10
 
#define DIGIPOT9_CMD_WRITE_DATA   11
 
#define DIGIPOT9_CMD_INCREMENT_6DB   12
 
#define DIGIPOT9_CMD_INCREMENT_ALL_6DB   13
 
#define DIGIPOT9_CMD_INCREMENT_ONE_STEP   14
 
#define DIGIPOT9_CMD_INCREMENT_ALL_ONE_STEP   15
 
#define DIGIPOT9_ADDRESS_RDAC1   0
 DIGI POT 9 address bits list.
 
#define DIGIPOT9_ADDRESS_RDAC2   1
 
#define DIGIPOT9_ADDRESS_USER_DATA_0   2
 
#define DIGIPOT9_ADDRESS_USER_DATA_1   3
 
#define DIGIPOT9_ADDRESS_USER_DATA_2   4
 
#define DIGIPOT9_ADDRESS_USER_DATA_3   5
 
#define DIGIPOT9_ADDRESS_USER_DATA_4   6
 
#define DIGIPOT9_ADDRESS_USER_DATA_5   7
 
#define DIGIPOT9_ADDRESS_USER_DATA_6   8
 
#define DIGIPOT9_ADDRESS_USER_DATA_7   9
 
#define DIGIPOT9_ADDRESS_USER_DATA_8   10
 
#define DIGIPOT9_ADDRESS_USER_DATA_9   11
 
#define DIGIPOT9_ADDRESS_USER_DATA_10   12
 
#define DIGIPOT9_ADDRESS_USER_DATA_11   13
 
#define DIGIPOT9_ADDRESS_USER_DATA_12   14
 
#define DIGIPOT9_ADDRESS_FACTORY_USAGE   15
 
#define DIGIPOT9_WIPER_FULL_SCALE   1023
 DIGI POT 9 Wiper setting.
 
#define DIGIPOT9_WIPER_MID_SCALE   512
 
#define DIGIPOT9_WIPER_ZERO_SCALE   0
 
#define DIGIPOT9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  digipot9_return_value_t { DIGIPOT9_OK = 0 , DIGIPOT9_ERROR = -1 }
 DIGI POT 9 Click return value data. More...
 

Functions

void digipot9_cfg_setup (digipot9_cfg_t *cfg)
 DIGI POT 9 configuration object setup function.
 
err_t digipot9_init (digipot9_t *ctx, digipot9_cfg_t *cfg)
 DIGI POT 9 initialization function.
 
void digipot9_default_cfg (digipot9_t *ctx)
 DIGI POT 9 default configuration function.
 
err_t digipot9_generic_write (digipot9_t *ctx, uint8_t command, uint8_t address, uint16_t data_in)
 DIGI POT 9 data writing function.
 
err_t digipot9_generic_read (digipot9_t *ctx, uint8_t command, uint8_t address, uint16_t *data_out)
 DIGI POT 9 data reading function.
 
err_t digipot9_set_wiper_1 (digipot9_t *ctx, uint16_t data_in)
 DIGI POT 9 Set wiper 1 function.
 
err_t digipot9_set_wiper_2 (digipot9_t *ctx, uint16_t data_in)
 DIGI POT 9 Set wiper 2 function.
 
void digipot9_set_pr_pin (digipot9_t *ctx, uint8_t state)
 DIGI POT 9 Set PR pin function.
 
void digipot9_set_wp_pin (digipot9_t *ctx, uint8_t state)
 DIGI POT 9 Set WP pin function.
 
uint8_t digipot9_get_rdy_pin (digipot9_t *ctx)
 DIGI POT 9 get RDY pin function.
 
err_t digipot9_write_user_data (digipot9_t *ctx, uint8_t address, uint16_t data_in)
 DIGI POT 9 write user data function.
 
err_t digipot9_read_user_data (digipot9_t *ctx, uint8_t address, uint16_t *data_out)
 DIGI POT 9 read user data function.
 

Detailed Description

This file contains API for DIGI POT 9 Click Driver.

Enumeration Type Documentation

◆ digipot9_return_value_t

DIGI POT 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
DIGIPOT9_OK 
DIGIPOT9_ERROR