digipot3 2.0.0.0

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

Function Documentation

◆ digipot2_generic_transfer()

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.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ digipot3_cfg_setup()

void digipot3_cfg_setup ( digipot3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ digipot3_check_data_ready()

uint8_t digipot3_check_data_ready ( digipot3_t * ctx)

Data Ready Check function.

Parameters
ctxClick object.

@description This function checks is command executed or not.

◆ digipot3_init()

DIGIPOT3_RETVAL digipot3_init ( digipot3_t * ctx,
digipot3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ digipot3_read_dac()

void digipot3_read_dac ( digipot3_t * ctx,
uint16_t * data_out )

DAC Read function.

Parameters
ctxClick object.
data_outBuffer where DAC value be stored.

@description This function reads 10-bit value from DAC register (wiper position).

◆ digipot3_read_eemem()

uint8_t digipot3_read_eemem ( digipot3_t * ctx,
uint8_t location_address,
uint16_t * data_out )

EEMEM Read function.

Parameters
ctxClick object.
location_addressEEMEM location which from data be read.
data_outBuffer where data be stored.

@description This function reads 16-bit data from the EEMEM (non volatile) memory location.

◆ digipot3_send_command()

uint8_t digipot3_send_command ( digipot3_t * ctx,
uint8_t command_byte )

Command Send function.

Parameters
ctxClick object.
command_byteCommand which be executed.

@description This function executes the desired command.

◆ digipot3_store_eemem()

uint8_t digipot3_store_eemem ( digipot3_t * ctx,
uint8_t location_address,
uint16_t transfer_data )

EEMEM Store function.

Parameters
ctxClick object.
location_addressEEMEM location where data be stored.
transfer_dataData which be stored.

@description This function stores 16-bit data to the desired EEMEM (non volatile) memory location.

◆ digipot3_write_dac()

uint8_t digipot3_write_dac ( digipot3_t * ctx,
uint16_t value_dac )

DAC Write function.

Parameters
ctxClick object.
value_dacDetermines the wiper position.

@description This function writes 10-bit value to DAC register and determines the wiper position.