digipot9 2.0.0.0
DIGI POT 9 Click Driver

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

Topics

 DIGI POT 9 Command byte List
 List of command bytes of DIGI POT 9 Click driver.
 
 DIGI POT 9 RDAC Settings
 Settings for RDAC of DIGI POT 9 Click driver.
 
 DIGI POT 9 MikroBUS Map
 MikroBUS pin mapping of DIGI POT 9 Click driver.
 

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

API for configuring and manipulating DIGI POT 9 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

◆ digipot9_cfg_setup()

void digipot9_cfg_setup ( digipot9_cfg_t * cfg)

DIGI POT 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ digipot9_default_cfg()

void digipot9_default_cfg ( digipot9_t * ctx)

DIGI POT 9 default configuration function.

This function executes a default configuration of DIGI POT 9 click board.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
Returns
None.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ digipot9_generic_read()

err_t digipot9_generic_read ( digipot9_t * ctx,
uint8_t command,
uint8_t address,
uint16_t * data_out )

DIGI POT 9 data reading function.

This function reads two data bytes from the selected command and address by using SPI serial interface.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]command: 4-bits command.
[in]address: 4-bits address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ digipot9_generic_write()

err_t digipot9_generic_write ( digipot9_t * ctx,
uint8_t command,
uint8_t address,
uint16_t data_in )

DIGI POT 9 data writing function.

This function writes two data bytes to the selected command and address by using SPI serial interface.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]command: 4-bits command.
[in]address: 4-bits address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ digipot9_get_rdy_pin()

uint8_t digipot9_get_rdy_pin ( digipot9_t * ctx)

DIGI POT 9 get RDY pin function.

This function returns the RDY pin logic state.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ digipot9_init()

err_t digipot9_init ( digipot9_t * ctx,
digipot9_cfg_t * cfg )

DIGI POT 9 initialization function.

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

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

◆ digipot9_read_user_data()

err_t digipot9_read_user_data ( digipot9_t * ctx,
uint8_t address,
uint16_t * data_out )

DIGI POT 9 read user data function.

This function reads two bytes of user data from a desired address of EEMEM.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]address: User data address in EEMEM [2-14].
[in]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ digipot9_set_pr_pin()

void digipot9_set_pr_pin ( digipot9_t * ctx,
uint8_t state )

DIGI POT 9 Set PR pin function.

This function sets the PR pin to desired logic state.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ digipot9_set_wiper_1()

err_t digipot9_set_wiper_1 ( digipot9_t * ctx,
uint16_t data_in )

DIGI POT 9 Set wiper 1 function.

This function sets wiper 1 to desired value.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]data_in: Data to be written to wiper 1 register.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ digipot9_set_wiper_2()

err_t digipot9_set_wiper_2 ( digipot9_t * ctx,
uint16_t data_in )

DIGI POT 9 Set wiper 2 function.

This function sets wiper 2 to desired value.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]data_in: Data to be written to wiper 2 register.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ digipot9_set_wp_pin()

void digipot9_set_wp_pin ( digipot9_t * ctx,
uint8_t state )

DIGI POT 9 Set WP pin function.

This function sets the WP pin to desired logic state.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ digipot9_write_user_data()

err_t digipot9_write_user_data ( digipot9_t * ctx,
uint8_t address,
uint16_t data_in )

DIGI POT 9 write user data function.

This function writes two bytes of user data to a desired address of EEMEM.

Parameters
[in]ctx: Click context object. See digipot9_t object definition for detailed explanation.
[in]address: User data address in EEMEM [2-14].
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.