current6 2.0.0.0
Current 6 Click Driver

API for configuring and manipulating Current 6 Click driver. More...

Topics

 Current 6 Registers List
 List of registers of Current 6 Click driver.
 
 Current 6 Registers Settings
 Settings for registers of Current 6 Click driver.
 
 Current 6 MikroBUS Map
 MikroBUS pin mapping of Current 6 Click driver.
 

Functions

void current6_cfg_setup (current6_cfg_t *cfg)
 Current 6 configuration object setup function.
 
err_t current6_init (current6_t *ctx, current6_cfg_t *cfg)
 Current 6 initialization function.
 
err_t current6_default_cfg (current6_t *ctx)
 Current 6 default configuration function.
 
err_t current6_write_byte (current6_t *ctx, uint8_t reg, uint8_t data_in)
 Current 6 write byte function.
 
err_t current6_read_byte (current6_t *ctx, uint8_t reg, uint8_t *data_out)
 Current 6 read byte function.
 
err_t current6_write_word (current6_t *ctx, uint8_t reg, uint16_t data_in)
 Current 6 write word function.
 
err_t current6_read_word (current6_t *ctx, uint8_t reg, uint16_t *data_out)
 Current 6 read word function.
 
err_t current6_read_32 (current6_t *ctx, uint32_t *data_out)
 Current 6 read 32-bit function.
 
uint8_t current6_get_alert_pin (current6_t *ctx)
 Current 6 get alert pin function.
 
err_t current6_read_data (current6_t *ctx, float *voltage, float *current)
 Current 6 read data function.
 
err_t current6_get_status (current6_t *ctx, uint16_t *status)
 Current 6 get status function.
 
err_t current6_enable_pec (current6_t *ctx)
 PEC Enable function.
 
err_t current6_disable_pec (current6_t *ctx)
 PEC Disable function.
 
void current6_enable_device (current6_t *ctx)
 Current 6 enable device function.
 
void current6_disable_device (current6_t *ctx)
 Current 6 disable device function.
 

Detailed Description

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

◆ current6_cfg_setup()

void current6_cfg_setup ( current6_cfg_t * cfg)

Current 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ current6_default_cfg()

err_t current6_default_cfg ( current6_t * ctx)

Current 6 default configuration function.

This function executes a default configuration of Current 6 click board.

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

◆ current6_disable_device()

void current6_disable_device ( current6_t * ctx)

Current 6 disable device function.

This function disables the device by setting the EN pin to low logic state.

Parameters
[in]ctx: Click context object. See current6_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ current6_disable_pec()

err_t current6_disable_pec ( current6_t * ctx)

PEC Disable function.

This function disables PEC.

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

◆ current6_enable_device()

void current6_enable_device ( current6_t * ctx)

Current 6 enable device function.

This function enables the device by setting the EN pin to high logic state.

Parameters
[in]ctx: Click context object. See current6_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ current6_enable_pec()

err_t current6_enable_pec ( current6_t * ctx)

PEC Enable function.

This function enables PEC.

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

◆ current6_get_alert_pin()

uint8_t current6_get_alert_pin ( current6_t * ctx)

Current 6 get alert pin function.

This function returns the alert pin logic state.

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

◆ current6_get_status()

err_t current6_get_status ( current6_t * ctx,
uint16_t * status )

Current 6 get status function.

This function reads and clears the status register.

Parameters
[in]ctx: Click context object. See current6_t object definition for detailed explanation.
[out]status: Status register value before clearing.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ current6_init()

err_t current6_init ( current6_t * ctx,
current6_cfg_t * cfg )

Current 6 initialization function.

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

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

◆ current6_read_32()

err_t current6_read_32 ( current6_t * ctx,
uint32_t * data_out )

Current 6 read 32-bit function.

This function reads four bytes of data from the 32-bit data register by using I2C serial interface.

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

◆ current6_read_byte()

err_t current6_read_byte ( current6_t * ctx,
uint8_t reg,
uint8_t * data_out )

Current 6 read byte function.

This function reads one byte of data from the selected byte register by using I2C serial interface.

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

◆ current6_read_data()

err_t current6_read_data ( current6_t * ctx,
float * voltage,
float * current )

Current 6 read data function.

This function reads the input voltage and current measurement values.

Parameters
[in]ctx: Click context object. See current6_t object definition for detailed explanation.
[out]voltage: Voltage in Volts.
[out]current: Current in Ampers.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ current6_read_word()

err_t current6_read_word ( current6_t * ctx,
uint8_t reg,
uint16_t * data_out )

Current 6 read word function.

This function reads two bytes of data from the selected word register by using I2C serial interface.

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

◆ current6_write_byte()

err_t current6_write_byte ( current6_t * ctx,
uint8_t reg,
uint8_t data_in )

Current 6 write byte function.

This function writes one byte of data to the selected byte register by using I2C serial interface.

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

◆ current6_write_word()

err_t current6_write_word ( current6_t * ctx,
uint8_t reg,
uint16_t data_in )

Current 6 write word function.

This function writes two bytes of data to the selected word register by using I2C serial interface.

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