efuse2 2.0.0.0
eFuse 2 Click Driver

API for configuring and manipulating eFuse 2 Click driver. More...

Topics

 eFuse 2 Registers Settings
 Settings for registers of eFuse 2 Click driver.
 
 eFuse 2 MikroBUS Map
 MikroBUS pin mapping of eFuse 2 Click driver.
 

Functions

void efuse2_cfg_setup (efuse2_cfg_t *cfg)
 eFuse 2 configuration object setup function.
 
err_t efuse2_init (efuse2_t *ctx, efuse2_cfg_t *cfg)
 eFuse 2 initialization function.
 
err_t efuse2_default_cfg (efuse2_t *ctx)
 eFuse 2 default configuration function.
 
err_t efuse2_write_ad5241 (efuse2_t *ctx, ad5241_instru_t cmd, uint8_t data_byte)
 Generic write data to the AD5241 function.
 
uint8_t efuse2_read_ad5241 (efuse2_t *ctx)
 Generic read data from the AD5241 function.
 
void efuse2_hw_reset (efuse2_t *ctx)
 Hardware reset function.
 
err_t efuse2_set_operating_voltage (efuse2_t *ctx, float voltage, float *min_voltage, float *max_voltage)
 Set operating voltage function.
 
err_t efuse2_write_ad5175 (efuse2_t *ctx, uint8_t cmd, uint16_t data_byte)
 Generic write data to the AD5175 function.
 
uint16_t efuse2_read_ad5175 (efuse2_t *ctx, uint8_t cmd, uint8_t wiper_location)
 Generic read data from the AD5175 function.
 
uint16_t efuse2_read_rdac (efuse2_t *ctx)
 Read RDAC function.
 
err_t efuse2_enable_write (efuse2_t *ctx)
 Enable write function.
 
err_t efuse2_write_rdac (efuse2_t *ctx, uint16_t data_byte)
 Write RDAC function.
 
err_t efuse2_set_current_limit (efuse2_t *ctx, float current)
 Set operating current function.
 
err_t efuse2_sw_reset (efuse2_t *ctx)
 Software reset function.
 
err_t efuse2_store_wiper (efuse2_t *ctx)
 Store wiper setting function.
 
err_t efuse2_operating_mode (efuse2_t *ctx, uint8_t mode)
 Set operating mode function.
 
uint16_t efuse2_next_frame_read (efuse2_t *ctx, uint8_t wiper_location)
 Next frame read function.
 
uint16_t efuse2_read_memory (efuse2_t *ctx)
 Read memory function.
 
uint8_t efuse2_read_control (efuse2_t *ctx)
 Read control register function.
 
uint8_t efuse2_get_fault (efuse2_t *ctx)
 Get fault function.
 

Detailed Description

API for configuring and manipulating eFuse 2 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

◆ efuse2_cfg_setup()

void efuse2_cfg_setup ( efuse2_cfg_t * cfg)

eFuse 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ efuse2_default_cfg()

err_t efuse2_default_cfg ( efuse2_t * ctx)

eFuse 2 default configuration function.

This function executes a default configuration of eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ efuse2_enable_write()

err_t efuse2_enable_write ( efuse2_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 eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_get_fault()

uint8_t efuse2_get_fault ( efuse2_t * ctx)

Get fault function.

The function get state of the FLT ( INT ) pin, active low indicator which will be pulled low when a fault is detected. It is an open-drain output that requires an external pull-up resistance of the TPS2596 2.7 to 19 V, 0.125 to 2-A, 89-mO eFuse With Accurate Current Monitor and Fast Overvoltage Protection on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
State of the FLT ( INT ) pin.

◆ efuse2_hw_reset()

void efuse2_hw_reset ( efuse2_t * ctx)

Hardware reset function.

The function reset the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.

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

◆ efuse2_init()

err_t efuse2_init ( efuse2_t * ctx,
efuse2_cfg_t * cfg )

eFuse 2 initialization function.

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

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

◆ efuse2_next_frame_read()

uint16_t efuse2_next_frame_read ( efuse2_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 eFuse 2 click board.

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

◆ efuse2_operating_mode()

err_t efuse2_operating_mode ( efuse2_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 eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
[in]mode: Operation mode options
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_read_ad5175()

uint16_t efuse2_read_ad5175 ( efuse2_t * ctx,
uint8_t cmd,
uint8_t wiper_location )

Generic read data from the AD5175 function.

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

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
[in]cmd: Command Operation:
  • 0x00 ( EFUSE2_AD5175_COMMAND_NOP ) : NOP, do nothing.
  • 0x04 ( EFUSE2_AD5175_COMMAND_WRITE_RDAC ) : Write contents of serial register data to RDAC.
  • 0x08 ( EFUSE2_AD5175_COMMAND_READ_RDAC ) : Read contents of RDAC wiper register.
  • 0x0C ( EFUSE2_AD5175_COMMAND_STORE_WIPER ) : Store wiper setting: store RDAC setting to 50-TP.
  • 0x10 ( EFUSE2_AD5175_COMMAND_SW_RESET ) : Software reset: refresh RDAC with the last 50-TP memory stored value.
  • 0x14 ( EFUSE2_AD5175_COMMAND_READ_50TP ) : Read contents of 50-TP from the SDO output in the next frame.
  • 0x18 ( EFUSE2_AD5175_COMMAND_READ_MEMORY ) : Read address of the last 50-TP programmed memory location.
  • 0x1C ( EFUSE2_AD5175_COMMAND_WRITE_MEMORY ) : Write contents of the serial register data to the control register.
  • 0x20 ( EFUSE2_AD5175_COMMAND_READ_CONTROL ) : Read contents of the control register.
  • 0x24 ( EFUSE2_AD5175_COMMAND_SW_SHUTDOWN ) : Software shutdown.
[in]data_byte: 10-bit data to be written.
Returns
10-bit read data.

◆ efuse2_read_ad5241()

uint8_t efuse2_read_ad5241 ( efuse2_t * ctx)

Generic read data from the AD5241 function.

The function read a the byte of data from the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
Read the byte of the data.

◆ efuse2_read_control()

uint8_t efuse2_read_control ( efuse2_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 eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
Control data
  • 0x01 ( EFUSE2_AD5175_50T_PROGRAM_ENABLE ) : Enable device for 50-TP program.
  • 0x02 ( EFUSE2_AD5175_UPDATE_WIPER_POS ) : RDAC register write protect.
  • 0x08 ( EFUSE2_AD5175_FUSE_PROGRAM_UNSUCCESSFUL ) : Fuse program command successful.

◆ efuse2_read_memory()

uint16_t efuse2_read_memory ( efuse2_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 eFuse 2 click board.

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

◆ efuse2_read_rdac()

uint16_t efuse2_read_rdac ( efuse2_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 eFuse 2 click board.

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

◆ efuse2_set_current_limit()

err_t efuse2_set_current_limit ( efuse2_t * ctx,
float current )

Set operating current function.

The function set operating current of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
[in]current: Operating current ( from 0.125 A to the 2.0 A ).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_set_operating_voltage()

err_t efuse2_set_operating_voltage ( efuse2_t * ctx,
float voltage,
float * min_voltage,
float * max_voltage )

Set operating voltage function.

The function set operating voltage, OVLO and UVLO of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
[in]voltage: Operating voltage ( from 3.65 V to the 15.0 V ).
[in]min_voltage: Pointer to the memory location where UVLO data is stored.
[in]max_voltage: Pointer to the memory location where OVLO data is stored.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_store_wiper()

err_t efuse2_store_wiper ( efuse2_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 eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_sw_reset()

err_t efuse2_sw_reset ( efuse2_t * ctx)

Software reset function.

The function software reset the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_write_ad5175()

err_t efuse2_write_ad5175 ( efuse2_t * ctx,
uint8_t cmd,
uint16_t data_byte )

Generic write data to the AD5175 function.

The function writes a 10-bit data to the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
[in]cmd: Pointer to the memory location where data is stored.
[in]data_byte: 10-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_write_ad5241()

err_t efuse2_write_ad5241 ( efuse2_t * ctx,
ad5241_instru_t cmd,
uint8_t data_byte )

Generic write data to the AD5241 function.

The function writes a the byte of data and instruction of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
[in]cmd: Pointer to the memory location where data is stored.
[in]data_byte: Byte of the data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ efuse2_write_rdac()

err_t efuse2_write_rdac ( efuse2_t * ctx,
uint16_t data_byte )

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 eFuse 2 click board.

Parameters
[in]ctx: Click context object. See efuse2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.