digipot7 2.0.0.0
DIGI POT 7 Click Driver

API for configuring and manipulating DIGI POT 7 Click driver. More...

Topics

 DIGI POT 7 Registers Settings
 Settings for registers of DIGI POT 7 Click driver.
 
 DIGI POT 7 MikroBUS Map
 MikroBUS pin mapping of DIGI POT 7 Click driver.
 

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

API for configuring and manipulating DIGI POT 7 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ digipot7_cfg_setup()

void digipot7_cfg_setup ( digipot7_cfg_t * cfg)

DIGI POT 7 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See digipot7_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ digipot7_enable_write()

void digipot7_enable_write ( digipot7_t * ctx)

Enable write function.

The function enable write of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
Nothing.

◆ digipot7_generic_read()

uint16_t digipot7_generic_read ( digipot7_t * ctx,
uint8_t cmd,
uint8_t wiper_pos )

DIGI POT 7 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]cmd: Command operation. See #digipot7_set object definition for detailed explanation.
[in]wiper_pos: 10-bit data to be written.
Returns
10-bit read data.

◆ digipot7_generic_write()

void digipot7_generic_write ( digipot7_t * ctx,
uint8_t cmd,
uint16_t data_byte )

DIGI POT 7 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]cmd: Start register address.
[in]data_byte: Data to be written.
Returns
Nothing.

◆ digipot7_hw_reset()

void digipot7_hw_reset ( digipot7_t * ctx)

Hardware reset function.

The function reset the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
Nothing.

◆ digipot7_init()

err_t digipot7_init ( digipot7_t * ctx,
digipot7_cfg_t * cfg )

DIGI POT 7 initialization function.

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

Parameters
[out]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See digipot7_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ digipot7_next_frame_read()

uint16_t digipot7_next_frame_read ( digipot7_t * ctx,
uint8_t wiper_location )

Next frame read function.

The function next frame read of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]wiper_location: Wiper location ( from 0x00 to the 0x38 ).
Returns
10-bit read data.

◆ digipot7_operating_mode()

void digipot7_operating_mode ( digipot7_t * ctx,
uint8_t mode )

Set operating mode function.

The function set operating mode of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]mode: Software shutdown options.
Returns
Nothing.

◆ digipot7_read_control()

uint8_t digipot7_read_control ( digipot7_t * ctx)

Read control register function.

The function read contents of the control register of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
control data

◆ digipot7_read_memory()

uint16_t digipot7_read_memory ( digipot7_t * ctx)

Read memory function.

The function read address of the last 50-TP programmed memory location of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
10-bit read data.

◆ digipot7_read_rdac()

uint16_t digipot7_read_rdac ( digipot7_t * ctx)

Read RDAC function.

The function read a 10-bit RDAC data of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
10-bit read data.

◆ digipot7_set_resistance()

err_t digipot7_set_resistance ( digipot7_t * ctx,
uint16_t res_ohm )

Set resistance function.

The function writes a 10-bit RDAC data of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]res_ohm: Resistance ( ohm ) from 0 to 10000.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ digipot7_store_wiper()

void digipot7_store_wiper ( digipot7_t * ctx)

Store wiper setting function.

The function store wiper setting, store RDAC setting to 50-TP of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
Nothing.

◆ digipot7_sw_reset()

void digipot7_sw_reset ( digipot7_t * ctx)

Software reset function.

The function software reset the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
Returns
Nothing.

◆ digipot7_write_rdac()

void digipot7_write_rdac ( digipot7_t * ctx,
uint16_t rdac_data )

Write RDAC function.

The function writes a 10-bit RDAC data of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the DIGI POT 7 click board.

Parameters
[in]ctx: Click context object. See digipot7_t object definition for detailed explanation.
[in]rdac_data: 10-bit rdac data.
Returns
Nothing.