currentlimit7 2.0.0.0
Current Limit 7 Click Driver

API for configuring and manipulating Current Limit 7 Click driver. More...

Topics

 Current Limit 7 Registers List
 List of registers of Current Limit 7 Click driver.
 
 Current Limit 7 Registers Settings
 Settings for registers of Current Limit 7 Click driver.
 
 Current Limit 7 MikroBUS Map
 MikroBUS pin mapping of Current Limit 7 Click driver.
 
 Currentlimit7_cmd
 

Functions

void currentlimit7_cfg_setup (currentlimit7_cfg_t *cfg)
 Current Limit 7 configuration object setup function.
 
err_t currentlimit7_init (currentlimit7_t *ctx, currentlimit7_cfg_t *cfg)
 Current Limit 7 initialization function.
 
err_t currentlimit7_default_cfg (currentlimit7_t *ctx)
 Current Limit 7 default configuration function.
 
err_t currentlimit7_set_slave_address (currentlimit7_t *ctx, uint16_t slave_address)
 Current Limit 7 set I2C Slave address.
 
err_t currentlimit7_hw_reset (currentlimit7_t *ctx)
 Current Limit 7 hardware reset function.
 
err_t currentlimit7_set_enable (currentlimit7_t *ctx)
 Current Limit 7 enable the device function.
 
err_t currentlimit7_set_disable (currentlimit7_t *ctx)
 Current Limit 7 disable the device function.
 
err_t currentlimit7_generic_write (currentlimit7_t *ctx, uint8_t cmd, uint16_t data_byte)
 Current Limit 7 I2C writing function.
 
err_t currentlimit7_generic_read (currentlimit7_t *ctx, uint8_t cmd, uint16_t data_byte, uint16_t *data_out)
 Current Limit 7 I2C reading function.
 
err_t currentlimit7_enable_write (currentlimit7_t *ctx)
 Current Limit 7 enable write function.
 
err_t currentlimit7_write_rdac (currentlimit7_t *ctx, uint16_t data_in)
 Current Limit 7 write RDAC function.
 
err_t currentlimit7_read_rdac (currentlimit7_t *ctx, uint16_t *data_out)
 Current Limit 7 read RDAC function.
 
err_t currentlimit7_sw_reset (currentlimit7_t *ctx)
 Current Limit 7 software reset function.
 
err_t currentlimit7_store_wiper (currentlimit7_t *ctx)
 Current Limit 7 store wiper function.
 
err_t currentlimit7_next_frame_read (currentlimit7_t *ctx, uint8_t wiper_location, uint16_t *data_out)
 Current Limit 7 next frame read function.
 
err_t currentlimit7_read_memory (currentlimit7_t *ctx, uint8_t wiper_location, uint16_t *data_out)
 Current Limit 7 read memory function.
 
err_t currentlimit7_operating_mode (currentlimit7_t *ctx, uint8_t mode)
 Current Limit 7 set operating mode function.
 
err_t currentlimit7_set_digi_pot (currentlimit7_t *ctx, uint16_t wiper_pos)
 Current Limit 7 set DIGI POT function.
 
err_t currentlimit7_set_resistance (currentlimit7_t *ctx, uint32_t res_ohm)
 Current Limit 7 set resistance function.
 
err_t currentlimit7_set_current_limit (currentlimit7_t *ctx, uint8_t op_mode, uint16_t current_limit_ma)
 Current Limit 7 set current limit function.
 
uint8_t currentlimit7_get_fault (currentlimit7_t *ctx)
 Current Limit 7 get fault function.
 

Detailed Description

API for configuring and manipulating Current Limit 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

◆ currentlimit7_cfg_setup()

void currentlimit7_cfg_setup ( currentlimit7_cfg_t * cfg)

Current Limit 7 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ currentlimit7_default_cfg()

err_t currentlimit7_default_cfg ( currentlimit7_t * ctx)

Current Limit 7 default configuration function.

This function executes a default configuration of Current Limit 7 click board.

Parameters
[in]ctx: Click context object. See currentlimit7_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.

◆ currentlimit7_enable_write()

err_t currentlimit7_enable_write ( currentlimit7_t * ctx)

Current Limit 7 enable write function.

This function set command enable write of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

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

◆ currentlimit7_generic_read()

err_t currentlimit7_generic_read ( currentlimit7_t * ctx,
uint8_t cmd,
uint16_t data_byte,
uint16_t * data_out )

Current Limit 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 currentlimit7_t object definition for detailed explanation.
[in]cmd: Command.
[in]data_byte: Data to be written.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_generic_write()

err_t currentlimit7_generic_write ( currentlimit7_t * ctx,
uint8_t cmd,
uint16_t data_byte )

Current Limit 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 currentlimit7_t object definition for detailed explanation.
[in]cmd: Command.
[in]data_byte: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_get_fault()

uint8_t currentlimit7_get_fault ( currentlimit7_t * ctx)

Current Limit 7 get fault function.

This function get state of the FLT ( INT ) pin of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
Returns
  • 0 - Overload fault duration exceeds the blanking time, reverse current is detected, thermal shutdown mode is active.
  • 1 - Ok.
Note
None.

◆ currentlimit7_hw_reset()

err_t currentlimit7_hw_reset ( currentlimit7_t * ctx)

Current Limit 7 hardware reset function.

This function performs the hardware reset of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

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

◆ currentlimit7_init()

err_t currentlimit7_init ( currentlimit7_t * ctx,
currentlimit7_cfg_t * cfg )

Current Limit 7 initialization function.

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

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

◆ currentlimit7_next_frame_read()

err_t currentlimit7_next_frame_read ( currentlimit7_t * ctx,
uint8_t wiper_location,
uint16_t * data_out )

Current Limit 7 next frame read function.

This function next frame read of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]wiper_location: Wiper location ( from 0x00 to the 0x38 ).
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_operating_mode()

err_t currentlimit7_operating_mode ( currentlimit7_t * ctx,
uint8_t mode )

Current Limit 7 set operating mode function.

This function select operating mode, Shutdown or Normal mode of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]mode: Operating mode: Shutdown or Normal mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_read_memory()

err_t currentlimit7_read_memory ( currentlimit7_t * ctx,
uint8_t wiper_location,
uint16_t * data_out )

Current Limit 7 read memory function.

This function read memory of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]wiper_location: Wiper location ( from 0x00 to the 0x38 ).
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_read_rdac()

err_t currentlimit7_read_rdac ( currentlimit7_t * ctx,
uint16_t * data_out )

Current Limit 7 read RDAC function.

This function read a 10-bit RDAC of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

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

◆ currentlimit7_set_current_limit()

err_t currentlimit7_set_current_limit ( currentlimit7_t * ctx,
uint8_t op_mode,
uint16_t current_limit_ma )

Current Limit 7 set current limit function.

This function set current limit of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]op_mode: Operating mode:
  • 0 ( CURRENTLIMIT7_OP_MODE_500_mA_2500_mA ) - Limit range from 500 mA to 2500 mA.
  • 1 ( CURRENTLIMIT7_OP_MODE_250_mA_500_mA ) - Limit range from 250 mA to 500 mA.
[in]current_limit_ma: current limit [ mA ].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_set_digi_pot()

err_t currentlimit7_set_digi_pot ( currentlimit7_t * ctx,
uint16_t wiper_pos )

Current Limit 7 set DIGI POT function.

This function set DIGI POT wiper position of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]wiper_pos: Wiper position ( from 0 to 2047 ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_set_disable()

err_t currentlimit7_set_disable ( currentlimit7_t * ctx)

Current Limit 7 disable the device function.

This function enable the MAX14575,
250mA to 2.5A Adjustable Current-Limit Switches on the Current Limit 7 Click board™.

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

◆ currentlimit7_set_enable()

err_t currentlimit7_set_enable ( currentlimit7_t * ctx)

Current Limit 7 enable the device function.

This function enable the MAX14575,
250mA to 2.5A Adjustable Current-Limit Switches on the Current Limit 7 Click board™.

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

◆ currentlimit7_set_resistance()

err_t currentlimit7_set_resistance ( currentlimit7_t * ctx,
uint32_t res_ohm )

Current Limit 7 set resistance function.

This function set resistance of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]res_ohm: Resistance [ Ohm ].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ currentlimit7_set_slave_address()

err_t currentlimit7_set_slave_address ( currentlimit7_t * ctx,
uint16_t slave_address )

Current Limit 7 set I2C Slave address.

Sets I2C address of the subordinate I2C device to slave_address which is targeted by read and write operations.

Parameters
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
[in]slave_addressSpecified I2C slave address.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
It is recommended to check return value for error.

◆ currentlimit7_store_wiper()

err_t currentlimit7_store_wiper ( currentlimit7_t * ctx)

Current Limit 7 store wiper function.

This function store wiper setting, store RDAC setting to 50-TP of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

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

◆ currentlimit7_sw_reset()

err_t currentlimit7_sw_reset ( currentlimit7_t * ctx)

Current Limit 7 software reset function.

This function performs the software reset of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

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

◆ currentlimit7_write_rdac()

err_t currentlimit7_write_rdac ( currentlimit7_t * ctx,
uint16_t data_in )

Current Limit 7 write RDAC function.

This function writes a 10-bit RDAC of the selected AD5272, 1024-Position, 1% Resistor Tolerance Error, I2C Interface and 50-TP Memory Digital Rheostat on the Current Limit 7 Click board™.

Parameters
[in]data_in: 10-bit RDAC data.
[in]ctx: Click context object. See currentlimit7_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.